aws

package
v0.0.0-...-277766b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRegionNotExist

func IsRegionNotExist(err error) bool

IsRegionNotExist tries to determine if the error is caused by a region not existing, as would be the case in a user typo.

Types

type AWSClient

type AWSClient interface {
	AssumeRole(string, *string) (*sts.Credentials, error)
	GetFederationURL(string, string) (string, error)
	GetRegionList() ([]*Region, error)
}

AWSClient is a client for working with the AWS APIs.

Instances of AWSClient are safe for concurrent access.

func NewAWSClientFromAccount

func NewAWSClientFromAccount(ctx context.Context, a *models.Account, sc secrets.Client) (AWSClient, error)

NewAWSClientFromAccount returns a new AWSClient based on an account.

An account is actually more accurately called an assumable role. Each account contains a vault material set path which is used to fetch all of the credentials for that AWS account and is filtered to one assumable role ARN which is used as the scope for this AWS client. Thus even if an account has multiple roles there must be one instance of the AWS client per account/role pair.

type Region

type Region struct {
	Name    string
	Enabled bool
}

Jump to

Keyboard shortcuts

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