Google Cloud accounts are included in a project through a project variable of the type Google Cloud Account. Before you create a Google Cloud account variable, you need to create a Google Cloud account in Octopus:
The Add Variable window is then displayed and lists all the Google Cloud accounts.
Select the Google Cloud account you want to access from the project to assign it to the variable:
Google Cloud account variable properties
The Google Cloud account variable also exposes the following properties that you can reference in a PowerShell script:
Name and description |
---|
JsonKey The JSON Key for the Google cloud 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 'google cloud account'
# Using $OctopusParameters
Write-Host 'GoogleCloudAccount.Id=' $OctopusParameters["google cloud account"]
Write-Host 'GoogleCloudAccount.JsonKey=' $OctopusParameters["google cloud account.JsonKey"]
# Directly as a variable
Write-Host 'GoogleCloudAccount.Id=' #{google cloud account}
Write-Host 'GoogleCloudAccount.JsonKey=' #{google cloud account.JsonKey}
Add a Google Cloud account to Octopus
For instructions to set up a Google Cloud account in Octopus, see Google Cloud Accounts.
Older versions
- Google Cloud accounts are available from Octopus Deploy 2021.3 onwards.
Learn more
- Variable blog posts
- How to use the Run gcloud in a Script step
- How to create Google Cloud accounts
Help us continuously improve
Please let us know if you have any feedback about this page.
Page updated on Thursday, August 29, 2024