This task generates the following Bamboo variables for reuse in subsequent tasks without native integration with Identity Federation for AWS:
Code Block |
---|
language | bash |
---|
title | Bamboo variables |
---|
|
${bamboo.custom.aws.accessKeyId}
${bamboo.custom.aws.secretAccessKey.password}
${bamboo.custom.aws.sessionToken.password}
# Optional: the callerIdentity namespace is only present when option 'Add Caller Identity' is checked.
${bamboo.custom.aws.callerIdentity.account}
${bamboo.custom.aws.callerIdentity.arn}
${bamboo.custom.aws.callerIdentity.userId} |
An alternative representation as a JSON object for automated processing with tools like jq is available too:
Code Block |
---|
language | bash |
---|
title | Bamboo variables (alternative representations) |
---|
|
${bamboo.custom.aws.credentials.json.password}
# Optional: the callerIdentity namespace is only present when option 'Add Caller Identity' is checked.
${bamboo.custom.aws.callerIdentity.json} |
Environment variables
Aforementioned variables will also be available as environment variables for use in Bamboo Script tasks. The syntax differs between shells, as illustrated in these examples for assigning them to the standardized variables used by tools like the AWS Command Line Interface (AWS CLI):
Code Block |
---|
language | bash |
---|
title | Bash (Unix shell) |
---|
|
export AWS_ACCESS_KEY_ID=$bamboo_custom_aws_accessKeyId
export AWS_SECRET_ACCESS_KEY=$bamboo_custom_aws_secretAccessKey_password
export AWS_SESSION_TOKEN=$bamboo_custom_aws_sessionToken_password |
Code Block |
---|
language | powershell |
---|
title | PowerShell |
---|
|
$AWS_ACCESS_KEY_ID = $bamboo_custom_aws_accessKeyId
$AWS_SECRET_ACCESS_KEY = $bamboo_custom_aws_secretAccessKey_password
$AWS_SESSION_TOKEN = $bamboo_custom_aws_sessionToken_password |
Code Block |
---|
language | diff |
---|
title | Windows Command Prompt (cmd) |
---|
|
set AWS_ACCESS_KEY_ID=%bamboo_custom_aws_accessKeyId%
set AWS_SECRET_ACCESS_KEY=%bamboo_custom_aws_secretAccessKey_password%
set AWS_SESSION_TOKEN=%bamboo_custom_aws_sessionToken_password% |