Questions tagged [terraform-module]

Use this tag if a question is about terraform-module

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 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 ...
user avatar
  • 1
1 vote
0 answers
11 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-...
user avatar
0 votes
2 answers
47 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). ...
user avatar
0 votes
1 answer
333 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 ...
user avatar
1 vote
1 answer
27 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 ...
user avatar
  • 13
1 vote
0 answers
54 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 ...
user avatar
  • 11
0 votes
1 answer
43 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 | ...
user avatar
2 votes
0 answers
61 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 ...
user avatar
  • 141
0 votes
1 answer
549 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. ...
user avatar
  • 101
1 vote
1 answer
160 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 ...
user avatar
  • 111
1 vote
1 answer
346 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 ...
user avatar
  • 131
1 vote
1 answer
1k 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&...
user avatar
1 vote
1 answer
82 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 ...
user avatar
  • 163
0 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
627 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
0 votes
1 answer
255 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" { ...
user avatar
  • 295
0 votes
1 answer
158 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|...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 435
1 vote
1 answer
3k 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 ...
user avatar
  • 7,011
2 votes
1 answer
8k 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
9 votes
3 answers
29k 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 ...
user avatar
5 votes
1 answer
608 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 ...
user avatar
6 votes
2 answers
3k 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. ...
user avatar