Questions tagged [hcl]

HashiCorp Configuration Language. The structured configuration syntax that serves as the basis for Terraform's configuration language.

HCL establishes the syntax Terraform uses for things like arguments, blocks, literal values, and expressions. But what most people think of as the Terraform language extends beyond just the syntax; the built-in functions, Terraform-specific block types (like resource and variable), and Terraform-specific named values available in expressions are all implementation details of Terraform itself.

Source: https://www.terraform.io/docs/glossary.html#hcl

291 questions
1
vote
1 answer

Nomad job: interpolating within Docker args

I'm writing a Thanos sidecar job for Prometheus. I have looked and can't figure out how to specify this argument in a config file, so my job looks like this. This is a templatefile for Terraform, so if you try to reference ${var}, Terraform tries…
1
vote
1 answer

Applying varying lifecycle policies to list of s3 buckets

I have a list of s3 buckets on which i want to apply different lifecycle policies. variables.tf variable "bucket_name" { type = list(any) default = ["in", "out", "in-archive", "out-archive"] } For the first 2 items in the list…
1
vote
1 answer

How to pass key of for_each loop in a data source to the resource configuration?

I have been wanting to create a "azurerm_virtual_network" by passing location and name of the resource group attribute using data source: "azurerm_resource_group". My data source itself is created using "for_each". The idea here is, if I want to…
rb16
  • 129
  • 4
  • 11
1
vote
1 answer

TERRAFORM: Modify Values for ZipMap while Transforming Map to new Keys

I thought this would be easy :frowning: Goal is to transform this map: ``` accounts = { "acct-key-1" = { "billingcode" = "sys" "future-key" = "SOME-UNIQUE-VALUE-1" "private-attribute-1" = "fee" "private-attribute-2" = "foe" } …
rpc
  • 79
  • 7
1
vote
1 answer

How to create multiple storage accounts with specific container count in terraform

I am trying to create multiple Azure Storage Accounts with set of containers counts, however I couldn't achieve due to multiple resources blocks. As of the below code that I wrote which creates multiple containers in the one storage account. How can…
1
vote
3 answers

Whats the simplest way to find for a group of user all the group membership?

I do have one domino group (Access Control List only), lets call them Main_Group. This group includes all employees, that I want to know on which other domino groups they are member of. Members of Main_Group: - John Smith/ORGANIZATION - Peter…
Baku Bakar
  • 442
  • 2
  • 8
  • 20
1
vote
1 answer

Get the type of value using cty in hclwrite

am looking for a way to find the type of variable using go-cty package in hclwrite. My aim is to generate a variables file like below variable "test_var" { val1 = bool val2 = string val3 = number } reference:…
1
vote
1 answer

Retrieve the object output to use for another resources

I would like to use the output (object) as a attribute of another resources. I have the module like below: locals { lb_domain = { lb_public = { domain = "dev.example.net" }, lb_internal = { domain =…
Nightt
  • 392
  • 1
  • 4
  • 18
1
vote
0 answers

Error: error creating Secrets Manager Secret: ResourceExistsException: The operation failed because the secret project_lambda already exists

I am working on a project that uses a Jenkinsfile and given the name of a lambda it creates this lambda in AWS along with its terraform configuration, and uses AWS Secrets Manager to grab the secrets. I have created the secrets via terraform and…
andruidthedude
  • 165
  • 1
  • 8
1
vote
2 answers

Terraform variable from gitlab CI/CD variables

I understand that CI/CD variables can be used in HCL by counting on the fact that having them declared them with a TF_VAR_ prefix in the environment will enable me to look them up as input variables, then use them in the .tf file where I need…
WildWilyWilly
  • 121
  • 11
1
vote
3 answers

How to use Bash Regex Lookbehind across whitespace in Terraform file?

I'm writing a bash script to parse a bunch (a dozen or more) massive Terraform files that contain a large number of google_bigquery_dataset resources and their associated IAM access blocks. The script should take each dataset resource and copy it to…
dxh3707
  • 147
  • 1
  • 7
1
vote
1 answer

HCL Notes: specified database is not currently open: mail.box

In LotusScript (Domino 12.0.1FP1, Notes 12.0.1) we prepare a Memo in the user's mail database. Sometimes, the above error pops up: Specified database is not currently open: Server/ORG mail.box It happens when the user clicks Send in the Notes…
D.Bugger
  • 2,300
  • 15
  • 19
1
vote
1 answer

Only create new archive_file for Lambda when code changes?

I am writing a Lambda function in TypeScript. When running terraform apply in github actions I want to build the Lambda (which requires installing the dependencies and then webpacking everything), zip it and then deploy it to AWS. The trigger for…
Marc
  • 6,051
  • 5
  • 26
  • 56
1
vote
2 answers

Terraform - Get a value from map output

I have created AWS IAM groups using aws_iam_group and for_each loop resource "aws_iam_group" "all" { for_each = toset(local.groups) name = each.key path = "/" } Then I am outputting all groups output "groups" { value =…
1
vote
1 answer

Use attribute KEY and VALUE of a map inside a list element

I have defined a List called data, inside the list, i use a map with a key and a value. I now need to access the KEY and VALUE inside each element of the data list. locals { data = [ { "secret1" = 1 }, { "secret2" = 1 }, …
leonms.dev
  • 33
  • 1
  • 8