Questions tagged [terraform-module]

Use this tag if a question is about terraform-module

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

Terraform - No Infrastructure Changes Detected

I have deployed a Cloudwatch Log Group community module to my terraform stack (sourced from https://github.com/cloudposse/terraform-aws-components) but I have spent more than a day trying to resolve ...
Don Draper's user avatar
0 votes
0 answers
83 views

subnet_arn for datasync location using Terraform vpc module?

In Terraform, I'm trying to define a datasync location for syncing files from S3 -> EFS. I'm new to Terraform and using the terraform-aws-modules/vpc/aws module[1] to help me get started so I ...
Nstevens's user avatar
  • 103
2 votes
1 answer
2k views

conditionals in module providers meta-argument

I am provisioning a bunch of resources via a module. module "test" { source = "../modules/my-module" vpc_id = module.vpc.vpc_id subnet_ids = module.subnets.ids } Now, in ...
shine's user avatar
  • 35
3 votes
1 answer
3k views

Terraform conditional block inside a map

I have an aws_lambda_function resource like below: resource "aws_lambda_function" "mylambda" { #... environment { variables = { FOO = 1 } ...
sgargel's user avatar
  • 244
1 vote
1 answer
667 views

How to fetch azure secret if exist in KV using terraform

I am using below terraform code for fetch azure secret and this is working fine when secret is exist in the azure KV. Getting error when secret is not available in KV. data "...
Nullpointer's user avatar
0 votes
0 answers
84 views

How to set the vpc quota value for the terraform vpc module for aws?

I have a terraform module defined like so: module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "2.77.0" name = "test_vpc" ...
Nona's user avatar
  • 101
1 vote
1 answer
161 views

TerraForm separate stages

I want to separate my development stages in the TerraForm repository. The TerraForm workspaces page states: "Workspaces alone are not a suitable tool for system decomposition, because each ...
Salmon's user avatar
  • 11
1 vote
0 answers
398 views

Trying to access a value from a jsonencoded attribute in a terraform manifest file

I have the following aws_ecs_task_definition resource definitions in a child module: resource "aws_ecs_task_definition" "main" { family = "${var.name}-task-...
George Udosen's user avatar
0 votes
2 answers
1k views

Is there a way to install a private key for a user with cloud-init?

I have a user that needs to authenticate against a company source repository when using git clone. To set this up for the user I need to specify a users private key (not the host private key in /etc). ...
Evan Carroll's user avatar
  • 1,794
0 votes
1 answer
2k views

Terraform get subnet id by it's CIDR block

I have a list of CIDRs for my subnets and want to get their ids. Is it possible to do with terraform? my_subnets = ["212.12.1.0/24", "212.12.2.0/24", "212.12.3.0/24"] I ...
Most Wanted's user avatar
1 vote
1 answer
285 views

Terraform single-file modules

I've been reading up the Terraform standard module structure and I see they want a main, outputs, and variables file in every one. I have a pair of modules where everything fits in a single tmux ...
ChrisW's user avatar
  • 13
1 vote
0 answers
421 views

Creating Multi-Origin endpoint groups in Azure using Terraform

I am attempting to provision multiple origins, which are storage accounts (blobs) in different regions. Whilst provisioning the CDN profiles (multiple environments) and a single origin for each is ...
George's user avatar
  • 21
0 votes
1 answer
177 views

[Multiple projects, one Azure subscription], Terraform - feasibility of distributed configuration

I know terraform a bit, but in the past I worked just with one terraform repository serving all infrastructure (with modules per provider/function). infrastructure |- modules | |- gcp | ...
Wojtas.Zet's user avatar
2 votes
0 answers
329 views

Is it possible to loop through ec2 resources created with a count variable, while in the same module?

I have an ec2 module, which determines the number of instances via a count variable, like so: resource "aws_instance" "this" { count = var.instance_count I would like to ...
Lucky's user avatar
  • 141
1 vote
2 answers
3k views

Terraform organising modules/code for multiple projects

I'm fairly new to TF and wonder how people are structuring Terraform for bigger infrastructure. We are moving our infrastructure to Terraform bit by bit. I'm curious how people are approaching that. ...
BartZ's user avatar
  • 111
1 vote
1 answer
537 views

Using counted data source in non-counted provider block in Terraform

I'm new to Terraform, I need suggestion about handling one case where I need to use data from counted data-source to un-counted provider. I need to fetch the gke-cluster context and pass it to ...
Learner's user avatar
  • 111
1 vote
1 answer
804 views

How to use kubernetes_service data provider in Terraform?

I have simple workflow. Create a cluster, install ingress with helm and once it's ready, get load balancer's IP address to update CF dns records. It's all in one script. After creating nginx-ingress ...
Pablo's user avatar
  • 131
1 vote
2 answers
3k views

Enable/disable resource in terraform using count

I added a piece of code to support enable/disable to the feature - I used the count. Now I have the following problem: ERROR: on modules/eventhub/main.tf line 110, in resource "azurerm_eventhub&...
Nava Bar's user avatar
1 vote
1 answer
313 views

How can I add another module to my existing Terraform deployment plan?

I have deployed a project within Terraform. I need to add a 4th application module to my existing plan. How do I update my plan to include this 4th module and deploy the missing module without ...
DemiSheep's user avatar
  • 163
0 votes
1 answer
2k views

Terraform Dynamic Block with list intro them

I'm creating a AWS Cloudfront module and some troubles are happening because have some Cloudfront parameters that are "dynamics/optional" too. When I'm trying run the $ terraform validate ...
Vader's user avatar
  • 466
1 vote
1 answer
1k views

Include verbose output in terraform/terragrunt

Is there any way to include verbose / debugging output in Terraform / Terragrunt? I'm new to the language, and often struggle with knowing exactly what's going on. It would be helpful for me to be ...
JohnLBevan's user avatar
1 vote
1 answer
3k views

How to create dependency between modules in terraform

I have 2 modules A and B. I want a particular resource in module B to be created only after a particular resource in module A is completed completely. I was trying to achieve just that with this as ...
Mohammed Ali's user avatar
0 votes
1 answer
509 views

Why does my Terraform config require variables in multiple places?

My folder hierarchy looks like this: / -> live/ : main.tf : variables.tf -> modules/ -> logs/ : logs.tf : variables.tf In my main.tf I have: module "logs" { ...
MrDuk's user avatar
  • 295
0 votes
1 answer
197 views

Unable to understand the logic behind this terraform function

So i was going through a code of some one else and just could not make sense of it,, if may be some can of this, "${replace(jsonencode(list(local.cadvisor_container_definition)), "/\"(\\d{2,5}|true|...
Mohammed Ali's user avatar
2 votes
1 answer
5k views

Module directory modules/queues.tf does not exist or cannot be read

I am trying to setup terraform with modules and when doing terraform init after creating a module I have ran into an issue where I am told it does not exist or can't be read. I've checked many times ...
joshk132's user avatar
  • 465
3 votes
1 answer
6k 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 ...
kenorb's user avatar
  • 7,791
2 votes
1 answer
10k 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 ...
user avatar
13 votes
3 answers
49k 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 ...
Steven K7FAQ's user avatar
5 votes
1 answer
711 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 ...
Black Dynamite's user avatar
6 votes
2 answers
4k 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. ...
user389955's user avatar