Can I use GCS as a backend when running Terraform steps with Octopus?
Yes!
Configure a Google cloud account with the permissions needed to read and write to GCS per your requirements.
Add the account as a variable to your project. In this example, my variable is named GCP.Backend.Account
.
Add a backend definition to your TF template.
terraform {
backend "gcs" {
credentials = "#{GCP.Backend.Account.JsonKey | FromBase64 | JsonEscape}"
bucket = "your-bucket-here"
prefix = "your-prefix-here"
}
}
With that configuration, the TF state will be stored to the GCS bucket that you provided.