Omit keys means module default (indirect)
To allow omitting keys in live configuration means using module deafult values, I use a workaround like this (this example is for ebs, can be generalized): (in module variables.tf) variable...
View ArticleDynamic argument with if conditional
Could we use if-conditional to apply argument ? Example main.tf resource "google_compute_backend_service" "bs" { ... if var.iaps == "true" then iap { oauth2_client_id = var.iapsid oauth2_client_secret...
View ArticleInvalid function argument when using inline in remote-exec provisioner
Hi I get the below error when using a provisioner “remote-exec” {} in my *.tf file. Without configuring a provisioner everything works: provisioner “remote-exec” { inline = [ "chmod +x script.sh", ] }...
View ArticleResource ForEach Value inside Block
I am looking to see if it is possible to call get a value in a resource level foreach into a block within the resource. Here is the example I have. Say I have a map object of Linux VM like this: linux...
View ArticleValidate list(object) variables
Hi i am trying to add validations for list of an object type: variable "rules" { type = list(object({ name = string access = string })) validation { condition = contains(["Allow", "Deny"],...
View ArticleIs the Docker --expose now supported in Terraform?
Before going back testing Terraform again I have the following question. When I tested last time I could not use Terraform as it would always expose an external port even though I don’t want that. Old...
View ArticleNew Tutorial: Datadog Terraform provider
Datadog is a cloud monitoring platform that integrates with your infrastructure and gives you real-time visibility into your operations. With the Datadog Terraform provider, you can create custom...
View ArticleTerraform type returned by jsondecode
What type can I use for a module receiving the output of jsondecode? module "workspaces" { source = "../../" variables = jsondecode(file("dev.tfvars.json")) } At the moment I using any but is there is...
View ArticleCompatibility of terraform 12 state file to terraform 13 state file?
Hello If a customer uses terraform 12 and generates his resources and the corresponding state file. Now he wants to use terraform 13. He has updated the tf files following the guidance at...
View ArticleInvalid value for "vars" parameter: vars map does not contain key error
Hi, while trying terraform for ec2, I’m hitting an errror of Invalid value for “vars” parameter: vars map does not contain key “BOUNDARY_NAME_SUFFIX”, referenced at ./userdata_controller.sh:40,36-56....
View ArticleUser_data in terraform unable to receive variable of pem key
While creating ec2 instance with Terraform, I wish to inject the whole pem key file into the script. resource "aws_instance" "myinstance" { ... user_data = base64encode(templatefile(...
View ArticleSave kubeconfig yaml to vault via terraform
Hi. How do i use Terraform vault provider to write a k8s config under a KV2 engine using vault_generic_secret under terraform...
View ArticleDevOps Pipeline release
I am getting a error while executing DevOps pipeline release. I am not sure if anyone have come across this error before and what the solution is: ##[error]Terraform command ‘init’ failed with exit...
View ArticleStore OutPut Value in a text file on Terrafrom Enterprise
We have Terrafrom enterprise which remotely invoked via API Call . Now I do have plenty of output and those information i need to store in txt and send back to the API method wherever i called it file...
View ArticleShell script containing Terraform Directives causing an error
I have the terraform file, defining an aws instance using user_data. resource "aws_instance" "worker" { count = var.num_workers ami = data.aws_ami.ubuntu.id instance_type = "t3.micro"...
View ArticleAuto-scaling attachment to load balancer behavior
Hi, we are using version 12.29 and we are seeing a rather unusual behavior. We have the below auto scaling attachment resource however when applying the plan, the targets in the target groups are...
View ArticleTerraform 0.14 released!
We’ve released Terraform 0.14! Check out the announcement blog post here This release includes the ability to mark input variables as sensitive and have them redacted throughout the Terraform plan...
View ArticleHCL in userdata.sh unable to interpret shell script variables
I have this kind of userdata.sh (plz see below) that is used to spin up an EC2 instance. However hcl file is unable to interpret shell script variable. I intend to set tls_disable = true , but this...
View ArticleHow to use provisioners to configure Windows VMs (in private subnet) via...
How to use Linux bastion host to login and configure Windows VMs while using Terraform Provisioners. Hi, I am trying to restore a few Linux and windows instances from backup files using Terraform and...
View ArticleFunction for similar to Contains() to check does not contain
Is there any function similar to contains() which is something like doesnotcontain()? 3 posts - 2 participants Read full topic
View Article