aws_utils

package
v1.193.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAWSConfig

func LoadAWSConfig(ctx context.Context, region string, roleArn string, assumeRoleDuration time.Duration) (aws.Config, error)

LoadAWSConfig loads AWS config.

It looks for credentials in the following order:

Environment variables:
  AWS_ACCESS_KEY_ID
  AWS_SECRET_ACCESS_KEY
  AWS_SESSION_TOKEN (optional, for temporary credentials)

Shared credentials file:
  Typically at ~/.aws/credentials
  Controlled by:
    AWS_PROFILE (defaults to default)
    AWS_SHARED_CREDENTIALS_FILE

Shared config file:
  Typically at ~/.aws/config
  Also supports named profiles and region settings

Amazon EC2 Instance Metadata Service (IMDS):
  If running on EC2 or ECS
  Uses IAM roles attached to the instance/task

Web Identity Token credentials:
  When AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN are set (e.g., in EKS)

SSO credentials (if configured)

Custom credential sources:
  Provided programmatically using config.WithCredentialsProvider(...)

Types

This section is empty.

Jump to

Keyboard shortcuts

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