Documentation
¶
Index ¶
- func EnsureContext(ctx context.Context, cfg *Config) (context.Context, error)
- func Fetch(ctx context.Context, cfg *Config) (aws.Config, error)
- func FetchEnv(ctx context.Context, cfg *Config) (map[string]string, error)
- func FromContext(ctx context.Context, cfg *Config) (aws.Config, error)
- type AssumeRoleConfig
- type Config
- type ContextKey
- type ErrUnableToAssumeRole
- type ErrUnableToFetchStatic
- type StaticCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureContext ¶
EnsureContext adds credentials into the context if they do not exist
Types ¶
type AssumeRoleConfig ¶
type AssumeRoleConfig struct {
RoleARN string `cty:"arn" hcl:"role_arn" validate:"required" mapstructure:"role_arn,omitempty" json:"role_arn" temporaljson:"role_arn"`
SessionName string `` /* 143-byte string literal not displayed */
SessionDurationSeconds int `` /* 183-byte string literal not displayed */
// configuration for two stepping before assuming this role
TwoStepConfig *assumerole.TwoStepConfig `` /* 138-byte string literal not displayed */
UseGithubOIDC bool `json:"use_github_oidc"`
}
AssumeRoleConfig is used for assuming an IAM role
type Config ¶
type Config struct {
Static *StaticCredentials `cty:"static,block" hcl:"static,block" mapstructure:"static,omitempty" json:"static" temporaljson:"static"`
AssumeRole *AssumeRoleConfig `` /* 130-byte string literal not displayed */
// If profile is provided, we'll use that profile over the default credentials
Profile string `` /* 136-byte string literal not displayed */
UseDefault bool `` /* 136-byte string literal not displayed */
// when cache ID is set, these credentials will be reused, up to the duration of the sessionTimeout (or default)
CacheID string `` /* 141-byte string literal not displayed */
Region string `cty:"region,optional" hcl:"region,optional" mapstructure:"region,omitempty" json:"region" temporaljson:"region"`
}
type ContextKey ¶
type ContextKey struct {
ID string
}
ContextKey is used to manage the credentials in the context
type ErrUnableToAssumeRole ¶
func (ErrUnableToAssumeRole) Error ¶
func (e ErrUnableToAssumeRole) Error() string
func (ErrUnableToAssumeRole) Unwrap ¶
func (e ErrUnableToAssumeRole) Unwrap() error
type ErrUnableToFetchStatic ¶
type ErrUnableToFetchStatic struct {
Err error
}
func (ErrUnableToFetchStatic) Error ¶
func (e ErrUnableToFetchStatic) Error() string
func (ErrUnableToFetchStatic) Unwrap ¶
func (e ErrUnableToFetchStatic) Unwrap() error
type StaticCredentials ¶
type StaticCredentials struct {
AccessKeyID string `` /* 145-byte string literal not displayed */
SecretAccessKey string `` /* 161-byte string literal not displayed */
SessionToken string `` /* 140-byte string literal not displayed */
}
StaticCredentials are used to create credentials ahead of time, and pass them around for use. Specifically, we do this for creating credentials with an IAM role in our infra, so a plugin can push data back.
Click to show internal directories.
Click to hide internal directories.