build-harness icon indicating copy to clipboard operation
build-harness copied to clipboard

Generate doc failed if "type" present in object definition

Open eservent opened this issue 5 years ago • 0 comments

Hello, I tried to use /bin/terraform-docs.awk to generate documentation with terraform-docs.

An error occured with this variable from provider aws, resource "aws_ecs_service", property "ordered_placement_strategy" :

variable "ordered_placement_strategy" {
  type = list(object({
    type  = string
    field = string
  }))
  description = "Ordered task placement strategy on EC2 instances"
  default = [
    {
      type  = "spread"
      field = "attribute:ecs.availability-zone"
    }
  ]
}

Due to presence of "type" in the object definition, and default value, awk transformation failed to retrieve a valid hcl0.11 content.

Transformation result :

variable "ordered_placement_strategy" {
  type = "object"
  type = "string"
  description = "Ordered task placement strategy on EC2 instances"
  default = [
    {
  type = "spread"
}

Thank you for the awk hack anyway 👍

eservent avatar Sep 25 '19 10:09 eservent