Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [terraform-module]

Use this tag if a question is about terraform-module

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

Error configuring Terraform Community Providers

I'm trying to configure a provider to create a Redshift datashare cluster, but I'm encountering some issues. In the version file, redshift is set to required_providers, And in the root module, I’ve ...
Chiyoung Choi's user avatar
0 votes
0 answers
21 views

I trying to create a NAT GATEWAY module but i have the result below after terraform plan

Main.tf: # allocate elastic ip. this eip will be used for the nat-gateway in the public subnet az1 resource "aws_eip" "eip_for_nat_gateway_az1" { vpc = true tags = { ...
user24917648's user avatar
0 votes
1 answer
15 views

Importing resource to replace terraform official module

I have a resource created using official AWS terraform module, like: module "my-module" { source = "terraform-aws-modules/efs/aws" } Now, I want to convert that to a resource, ...
Miloš Milutinov's user avatar
0 votes
0 answers
18 views

Terraform: Provider configuration with modules and feature flags

I want to use Terraform to manage many resources on many environments. I chose to create a workspace for each environments. I also use an object to enable or not module on each environement: variable &...
DavJ's user avatar
  • 1
1 vote
1 answer
87 views

How can I use modules that are hosted on Spacelift outside of Spaceilft?

I currently have modules that are hosted on Spacelift, I am trying to import a module locally but I may be overlooking as I am getting: Error: Module has no versions │ Module "spacelift.io/...
Danielle Murphy's user avatar
0 votes
1 answer
1k 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
2 votes
1 answer
3k 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
  • 55
3 votes
1 answer
4k 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
864 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
1 vote
1 answer
172 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
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
  • 2,171
0 votes
1 answer
3k 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
327 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
0 votes
0 answers
495 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 ...
BigotesDeGato's user avatar
0 votes
1 answer
215 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
1 answer
418 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
600 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
873 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
431 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
670 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
202 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,881
2 votes
1 answer
11k 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
4 answers
53k 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
749 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