awsfactory

package
v1.5.50 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSFactory

type AWSFactory struct {
	Cfg aws.Config
}

func NewAWSFactory

func NewAWSFactory(ctx context.Context, configFactory ConfigFactory) (*AWSFactory, error)

NewAWSFactory creates a new factory for AWS clients.

func (*AWSFactory) GetDynamoDBClient

func (d *AWSFactory) GetDynamoDBClient() *dynamodb.Client

GetDynamoDBClient returns a singleton instance of a DynamoDB client

type ConfigFactory

type ConfigFactory interface {
	NewConfig(ctx context.Context) (aws.Config, error)
}

func NewContextualConfigFactory

func NewContextualConfigFactory() ConfigFactory

type ConfigFactoryFunc

type ConfigFactoryFunc func(ctx context.Context) (aws.Config, error)

func (ConfigFactoryFunc) NewConfig

func (f ConfigFactoryFunc) NewConfig(ctx context.Context) (aws.Config, error)

type Names

type Names interface {
	DynamoDBMainTable() string
}

type SecretAccessKeyDecoder

type SecretAccessKeyDecoder func(encodedValue string) (string, error)

type StaticConfig

type StaticConfig struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	Token           string
	Endpoint        string
}

func (*StaticConfig) NewConfig

func (j *StaticConfig) NewConfig(ctx context.Context) (aws.Config, error)

type TerraformOutput

type TerraformOutput struct {
	StaticConfig
	DynamoDBName           string
	ArchiveMainBucketName  string
	ArchiveCacheBucketName string
	ArchiveJobsSNSARN      string
	ArchiveJobsSQSURL      string
}

TerraformOutput is the content of `infra-data` output and can be used as Names and as ConfigFactory.

func ReadTerraformOutputFile

func ReadTerraformOutputFile(ctx context.Context, outputFile string) (*TerraformOutput, error)

ReadTerraformOutputFile read the `terraform output -json` file as base to configure the application.

func (*TerraformOutput) DynamoDBMainTable

func (t *TerraformOutput) DynamoDBMainTable() string

Jump to

Keyboard shortcuts

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