Questions tagged [terraform]

Terraform is a tool for building, changing, and combining infrastructure safely and efficiently.

Features:

  • Infrastructure as Code
  • Execution Plans
  • Resource Graph
  • Change Automation
415 questions
65
votes
1 answer

What does "Error: Cycle". means in Terraform?

The Terraform docs for some weird reason do not explain what "Error: Cycle" means. I've looked everywhere but there is no mention of it on the official docs. (Turns out it is well-known term, a circular dependency, that someone apparently renamed…
Juan Jimenez
  • 870
  • 1
  • 7
  • 13
27
votes
6 answers

Terraform - Use nested loops with count

I am trying to use a nested loop in terraform. I have two list variables list_of_allowed_accounts and list_of_images, and looking to iterate over list list_of_images and then iterate over list list_of_allowed_accounts. Here is my terraform…
vikas027
  • 1,189
  • 2
  • 11
  • 15
14
votes
4 answers

How to fix "NoCredentialProviders: no valid providers in chain. Deprecated."?

Here is a terraform script I lifted from this repo provider "aws" { region = "${var.aws_region}" profile = "${var.aws_profile}" } ##---------------------------- # Get VPC Variables ##---------------------------- #-- Get VPC ID data…
Anthony Kong
  • 3,288
  • 11
  • 57
  • 96
12
votes
4 answers

Terraform: Choosing credentials for a remote state file

I have existing infrastructure in Terraform and have been using it for a while. Recently I had swapped the AWS credentials of my local laptop (the creds stored in ~/.aws/credentials) and it stopped working until I re-set those credentials back. The…
emmdee
  • 2,187
  • 12
  • 36
  • 60
11
votes
3 answers

How can I find the version of all Terraform providers in a workspace?

I can't find the canonical way to report the version of a specific terraform Provider, in this case the AWS provider. I can find a binary that seems be named with version information: $ ls…
remeika
  • 211
  • 1
  • 3
  • 6
8
votes
1 answer

What is the meaning of `private` attribute in `tfstate` (for a DynamoDB instance)?

I’m bootstrapping my terraform remote state by storing the tfstate of creating an S3 bucket and a DynamoDB lock table and storing it in git. My organisation scanned the repository using Yelp/detect-secrets and flagged the line containing private as…
oschrenk
  • 223
  • 4
  • 5
8
votes
1 answer

Worker Group VS Node Group EKS

I am trying to use https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/12.2.0(Terraform AWS EKS provider) What is the difference between worker nodes and node group?
7
votes
1 answer

How to configure cross region VPC peering on AWS with Terraform

I'm trying to create a terraform configuration to spin up multiple VPCs in different regions and create VPC peer connections between them. This is my module for the VPC # Required Variables variable "region" {} variable "cluster_name" {} variable…
rvabdn
  • 245
  • 4
  • 11
7
votes
1 answer

Terraform wants to rebuild my entire AWS deployment

I have an AWS environment that was built 100% with Terraform. I haven't touched it in a few days, but today when I went to make what I thought was a fairly trivial change, Terraform has decided that it wants to build me an entire new AWS…
Mark Henderson
  • 68,823
  • 31
  • 180
  • 259
6
votes
3 answers

How to add lifecycle rule to an existing AWS S3 bucket with Terraform

I have an existing S3 bucket and I wish to add "folders" and lifecycle_rules to it. (I say "folders" because that is how they are represented at the client end, as they are accessed via a Storage Gateway.) I can create the folders, for example on to…
prowla
  • 71
  • 1
  • 4
6
votes
2 answers

AWS with Terraform - Filtering public/private subnets (without relying on tags)

Request: I would like to spin an AWS ALB - For that I need at least two subnets in two different Availability Zones. (Terraform shows a very explicit error in case we forget - see Error #1 Below). I would like to check the current number of public…
Rot-man
  • 327
  • 2
  • 9
6
votes
1 answer

Storage account name already exists

When I attempt to run the code at the bottom I get the following error (no matter what I name the storage account) currently its named "functions" but I could call it "bannanas" and it would output the same error? ERROR I ENCOUNTER :( "1 error(s)…
wildstallion
  • 61
  • 1
  • 2
6
votes
1 answer

Terraform accessing list elements from module output

Let's say I have a module, which generates some ids: module.tf: resource "random_id" "etcdapiserver-id" { byte_length = 4 count = "${var.etcd_apiserver_count}" } module_output.tf: output "etcdapiserver_hostname_list" { …
Victor Bessonov
  • 153
  • 1
  • 2
  • 10
6
votes
2 answers

Terraform: How to prevent ASG ec2 instance coming up before NAT Gateway is created

I'm using 2 modules. One is a custom VPC module and the other is a module to bring up a jenkins ec2 instance. You can't use depends_on with modules but the Jenkins module does rely on certain outputs from the VPC module like so... …
Levi
  • 253
  • 2
  • 10
6
votes
3 answers

Why is terraform erring with 'SignatureDoesNotMatch: Signature expired'?

I started getting the following when running terraform commands: $ terraform refresh Error refreshing state: 1 error(s) occurred: * SignatureDoesNotMatch: Signature expired: 20170226T035111Z is now earlier than 20170227T013047Z (20170227T014547Z -…
AXE Labs
  • 1,549
  • 5
  • 19
  • 24
1
2 3
27 28