Created
July 11, 2016 14:41
-
-
Save ankona/2f44cb89c8cdb233a36d3c199e2a30e0 to your computer and use it in GitHub Desktop.
STS Assume Role (PowerShell)
This file contains 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
$RoleArn = "%deployer_arn%" | |
$ExternalId = "%assume_role_external_id%" | |
$Region = "us-east-1" | |
$Response = (Use-STSRole -Region $Region -RoleArn $RoleArn -ExternalId $ExternalId -RoleSessionName "deploy-website-s3-bucket").Credentials | |
$SecretAccessKey = $Response.SecretAccessKey | |
$SessionToken = $Response.SessionToken | |
$AccessKeyId = $Response.AccessKeyId | |
"##teamcity[setParameter name='env.AWS_SECRET_ACCESS_KEY' value='$SecretAccessKey']" | |
"##teamcity[setParameter name='env.AWS_SECURITY_TOKEN' value='$SessionToken']" | |
"##teamcity[setParameter name='env.AWS_ACCESS_KEY_ID' value='$AccessKeyId']" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment