Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot append nested block #65

Open
combsbj opened this issue Feb 6, 2023 · 0 comments
Open

Cannot append nested block #65

combsbj opened this issue Feb 6, 2023 · 0 comments

Comments

@combsbj
Copy link

combsbj commented Feb 6, 2023

Terraform cloud requires a cloud block with the following format:

terraform {
  cloud {
    organization = "example_corp"
    ## Required for Terraform Enterprise; Defaults to app.terraform.io for Terraform Cloud
    hostname = "app.terraform.io"

    workspaces {
      tags = ["app"]
    }
  }
}

I am able to append the empty cloud block, and then the organization attribute.

# hcledit -u -f main.tf block append terraform cloud
# hcledit -u -f main.tf attribute append terraform.cloud.organization '"$ORG_NAME"'
# hcledit -f main.tf block get terraform
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">=3.41.0"
    }
  }
  cloud {
    organization = "$ORG_NAME"
  }
}

Next, I try to append the nested workspaces block:

# hcledit -u -f main.tf block append terraform.cloud workspaces
# hcledit -f main.tf block get terraform
terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = ">=3.41.0"
    }
  }
  cloud {
    organization = "$ORG_NAME"
  }
}

I expect to see it appended, but it is not. I also get no output that there was a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant