Quantcast
Channel: Terraform - HashiCorp Discuss
Browsing all 11511 articles
Browse latest View live

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 Article


Dynamic 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 Article


Invalid 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 Article

Resource 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 Article

Validate 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 Article


Is 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 Article

New 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 Article

Terraform 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 Article


Compatibility 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 Article


Invalid 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 Article

User_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 Article

Save 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 Article

DevOps 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 Article


Store 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 Article

Shell 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 Article


Auto-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 Article

Image may be NSFW.
Clik here to view.

Terraform 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 Article


HCL 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 Article

How 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 Article

Function 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
Browsing all 11511 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>