Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [terraform]

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

0
votes
0answers
15 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
24 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
19 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 ...
0
votes
1answer
39 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
12 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
12 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
25 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
68 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 ...
0
votes
1answer
99 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
17 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 ...
1
vote
1answer
50 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
19 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
31 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
0answers
40 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
15 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
84 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
23 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
13 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
74 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
36 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
127 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
59 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
76 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
24 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
51 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 ...
0
votes
2answers
663 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
66 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
202 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
146 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
74 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
43 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
336 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
248 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
270 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 ...
5
votes
2answers
5k views

Terraform: apply only one tf file

I have my security groups in a securitygroup.tf file. In the same dir there are plenty of other resource descriptions (rds, ec2 etc). Is there a way to perform a terraform apply --auto-approve only ...
0
votes
0answers
69 views

Detecting IAM user policy attachment configuration drift with Terraform

I'm implementing Terraform to control and track configuration across our AWS deployments. As part of that I'm tracking all of our IAM users, roles, groups and policies, and an important part of this ...
2
votes
1answer
784 views

How to set an existing IAM role to a new instance while spinning in terraform?

I am trying to attach an existing role created in AWS, but I am not able to add it in Terraform Code. I tried to add the role in instance profile but it didn't work either for me. Is there any direct ...
1
vote
1answer
83 views

Deploying a SaaS solution which is custom for every customer

So we have 5 repositories (Individual web services ex. CMS/E-commerce and internal APIs) which are currently deployed as Docker containers. What we plan to do is to use these services and make a ...
1
vote
1answer
361 views

Terraform: ignore_changes conditionally? (temporary EC2 instance public IP address)

I've got a couple of EC2 instances managed by Terraform, with public IP addresses in a VPC. With each Terraform run, I'm updating DNS records based on those public IPs. I don't need these instances ...
0
votes
0answers
121 views

How to create PTR Records on OpenStack with Terraform?

While setting up a a test environment with terraform on OpenStack, I am missing something: How do I set reverse DNS / PTR records for floating IPs?
1
vote
0answers
63 views

Creating a buildspec inside the buildproject itself

I have used cloudformation using yaml to build a pipeline AWS Codepipeline and there was a clear option to update the build commands using the script, How can I include the build commands inside the ...
8
votes
1answer
284 views

How to add shards to a Redis cluster managed by Terraform without loosing all state?

I have set up a Redis cluster with Terraform. The setup looks like this: resource "aws_elasticache_replication_group" "instance" { replication_group_id = "test" node_type = "...
4
votes
4answers
474 views

How can I get terraforms extern to execute `ssh-keygen -y -f ~/.ssh/id_rsa`?

I seem to be confused about how external works. I tried: data "external" "local_key" { program = [ "ssh-keygen", "-y", "-f ~/.ssh/id_rsa" ] } This gives me: failed to execute "ssh-keygen":...
5
votes
1answer
336 views

Create multiple EC2 instances using python script (in loop iteration)

I Have JSON file in which email address and count of instances are specified.I'm using python script to iterate through that file and get username/count number (count number will be used as number of ...
5
votes
1answer
170 views

Terraform: Delay the MySQL Provider

I have a Terraform project which uses the MySQL provider. Because of the way Terraform works, the MySQL provider will fail to load correctly because the AWS_RDS instance doesn't exist. Is there a ...
6
votes
6answers
248 views

In the HashiCorp stack, where's the appropriate place to add users?

I'm in the process of building some custom Linux images using HashiCorp's Packer, which will later be deployed to Azure using HashiCorp's Terraform. The VMs created from these images will need to have ...
2
votes
2answers
120 views

Can jenkins control baremetal with ipmi

I have a setup with a bunch of blades that pxe boot into coreos using terraform/matchbox setup. I currently control them all manually using ipmitool from my desktop. Is there a way to let jenkins ...
4
votes
2answers
715 views

What is the difference between modules and workspaces in Terraform

I currently use Terraform workspaces to configure different environments like dev, test, prod, and my code works fine. And I believe I can use workspaces to configure different regions as well. ...
1
vote
1answer
362 views

terraform chef provisioning - cannot validate certificate for 10.90.239.223 because it doesn't contain any IP SANs

While configuring the chef provisioner I am running into the following error after running 'terraform apply' chef_environment.terraform_01: Post https://10.90.239.223/organizations/mykitchen/...
5
votes
2answers
1k views

Does terraform support blue green deployments and roll backs out of the box

I have been trying use terraform for a while . any suggestions/tips on how I can handle blue green deployments . I see how terraform enables it with auto scale groups on aws . But I’d like run some ...