Questions tagged [terraform]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
13 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
33 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
29 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
123 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
32 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
12 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
20 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
29 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 ....
-1
votes
1answer
85 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
13 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
17 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
44 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,...
0
votes
0answers
16 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
14 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
252 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 ...
0
votes
0answers
39 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
336 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
51 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 ...
1
vote
1answer
857 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
0answers
26 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
92 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
102 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
103 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 ...
2
votes
1answer
2k 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
23 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
128 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
0answers
29 views

Terraform functions

i was playing around with functions in terraform ,, and created this which works fine. zookeeper_ip_address = "${join(":2888:3888\n", aws_instance.zookeeper.*.private_ip)}:2888:3888" i.e it ...
0
votes
1answer
79 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: * ...
1
vote
1answer
189 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 ...
1
vote
0answers
17 views

all volumes are geting deleted when one EC2 is being deleted via terraform

i am using this template to create aws resources. my count is 2, every thing is getting created as per plan,, i am attaching a 2nd ebs volume of 1 gb to both machines, which is also happening well, ...
2
votes
1answer
138 views

How do I install Terraform libvrit_cloudinit?

I have searched all day trying to find a document on how to install the libvirt_cloudinit provider for Terraform. When I execute a terraform plan I encounter this error message: Error: ...
0
votes
1answer
24 views

Understanding contents and workwise of a Terraform plan

If you export a Terraform plan, it is a binary file. Now, calls to a cloud management interface are HTTP calls following corresponding REST APIs. Does this mean this internal Terraform format ...
0
votes
0answers
36 views

Terraform: Cannot specify duplicate termination policy - [OldestInstance]

After running a terraform apply I get the following error output: Error: Error applying plan: 2 error(s) occurred: * module.leaderboards.aws_autoscaling_group.asg: 1 error(s) occurred: * ...
0
votes
0answers
203 views

Terraform error 403

I have a terraform setup that seems to only work part of the time, I get an error 403 and can't access resource manager API. What I don't understand is that I can use a simple terraform setup to ...
0
votes
0answers
51 views

How do I reproduce existing S3 lifecycle rules in Terraform?

I've used Terraforming to create a copy of my existing AWS infrastructure in Terraform but it doesn't support lifecycle rules at the moment. I have the following diff: lifecycle_rule.#: "1" => "0"...
0
votes
1answer
322 views

How can I use Docker Hub in Terraform?

The instructions in Terraform Docker Provider give the example: # Configure the Docker provider provider "docker" { host = "tcp://127.0.0.1:2376/" } # Create a container resource "docker_container"...
0
votes
1answer
66 views

How do I handle multiple AWS accounts in Terraform?

I've read up on Terraform and using AWS S3 and DynamoDB for sharing state and locking. My problem is that we have multiple AWS accounts, by which I mean multiple sign-in locations like: https://...
4
votes
1answer
77 views

Where do you start with hosting the infrastructure for your infrastructure?

So I'm trying to get started with the HashiCorp stack, but the question I keep asking myself, when looking at any of this DevOps infrastructure stuff, is what infrastructure should you be using to ...
0
votes
0answers
26 views

AWS ElasticBeanstalk Clone Prod to a temporary environment to debug

Is there a good approach to create a copy of prod environment just for devs to debug a bug that couldn't be reproduced or is there any appropriate setup in multi-tenant situation with multiple ...
2
votes
1answer
61 views

How do you handle the huge number of possible permutations of Dockerfiles / Teraform files?

We have adopted Docker and Terraform as the foundation forour devOps. We have a basic version of it up and running today. Dockerfiles live in each projects git repository and Terraform files are more ...
1
vote
2answers
1k views

Terraform plan -var-file=“myvars.vars” does not run [closed]

I try to lean terraform for usage with our AWS environment. I have created a .tf file and terraform init was successful. In the .tf file I have a number of variables that are populated via .var ...
0
votes
0answers
78 views

Terraform Project Organization with AWS VPC Peering Connections

How best does one organize a project for AWS that makes use of peering connections. At present my folder structure looks like this modules/ staging/ production/ provisioning/ peering/ I'm also ...
1
vote
1answer
275 views

Jenkins Pipeline job - remember previous values

I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e. 1) GCP Project Name 2) Number of RHEL Servers 3) RHEL Server names ...
0
votes
1answer
191 views

Terraform resource definition for Azure App Service Environment

I am trying to create an Azure App Service Environment using Terraform. Is there any real-life working samples for this? How should we decide to use a terraform resource is there a tested resource ...
1
vote
0answers
95 views

Provisioning times for Redis in cloud taking too long, how can we shorten it?

Provisioning a 1 GB Redis cache service on AWS takes around 8 minutes. Doing the same on Azure takes around 16 minutes. Ours Terraform scripts need the call back from the Redis systems. Why is this ...
-2
votes
1answer
64 views

Set user in aws

I have a lot of instance in aws.I have build through terraform. I have made scripts of making user(e.g. user1 rather than ec2-user).But i am facing one issue.when i check .ssh/authorized_key. I have ...
-2
votes
1answer
706 views

Make instance with newuser by terraform

I want to make new instance with "user1" rather than ec2-user(AWS) default.i want achieve this by terraform. Like in azure terraform it can be done by "os_profile{}", but how can i do in aws by ...
5
votes
2answers
345 views

Terraform AWS AZ error - manually specify AZ?

I'm fairly new to terraform and when creating AWS infrastructure I use the following to fetch the 'available' availability zones for my region (us-east-1) where I'm trying to create an EKS cluster. ...
2
votes
1answer
427 views

Terraform Issue - Can't find Data Source in Sub Module?

I'm fairly new to Terraform and have been following this example on creating an EKS cluster - https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started ...