Octopus Deploy Documentation

AWS account variables

Last updated

AWS accounts are included in a project through a project variable of the type Amazon Web Services Account. Before you create an AWS account Variable, you need to create an AWS account in Octopus:

AWS account variable

The Add Variable window is then displayed and lists all the AWS accounts.

Select the AWS account you want to access from the project to assign it to the variable:

AWS account variable selection

AWS account variable properties

The AWS account variable also exposes the following properties that you can reference in a PowerShell script:

Name and description
The Access Key for the AWS account
The Secret Key for the AWS account

Accessing the properties in a script

Each of the above properties can be referenced in PowerShell.

# For an account with a variable name of 'aws account'

# Using $OctopusParameters
Write-Host 'AwsAccount.Id=' $OctopusParameters["aws account"]
Write-Host 'AwsAccount.AccessKey=' $OctopusParameters["aws account.AccessKey"]

# Directly as a variable
Write-Host 'AwsAccount.Id=' #{aws account}
Write-Host 'AwsAccount.AccessKey=' #{aws account.AccessKey}

Add an AWS account to Octopus

For instructions to set up an AWS account in Octopus, see AWS accounts.

Learn more

Need support? We're here to help.