awsx-common

command module
v1.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Documentation for getting lambda clients

This package is created for getting different type of aws service clients for synectiks appkube-awsx project

List of function that are created in this package

S.No. Functions Accepted arguments Return type (from aws)
1. GetClient() (auth Auth, clientType string) interface{}

These function accepts 'auth' struct that is following

    type Auth struct {
    VaultUrl            string `json:"vaultUrl,omitempty"`
    VaultToken          string `json:"vaultToken,omitempty"`
    VaultKey            string `json:"vaultKey,omitempty"`
    Region              string `json:"region,omitempty"`
    CrossAccountRoleArn string `json:"crossAccountRoleArn,omitempty"`
    AccessKey           string `json:"accessKey,omitempty"`
    SecretKey           string `json:"secretKey,omitempty"`
    ExternalId          string `json:"externalId,omitempty"`
    }
List of client types
    const (
        LAMBDA_CLIENT  = "lambda"
        COST_EXPLORER  = "costExplorer"
        CLOUDWATCH_LOG = "cloudWatchLog"
    )

Example of using function

example for lambda

    auth := client.Auth{
        "us-east-1",
        os.Getenv("AWS_CROSS_ARN"),
        os.Getenv("AWS_ACCKEY"),
        os.Getenv("AWS_SECKEY"),
        os.Getenv("AWS_EXTERNALID"),
    }

    lambdaClient := client.GetClient(auth, client.LAMBDA_CLIENT).(*lambda.Lambda)
Project structure
client
    - client.go
    - session.go

main.go (This is just for testing)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL