awsutil

package
v3.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const Default = "default"

Default is a generic constant for the word default

View Source
const ErrCodeInvalidAction = "InvalidAction"
View Source
const ErrCodeOperationNotPermitted = "OperationNotPermitted"
View Source
const (
	GlobalRegionID = "global"
)
View Source
const StateDeleted = "deleted"

StateDeleted is a generic constant for the word deleted for state

View Source
const StateDeleting = "deleting"

StateDeleting is a generic constant for the word deleting for state

Variables

View Source
var (
	// DefaultRegionID The default region. Can be customized for non AWS implementations
	DefaultRegionID = endpoints.UsEast1RegionID

	// DefaultAWSPartitionID The default aws partition. Can be customized for non AWS implementations
	DefaultAWSPartitionID = endpoints.AwsPartitionID
)
View Source
var (
	RESecretHeader = regexp.MustCompile(`(?m:^([^:]*(Auth|Security)[^:]*):.*$)`)
)

Functions

func DumpRequest

func DumpRequest(r *http.Request) string

func DumpResponse

func DumpResponse(r *http.Response) string

func HideSecureHeaders

func HideSecureHeaders(dump []byte) []byte

func IsAWSError

func IsAWSError(err error, code string) bool

Types

type Account

type Account struct {
	*Credentials
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(creds *Credentials, endpoints config.CustomEndpoints) (*Account, error)

func (*Account) ARN

func (a *Account) ARN() string

ARN returns the STS Authenticated ARN for the account

func (*Account) Alias

func (a *Account) Alias() string

Alias returns the first alias for the account

func (*Account) Aliases

func (a *Account) Aliases() []string

Aliases returns the list of aliases for the account

func (*Account) DisabledRegions

func (a *Account) DisabledRegions() []string

DisabledRegions returns the list of regions that are disabled for the account

func (*Account) ID

func (a *Account) ID() string

ID returns the account ID

func (*Account) Regions

func (a *Account) Regions() []string

Regions returns the list of regions that are enabled for the account

func (*Account) ResourceTypeToServiceType

func (a *Account) ResourceTypeToServiceType(regionName, resourceType string) string

func (*Account) UserID

func (a *Account) UserID() string

UserID returns the authenticated user ID

type Credentials

type Credentials struct {
	Profile string

	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	AssumeRoleArn   string
	ExternalID      string
	RoleSessionName string

	Credentials *credentials.Credentials

	CustomEndpoints config.CustomEndpoints
	// contains filtered or unexported fields
}

func (*Credentials) HasAwsCredentials

func (c *Credentials) HasAwsCredentials() bool

func (*Credentials) HasKeys

func (c *Credentials) HasKeys() bool

func (*Credentials) HasProfile

func (c *Credentials) HasProfile() bool

func (*Credentials) NewSession

func (c *Credentials) NewSession(region, serviceType string) (*session.Session, error)

func (*Credentials) Validate

func (c *Credentials) Validate() error

Jump to

Keyboard shortcuts

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