Documentation
¶
Overview ¶
Package awssts provides an identity-token source for workloads running on AWS (ECS, Lambda, EC2, EKS): it asks AWS STS for a web identity token of the workload's IAM role with GetWebIdentityToken.
Importing the package registers the source, so that KERNEL_IDENTITY_TOKEN_SOURCE=aws_sts works with a client built from the environment:
import _ "github.com/kernel/kernel-go-sdk/lib/credentials/awssts"
It is a separate package so that only programs that import it depend on the AWS SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentityToken ¶
func IdentityToken(audience string, optFns ...func(*config.LoadOptions) error) credentials.IdentityTokenFunc
IdentityToken returns an identity-token source that calls STS GetWebIdentityToken on every call. It uses the ambient AWS credentials and the region from AWS_REGION or AWS_DEFAULT_REGION, falling back to us-east-1. The credentials refresh themselves, so the source works for as long as the workload runs. optFns adjust how the AWS configuration is loaded.
audience is the aud claim to request; when empty, credentials.ResolveAudience decides.
Types ¶
This section is empty.