Questions tagged [terraform]

For questions about Terraform, an open source tool to maintain infrastructure.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How can I generate the source_code_hash locally from Terraform code?

I have a lambda function aws_lambda_function I'm trying to creat multiple versions of it from my terraform code. I cam have latest and one version but I'm still trying to figure out how to have ...
0
votes
1answer
11 views

How do I create multiple versions of a lambda function in terraform

I have it creating one version. It has latest and version 2 but can’t getting it to create more than one version of the same lambda? resource "aws_lambda_function" "lambda" { function_name = "test-...
2
votes
0answers
14 views

How Can I create layers for a lambda using Terraform?

The docs only seem to give me the option to reference existing layers. I want to make the layer for my lambda in my terraform code rather than through the console but can't see any option to do this ...
0
votes
0answers
8 views

Attach elastic inference gpu graphics on aws ec2 instance with terraform lauch template

With Terraform, following the doc here and there, I am trying to create a template for ec2 instance with elastic inference gpu specification and graphics. This my code for aws launch template ...
-1
votes
0answers
2 views

difference between parameter values of a azure terraform resource?

0 Unclear on the difference between a parameter (ie subnet_id) such as the following: subnet_id = var.XXXXXXXXX , resource_group_name = "${ resource_created.XXXXXXXX.name}, subnet_id = "{$var....
0
votes
1answer
21 views

Can Terraform pull down the newest state file by itself?

We started using Terraform to create VMs in some Cloud Providers. But we are a team with several people. Terraform has a state file. Whenever someone changes something via Terraform, ex.: ...
0
votes
0answers
8 views

I am trying different options to create a terraform code (with DRY concept) with the New Relic plugin

I am trying to use Terraform to call in the New relic plugins to host a scenario where I facilitate adding new policies, with variable number of conditions by passing variables to existing ...
1
vote
1answer
25 views

can't access my instances by public IP in a VPC (aka: what is wrong with my terraform)?

As stated in the title of the question, I have a Terraform file (attached below), but the infrastructure it builds doesn't allow me to connect by SSH (I get "Connection timed out"). So either the ...
0
votes
0answers
18 views

Can a password be encrypted in Terraform code without the unencrypted password ending up in the state file?

I read you could use an encrypted password in the Terraform code but it would still show up unencrypted in the TF state file. Is there any way to avoid it showing in the TF state such as getting the ...
1
vote
1answer
47 views

How do I use only an encrypted version of my AWS RDS password in my terraform code?

Is there a way to only have an encrypted version of my RDS password in my Terraform code and for AWS to decrypt it for RDS so you use the decrypted password to login to the RDS? So set my rds ...
0
votes
0answers
23 views

Terraform error for API Gateway unable to add multiple aws_api_gateway_integration_response resources

I am trying to setup a gateway (PUT) Integration Response to handle different status responses from Firehose. All examples I can find use only one status response. If I add two ...
0
votes
0answers
26 views

Terraform giving provider issue error

I am using terraform's google GKE module but I am getting this weird error. Terraform code module "gke" { source = "terraform-google-modules/kubernetes-engine/google" version ...
0
votes
0answers
15 views

Terraform generates different plan for different subscription on Azure

Terraform 0.12.8|Azure Provider 1.33.1|Linux I have a network module as shown below- main.tf: resource "azurerm_virtual_network" "vnet" { name = "${var.vnet_name}" location ...
0
votes
0answers
9 views

Why my template disk is not being cloned?

I've been messing with Terraform for about 3 days but i encounter an issue that is really weird. I wanted to clone a template from a vCenter and deploy multiples VM from this template (something ...
0
votes
1answer
114 views

Terraform | Error “transport is closing” when “terraform apply” after upgrading to 0.12

Terraform v0.12.7 + provider.aws v2.25.0 + provider.null v2.1.2 + provider.template v2.1.2 Hello, when I try run terraform apply after upgrading to 0.12 I get error: module.elasticsearch.module.ec2....
0
votes
1answer
27 views

Create multiple S3 buckets at once

I am trying to create a static website using S3 buckets. I want to create a bucket for www and non-www versions. I can't work out how to create two buckets at once. I read that you can chain two ...
0
votes
1answer
105 views

Terraform | After upgrading to 0.12 receive a lots of error “unsupported value for ”%s“ at 0: string required.”

After upgrading to 0.12 I receive a lots of error like: Error: Error in function call on main.tf line 136, in data "template_file" "inventory": 136: formatlist( 137: 138: 139: 140: |...
0
votes
1answer
149 views

Terraform | Upgrade to 0.12 error Reference to “count” in non-counted context

I'm trying to upgrade terraform from 0.11 to 0.12 but receiving error: Error: Reference to "count" in non-counted context on main.tf line 33, in data "aws_subnet" "public": 33: id = data....
0
votes
1answer
28 views

How to probe all running aws ec2 instances and their sec groups, etc to generate templates?

Typically I spin up all aws ec2 instances together with all its accompanying security groups, volumes, etc ... by executing a series of aws cli commands. However when I manually use the aws console ...
1
vote
0answers
71 views

Terraform destroys and creates new AWS resources

Terraform destroys and creates new AWS resources when I modify the modules with new resources. I tried with: lifecycle { prevent_destroy = true } Getting the below error : the plan would ...
1
vote
2answers
32 views

Which Users Should I Create With Terraform And Which With Ansible?

I am creating some Ubuntu VMs in Azure with Terraform. I am then configuring the VMs with ansible. When terraform creates the VM it creates an admin user resource "azurerm_virtual_machine" "main" { ...
0
votes
1answer
160 views

Service account permissions error when provisioning instance group from template

I'm trying to create a GCE Instance Group Manager using terraform resource "google_compute_region_instance_group_manager" "frontend_group_manager" { name = "frontend-igm" base_instance_name = "...
0
votes
0answers
79 views

Iterating through multiple list variables within a dynamic block in Terraform .12

I am looking to us ea dynamic block for an aws beanstalk environment "settings" sub block. Essentially I want to have one settings block which contains var.namespace var.namespace_name var....
1
vote
1answer
125 views

How to forcibly remove the resource created by the broken module?

I've created few dns_cname_record resources, however Terraform DNS provider started to throw the errors like: Error: update server is not set I've created the bug report for it, as it prevents me ...
1
vote
1answer
814 views

Terraform | The “count” object can be used only in “resource” and “data” blocks,

I'm trying to upgrade out Terraform seeing as 0.12 (stable) came out recently. I've ran into some issues with a certain pair of resource blocks. I'm getting the below error message when trying to do ...
0
votes
1answer
70 views

Terraform: Route53, LB and CDN interdependencies

My team uses Terraform to deploy the necessary infrastructure. Currently, our stack is composed of: AutoScalingGroup fronted by a Load-Balancer, and a Route53 DNS record that points to this LB; We ...
2
votes
0answers
15 views

How to manage the database in an environment per branch, creating a new instance per branch is the best approach?

I'm trying to create an environment per branch using Git lab CI, until here we're good. But my concern right now is how to manage the Database? I thought of using RDS and terraform, but what I'm ...
0
votes
1answer
61 views

GCE metadata not defined on Travis CI

I have tried initializing terraform code in Travis CI but an error keeps coming up; Failed to load state: Failed to open state file at gs://{{project_id}}/terraform/state/default.tfstate: Get ...
0
votes
0answers
11 views

Using the terraform github provider on an existing github organization

If I use the github provider in terraform on an existing github organization, do I need to write out each user and role within the .tf files or can the state be imported? What is the best approach ...
1
vote
1answer
39 views

How to override default aws region credentials for Terraform?

I am using Terraform to create aws resources. I practiced with a single region and with my aws cli credentials being used. worked great! however when I tried to override the region in the Terraform ....
-2
votes
1answer
205 views

Terraform aws_ecr_repository resource always attempts to destroy

I have been banging my head against this seemingly simple issue for awhile now. I have some Terraform code which sets up an ECR repository, policy and lifecycle policy. provider "aws" { region = "...
0
votes
0answers
14 views

How to query all resources of specific type in terraform?

How to get the list of all .public_ip that are assigned to AWS instances using Terraform? For example, I can query ip address for a single resource from terraform console > "${aws_instance.app....
0
votes
0answers
50 views

Terraform - failing download modules in too long paths

I have enabled long filename option in Windows 10, but I still can't init in that path. If I move files to the desktop it works, so it is definitely path related. The issue is not related to the ...
0
votes
1answer
48 views

DevOps Newbie - How to automate windows infrastructure deployment?

DevOps newbie here, so bear with me. I have a project where infrastructure deployment and application deployment is done using powershell and it is tied to VMWare vCenter. For every client deployment,...
-1
votes
0answers
23 views

Terraform Elastic Beanstalk managing provisioned EC2 resources

Is anyone aware of any approach that would allow me to manage EC2 resources created by AWS Elastic Beanstalk in provisioning matter (chained after creation) in the same .tf file. The only thing I ...
0
votes
0answers
15 views

Manage private cloud resources via configuration files, what tools to use

I have resources which are not on azure or any public cloud like DNS, Traffic Manager, VM's, overtime we have built REST API's to manage their lifecycle via powershell scripts, now we want to setup an ...
4
votes
2answers
626 views

Automate Helm's tiller installation with Terraform

I need to be able to generate disposable kubernetes environments using terraform. These environments should use helm for application deployment and ideally have tiller installed during the terraform ...
-1
votes
0answers
48 views

Terraform get variable from Vault

Is it possible to define for example a password variable I terraform tf file and then during terraform apply to get that variable from Vault?
1
vote
3answers
1k views

Terraform - referencing existing security group

Is there a way I can associate existing security group to RDS that is going to be created or the only way is to recreate the security group so it can be added to the state file?
0
votes
1answer
81 views

Terraform: Provide credentials for docker hub registry

How would I provide docker hub credentials to a private image in the following example? data "docker_registry_image" "ubuntu" { name = "ubuntu:latest" } resource "docker_image" "ubuntu" { name ...
2
votes
1answer
1k views

Installing Helm charts using Terraform

I have been trying to install Helm charts using Terraform in a cluster which operates in GKE. My question is in two parts: Is it a good practice to use Terraform for installing Helm charts? I have ...
0
votes
1answer
38 views

Can Terraform S3 remote state be kept in a different AWS account?

I am currently using Terraform with S3 remote state. The IAM user that I'm using to run Terraform exists in the same AWS account as the S3 bucket holding the remote state files. This is all working ...
0
votes
0answers
132 views

How to install a chart's dependency using terraform?

The aim is to install a helm chart using terraform. Error: Error applying plan: 1 error(s) occurred: * helm_release.wordpress: 1 error(s) occurred: * helm_release.wordpress: found in requirements....
0
votes
1answer
304 views

How to pass HashiCorp Vault secrets(k/v passwords) to Terraform EC2 instance

How can we pass HashiCorp Vault secrets, k/v username/password and feed Terraform while its creating Ec2 instance. For example, i don't want to use in plain text variable "myvariable" { default = "...
2
votes
3answers
160 views

How to structure a IaC for production, and development?

We have a typical multi layered web application: a balancer, 2 web server 2 db server. I feel we strongly need to start using a kind of Infrastructure As Code in order to replicate easily ...
3
votes
1answer
5k views

How to make Terraform Modules wait for resources to be created in place of using computed values

Today I am working on building out several custom Terraform Modules. The issue that I am trying to figure out how to work around dependencies within modules. Until TF 0.12 is released we cannot ...
0
votes
0answers
33 views

How to ingest and iterate Network ACLs in Terraform

I am looking for ideas on how to have Terraform ingest ingress and egress rules from a remote file. Based upon the documentation and examples that I found in my searching I am at a loss on how to ...
2
votes
1answer
192 views

Terraform - aws_security_group_rule doesn't support import

I'm having a strange problem when trying to import an aws_security_group_rule into terraform. I'm running the latest version of TF (0.11.11) For example: terraform import module.ec2....
0
votes
1answer
129 views

Terraform | AWS | vpc_id causing apply to fail

I am working on setting up a Cloud9 environment using Terraform, I ran into an issue when it comes to my Terraform apply and specifically: Error: Error applying plan: 1 error(s) occurred: * ...
2
votes
1answer
298 views

How to enable Google Maps and generate an API key using Terraform?

I've been trying to spin up a project from scratch over the Christmas break to automate the creation of my home network, one of those components is the Ubiquiti Controller which requires a Google Maps ...