Created
April 4, 2022 17:26
-
-
Save SamuelBagattin/6a3f66f7e60f39d8e7b40001da317850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Session creation | |
sess := session.Must(session.NewSession()) | |
// Create a new STS client to get temporary credentials | |
initStsClient := sts.New(sess) | |
// Get the SA token | |
awsWebIdentityTokenFile := os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE") | |
awsWebIdentityToken, err := ioutil.ReadFile(awsWebIdentityTokenFile) | |
if err != nil { | |
panic(err) | |
} | |
// Get the IAM role ARN | |
awsRoleArn := os.Getenv("AWS_ROLE_ARN") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment