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 Example
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.

Welcome! We use cookies and data about how you use our website allow us to improve the website and your experience, and resolve technical errors. Our website uses cookies and shares some of your data with third party analytics companies for these purposes. We do not use these cookies for advertising.

If you decline, we will respect your privacy. A single cookie will be used in your browser to remember your preference.