cloudaws

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectAWSCredentialsExported

func DetectAWSCredentialsExported() bool

func GetAllExportedAWSCredentials

func GetAllExportedAWSCredentials() map[string]string

func IsAWSCredSet

func IsAWSCredSet(key string) error

func NewAWSDefaultConfig

func NewAWSDefaultConfig(ctx context.Context, region string) (aws.Config, error)

NewAWSDefaultConfig returns a new aws.Config with the default credentials It is a wrapper around awsCfg.LoadDefaultConfig

Types

type AWSAdapter

type AWSAdapter struct {
	Region string
	// Add clients here.
	ECSClient            *ecs.Client
	ECRClient            *ecr.Client
	S3Client             *s3.Client
	DynamoDBClient       *dynamodb.Client
	CloudWatchLogsClient *cloudwatchlogs.Client
	SecretsManagerClient *secretsmanager.Client
	// Add general purpose logger.
	Logger o11y.LoggerInterface
}

type AWSCred

type AWSCred struct {
	Key   string
	Value string
	IsSet bool
}

func GetAWSCredentialsReport

func GetAWSCredentialsReport() []AWSCred

func GetAWSCredentialsValueByKey

func GetAWSCredentialsValueByKey(key string) (*AWSCred, error)

type AWSCreds

type AWSCreds struct {
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) Build

func (b *Builder) Build(optFns ...func(*InitAWSAdapterOptions) error) (*AWSAdapter, error)

func (*Builder) WithCloudWatchLogs

func (b *Builder) WithCloudWatchLogs() func(*InitAWSAdapterOptions) error

func (*Builder) WithDynamoDB

func (b *Builder) WithDynamoDB() func(*InitAWSAdapterOptions) error

func (*Builder) WithECR

func (b *Builder) WithECR() func(*InitAWSAdapterOptions) error

func (*Builder) WithECS

func (b *Builder) WithECS() func(*InitAWSAdapterOptions) error

func (*Builder) WithS3

func (b *Builder) WithS3() func(*InitAWSAdapterOptions) error

func (*Builder) WithSecretsManager

func (b *Builder) WithSecretsManager() func(*InitAWSAdapterOptions) error

type ECSConnector

type ECSConnector struct {
	Client *ecs.Client
	Ctx    context.Context
	Logger o11y.LoggerInterface
}

func NewECSConnector

func NewECSConnector(ctx context.Context, client *ecs.Client, logger o11y.LoggerInterface) *ECSConnector

func (*ECSConnector) ListECSClusters

func (e *ECSConnector) ListECSClusters() (*ecs.ListClustersOutput, error)

func (*ECSConnector) ListECSServices

func (e *ECSConnector) ListECSServices() (*ecs.ListServicesOutput, error)

func (*ECSConnector) ListTaskDefinitions

func (e *ECSConnector) ListTaskDefinitions() (*ecs.ListTaskDefinitionsOutput, error)

type ECSReader

type ECSReader interface {
	ListECSServices() (*ecs.ListServicesOutput, error)
	ListECSClusters() (*ecs.ListClustersOutput, error)
	ListTaskDefinitions() (*ecs.ListTaskDefinitionsOutput, error)
}

type InitAWSAdapterOptions

type InitAWSAdapterOptions struct {
	Region                string
	SharedCredentialsFile string
	Profile               string
	Creds                 AWSCreds
}

type InitAWSAdapterOptionsFunc

type InitAWSAdapterOptionsFunc func(*InitAWSAdapterOptions) error

type InitECSClientOptions

type InitECSClientOptions struct {
}

Jump to

Keyboard shortcuts

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