Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Terraform output getting wrong Action name when in a child step

Open twerthi opened this issue 3 years ago • 0 comments

Team

  • [X] I've assigned a team label to this issue

Severity

Non-blocking, just misleading. 1 customer affected.

Version

2022.3.10692

Latest Version

I could reproduce the problem in the latest build

What happened?

If a Terraform step contains output components and is in a child step, Octopus displays the Action name as the parent step instead of the child step name. This is misleading and doesn't work when using the parent step name to retrieve the value of the output variable.

image (1) image (2)

Reproduction

Create some Terraform such as

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm",
      version = "~> 3.11.0"
    }
  }

  required_version = ">= 1.1.3"
}

output "customername" {
  value = var.customer_name
}

output "location" {
    value = var.location_code
}

output "pool" {
    value = var.pool
}

variable "customer_name" {
  type = string
  default = "Shawn Sesna"
}

variable "location_code" {
  type = string
  default = "home"
}

variable "pool" {
  type    = string
  default = "shd"
}

Add a dummy run a script step to your process, "hello world" will suffice. Add a Terraform Apply step as a child step. Run a deployment and note the text Saving variable will list the parent step name instead of the child step name.

Error and Stacktrace

No response

More Information

No response

Workaround

The output variable is saved correctly to the collection with the child step name and is retrievable for subsequent steps, the log is just misleading in how you retrieve it.

twerthi avatar Oct 28 '22 14:10 twerthi