aws

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEmptyAmazonAccountID

func IsEmptyAmazonAccountID(err error) bool

IsEmptyAmazonAccountID asserts emptyAmazonAccountIDError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsMalformedAmazonAccountID

func IsMalformedAmazonAccountID(err error) bool

IsMalformedAmazonAccountID asserts malformedAmazonAccountIDError.

func IsWrongAmazonAccountIDLength

func IsWrongAmazonAccountIDLength(err error) bool

IsWrongAmazonIDLength asserts wrongAmazonAccountIDLengthError.

func ValidateAccountID

func ValidateAccountID(accountID string) error

ValidateAccountID validates the AWS Account ID.

Types

type AwsServiceMock

type AwsServiceMock struct {
	AccountID string
	KeyArn    string
	IsError   bool
}

func (AwsServiceMock) GetAccountID

func (a AwsServiceMock) GetAccountID() (string, error)

func (AwsServiceMock) GetKeyArn

func (a AwsServiceMock) GetKeyArn(clusterID string) (string, error)

type Clients

type Clients struct {
	KMS KMSClient
	STS STSClient
}

type Config

type Config struct {
	// Dependencies.
	Clients Clients
	Logger  micrologger.Logger
}

Config represents the configuration used to create a new aws service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new aws service by best effort.

type Interface

type Interface interface {
	GetAccountID() (string, error)
	GetKeyArn(clusterID string) (string, error)
}

type KMSClient

type KMSClient interface {
	DescribeKey(*kms.DescribeKeyInput) (*kms.DescribeKeyOutput, error)
}

KMSClient describes the methods required to be implemented by a KMS AWS client.

type STSClient

type STSClient interface {
	GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)
}

STSClient describes the methods required to be implemented by a STS AWS client.

type STSClientMock

type STSClientMock struct {
	stsiface.STSAPI
	// contains filtered or unexported fields
}

func (*STSClientMock) GetCallerIdentity

func (i *STSClientMock) GetCallerIdentity(input *sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)

type Service

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

Service implements the aws service.

func New

func New(config Config) (*Service, error)

New creates a new configured aws service.

func (*Service) GetAccountID

func (s *Service) GetAccountID() (string, error)

GetAccountID gets the AWS Account ID.

func (*Service) GetKeyArn

func (s *Service) GetKeyArn(clusterID string) (string, error)

GetKeyArn returns the key ARN associated with the given cluster ID.

Jump to

Keyboard shortcuts

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