aws

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 73 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FieldAccessKeyID     = "access_key_id"
	FieldSecretAccessKey = "secret_access_key"
	FieldMfaArn          = "mfa_arn"
	FieldSessionDuration = "session_duration"
)

AWS credential field names.

Variables

View Source
var GenericPromptCredentialsFunc types.CredentialPromptFunc

GenericPromptCredentialsFunc is the generic credential prompting function. It uses CredentialPromptSpec to determine what fields to collect.

View Source
var PromptCredentialsFunc func(identityName string, mfaArn string) (*types.AWSCredentials, error)

PromptCredentialsFunc is the AWS-specific credential prompting function. It wraps the generic function for backward compatibility. When set, it's called when credentials are missing or invalid.

Functions

func AssumeInlineRole

func AssumeInlineRole(ctx context.Context, role InlineRole, environ []string) (map[string]string, error)

AssumeInlineRole assumes the role on top of the AWS credentials found in environ, a list of KEY=VALUE entries in which the last entry of a key wins. The starting credentials come from environ alone, in the order of the SDK default chain: static keys, a web identity token file, the profile and files that environ names, container credentials, then instance metadata. The process environment is neither read nor changed. It returns the environment variables that make the new session the credentials of a child process, and registers the secrets with the output masker.

func FilesBasePath

func FilesBasePath(manager types.AuthManager, identityName string) string

FilesBasePath exposes filesBasePath to AWS identities implemented outside this package, such as native plugin identities and the mock identity, so every AWS identity writes, reports and removes its files under the same base path as its root provider.

func GetSupportedTaskPolicies added in v1.203.0

func GetSupportedTaskPolicies() []string

GetSupportedTaskPolicies returns the list of supported AWS-managed root task policies.

func IsSupportedTaskPolicy added in v1.203.0

func IsSupportedTaskPolicy(arn string) bool

IsSupportedTaskPolicy checks if a task policy ARN is in the list of known supported policies.

func LoadCredentialsFromEnvironment

func LoadCredentialsFromEnvironment(ctx context.Context, environment map[string]string) (*types.AWSCredentials, error)

LoadCredentialsFromEnvironment reuses Atmos's isolated profile loader for credential materializers.

func NewAWSAmbientIdentity added in v1.213.0

func NewAWSAmbientIdentity(name string, config *schema.Identity) (types.Identity, error)

NewAWSAmbientIdentity creates a new AWS ambient identity.

func NewAssumeRoleIdentity

func NewAssumeRoleIdentity(name string, config *schema.Identity) (types.Identity, error)

NewAssumeRoleIdentity creates a new AWS assume role identity.

func NewAssumeRootIdentity added in v1.203.0

func NewAssumeRootIdentity(name string, config *schema.Identity) (types.Identity, error)

NewAssumeRootIdentity creates a new AWS assume root identity.

func NewCredentialProcessIdentity

func NewCredentialProcessIdentity(name string, config *schema.Identity) (types.Identity, error)

NewCredentialProcessIdentity creates a new aws/credential-process identity.

func NewPermissionSetIdentity

func NewPermissionSetIdentity(name string, config *schema.Identity) (types.Identity, error)

NewPermissionSetIdentity creates a new AWS permission set identity.

func NewSTSClientWithCredentials added in v1.203.0

func NewSTSClientWithCredentials(
	ctx context.Context,
	awsBase *types.AWSCredentials,
	region string,
	identityConfig *schema.Identity,
) (*sts.Client, string, error)

NewSTSClientWithCredentials creates an STS client using the provided credentials and region. This is a shared helper used by assume-role and assume-root identities.

func NewUserIdentity

func NewUserIdentity(name string, config *schema.Identity) (types.Identity, error)

NewUserIdentity creates a new AWS user identity.

Types

type HTTPClient added in v1.215.0

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient abstracts HTTP requests for token exchange (testability).

type InlineRole

type InlineRole struct {
	// Role is the role ARN.
	Role string
	// SessionName is the STS role session name. It defaults to a generated name.
	SessionName string
	// Duration is the session length. Zero selects the STS default.
	Duration time.Duration
	// WebIdentityToken selects AssumeRoleWithWebIdentity, which needs no starting credentials.
	WebIdentityToken string
}

InlineRole is an IAM role that a component, rather than the Atmos configuration, asks to assume. It reuses the aws/assume-role identity, so STS calls, endpoints, and error reporting behave the same way.

Jump to

Keyboard shortcuts

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