Questions tagged [terraform]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
3 views

Do I have to include gitlab variables in my terraform code in order for my credentials to be recognized?

I am trying to set up a pipeline, which is supposed to deploy terraform code into an aws account. The code works fine locally, and I have setup and imported the state bucket and dynamodb table which ...
0
votes
0answers
16 views

How CircleCI, Terraform and AWS should interact in CI/CD Pipeline

I'm new to devops and I'm have a hard time finding resources to help me with this question. My Goal is to have an automated CI/CD pipeline to launch my project. Basically I have a GitHub repo with a ...
0
votes
1answer
21 views

Terrafrom to declare both infra and application deployment in one state

Are there any advantages of maintaining both infrastructure (Infra-as-code) and application/service (helm chart deployment using helm_release provider of terraform ) under one state file? I don't like ...
1
vote
2answers
105 views

How do I use the remote-exec provisioner with Terraform?

I am using Terraform 0.14 and AWS. I am trying to write a .tf file that will invoke a remote-exec command via Terraform's provisioner. This code does not work: resource "aws_instance" "...
1
vote
3answers
243 views

Is there a way to lint Terraform?

I'm hoping there is something to pick up when I have misspelled variables and comments to save me some time when I'm checking my code and reduce the potential for any errors. I normally use IntelliJ ...
2
votes
2answers
2k views

How to get VPC id in Terraform module?

I have a module structure like module "vpc" { source = "./modules/vpc" } module "prod_subnets" { source = "./modules/vpc/modules/subnets/production" } when running am getting an error like [0m on ...
0
votes
1answer
56 views

How do I enable Google App Engine API with Terraform?

I'm attempting to enable the AppEngine service via Terraform but I'm getting an error: Error: Error creating App Engine application: googleapi: Error 403: App Engine Admin API has not been used in ...
0
votes
1answer
24 views

How to get code onto aws ec2 instance using terraform and gitlabs

I've just started learning Terraform (utilizing the AWS provider) and I have managed to replicate our infrastructure which includes quite a few amazon web services. I can successfully deploy it and ...
6
votes
3answers
4k views

How to use terraform import with module

Terraform v0.11.11 We have a quite big AWS setup created with Terraform. Different regions are applied separately, and that is why we have most of the things in modules which are imported like this: ...
1
vote
0answers
9 views

How Do I Get A Summary of Task Times With Terraform?

If I run ansible with profile_tasks I get a nice table at the end that shows me how long each task took. How can I get a similar summary at the end of running terraform apply?
1
vote
1answer
35 views

Terragrunt Linter

I'm having troubles using HCL files at VSCode. When I open the HCL file the indentations are messy. So I fix it and close the file, when I open again...messy again... Someone know a add-ons to works ...
0
votes
1answer
61 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&...
0
votes
0answers
24 views

Best way to organize e2e testing in separate environment without intervention to stable development process

Hello DevOps community! TL;DR What are your cases where you integrated cypress end-to-end testing to your project? What are the best approaches? Pitfalls? Long story... I got the QA engineer asking me ...
1
vote
0answers
15 views

How to test pipeline changes in Azure?

I currently have a pipeline in Azure which consists of a bunch of YAML which eventually calls some terraform script to handle the deployment side. What is the best way to handle dev testing of changes ...
1
vote
1answer
146 views

What does “eksctl create iamserviceaccount” do under the hood on an EKS cluster?

AWS supports IAM Roles for Service Accounts (IRSA) that allows cluster operators to map AWS IAM Roles to Kubernetes Service Accounts. To do so, one has to create an iamserviceaccount in an EKS cluster:...
0
votes
0answers
26 views

What's the equivalent of “kubernetes apply -k” in terraform?

I want to use EFS in my EKS cluster. I'm following this eks workshop. I need to deploy EFS CSI Driver using kustomize: kubectl apply -k "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/...
1
vote
1answer
118 views

Is it possible to have an aws EKS infrastructure as code?

Is it possible to declare "a complete production level EKS with other aws services" using terraform? I know that terraform has an eks module and an aws provider. But I'm not sure if one can ...
1
vote
1answer
29 views

Importing non-default workspaces in Terraform

I'm having a bit of trouble with Terraform. I have a Terraform project which is shared by a few developers and uses non-default workspaces (i.e. named workspaces, not the default one). I would like ...
0
votes
0answers
27 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 ...
4
votes
1answer
52 views

Are there automated quality checking tools for Ops code

In the dev world, we have several tools available to us for automated quality checks. We have unit tests that run on each build, Sonar to check for code quality, metrics being sent to Grafana and ...
0
votes
3answers
1k views

Service account permissions error when provisioning instance group from template

I'm trying to create a GCE Instance Group Manager using terraform resource "google_compute_region_instance_group_manager" "frontend_group_manager" { name = "frontend-igm" base_instance_name = "...
0
votes
0answers
56 views

Terraform app deployment to existing eks cluster

Is it possible to deploy an app with terraform to an already existing eks cluster (one that was not created with terraform)? terraform { required_providers { aws = { source = "...
1
vote
1answer
38 views

IaC Deployment in Azure with Terraform + Chef vs. Puppet vs. Ansible for Data Engineers

I am an Azure Data Engineer and try to leverage the IaC benefits in this area of Azure Data Factory, Azure Databricks, Azure SQL & Synapse, Azure Power BI, Azure IoT. After some research I figured ...
3
votes
1answer
215 views

Terraform variable Validation

is it possible to use validation of a variable type equals list(string)? My example: main.tf name = "tf-prd-sg-foo" image_id = "ami-00e788542ee66c64f" ...
1
vote
1answer
13 views

Mass remove/add to multiple security groups cross region

Would it be possible to create a script or use something like terraform to mass remove/add security group entries across several regions under the one account based on the security group name? ...
0
votes
1answer
82 views

Terraform foreach multiple map variables

I need to do the following in Terraform but can't work out how Here is what I have local { app_config = { test-web = { name = "test-web-${local.environment}" ...
1
vote
1answer
307 views

Terraform - gitlab provider does not start

I am using terraform docker image hashicorp/terraform:latest and I define the provider in main.tf as follows: terraform { required_providers { gitlab = { source = "gitlabhq/gitlab&...
1
vote
1answer
56 views

Using a combination of Terraform and Ansible to create dynamic AWS EC2 infrastructure

The company I work for wants to prevent provider lock-in adn therefore told us to use Terraform+Ansible instead of Cloudformation. We already decided to use terragrunt as an addon. While the ...
1
vote
0answers
15 views

Define a repo logo via terraform github_repository

Is there a way to give my terraformed github_repository a custom logo? The doc doesn't have a field for it, but is there an undocumented feature? Branding is important!
2
votes
1answer
215 views

Terraform ignore_changes block on JSON-encoded attribute

I'm currently trying to get CloudWatch logging and DMS configuration working smoothly in my module by ignoring certain attributes on replication_task_settings. Right now, I have a DMS replication task ...
0
votes
1answer
81 views

Terraform deletes AWS lambda layers instead of keeping the older versions

I am using terraform version 12.26 for AWS deployment. Whenever I try updating a lambda layer, the lambda layer version is incremented, but the older layer is deleted. Even though my current version ...
6
votes
3answers
19k 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 ...
1
vote
1answer
240 views

Terraform fails on creating network with libvirt provider

I wanted to spin up a test environment locally using the description from this stackoverflow answer: https://stackoverflow.com/a/58607900/4397899 The main.tf looks like ##############################...
1
vote
1answer
156 views

Can you inherit a template_cloudinit_config in another template_cloudinit_config object in Terraform?

I recently discovered template_cloudinit_config within Terraform, and I'm hoping I can utilize it to specify something like the code below. Basically my goal is to declare a core ...
5
votes
3answers
563 views

Baking Immutable Images

I am working on a project and we are trying to bake immutable images on containers as IaC. These images can have J2EE, .NET or Python apps on it. All OS patches should be applied to this image ...
0
votes
0answers
14 views

Need advice to setting up a Jenkins blue/green infrastructure, from a high level?

I'm trying to use Terraform to setup a blue/green Jenkins deployment. The idea is to setup a green infrastructure for testing, and when that is good, promote it as the blue node to be used for ...
0
votes
0answers
48 views

Golang + Terraform in Gitlab CI

I have an application made of two compiled Go programs and a Terraformed test stack. There will be more functions and resources in the coming weeks. Maybe other technologies that will need other ...
0
votes
1answer
341 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 ...
0
votes
1answer
22 views

Create dynamic resources using 'for_each' or 'for'

I want to create multiple resources using this: resource "group" "list" { g_name = group_name p_name = project_name } The input local variable is nested: > local....
1
vote
2answers
59 views

Populate Database

I am using Terraform Cloud to build the infrastructure. One of the resources is a postgresql database. What is the best way to populate the database by creating tables, multiple schema etc after the ...
0
votes
0answers
27 views

Terraform | depends_on causes sequence problems for incremental updates

Summary: depends_on of Terraform works fine, BUT when I have an incremental update with new resources going in-between then it causes the new resources to run in parallel (which will NOT if I run it ...
0
votes
0answers
36 views

Private EKS behind corporate Proxy - with Terraform

I have built a private EKS cluster, im now going through the motions of trying to attach a Managed Node group to the cluster using Terraform. Looking through lots of resource the Node group required ...
57
votes
7answers
23k views

How can I manage secrets in .tf and .tfstate?

I would like to use the Terraform MySQL Provider to keep a list of mysql users and grants handy for creating new test environments. The .tf and .tfstate files both seem to want to store the MySQL ...
0
votes
1answer
29 views

Provision and configure Azure VM in private subnet (file, remote-exec, cloud-init, etc.)

(Originally posted to discuss.hashicorp.com) I’m setting up a basic multi-tier infrastructure composed of two Azure VMs: Web server (VM1) with public IP and private IP (subnet1) Data server (VM2) in ...
3
votes
1answer
130 views

Dedicated/Separate Git Repo as Terraform Remote Backend

I see that there are multiple options for Backends, however git isn’t one of them. I believe git can be used as a backend for tfstate, in the below steps: Create a dedicated git repo Commit the ...
11
votes
2answers
378 views

How to create a host on a DigitalOcean team with Terraform?

Teams on Digital Ocean are very recent and there is no documentation about using them with Terraform. All information I can found is how to work with them manually. I was hoping that I could say ...
3
votes
2answers
780 views

All volumes are deleted when EC2 intance is deleted via terraform

I am using a terraform template to create AWS resources. My count is 2, everything gets created as per plan, and, I am attaching a 2nd EBS volume of 1 GB to both machines, which is also happening well....
1
vote
3answers
393 views

How to produce a map from the cartesian product of two lists to use with for_each on a resource with Terraform

I need to create a datadog synthetics monitors with the resource datadog_synthetics_test I need to monitor multiples cluster, with multiple point of view : # Clusters variable "...
0
votes
2answers
191 views

How can I list all environment variables configured in Terraform?

I configured AWS provider in Terraform by providing an access key and secret as environment variables according to the documentation: $ export AWS_ACCESS_KEY_ID="anaccesskey" $ export ...
1
vote
1answer
153 views

Terraform: Sanitize a map that may be a map of strings or map of maps or combo of both

I want to take a map such as this that is passed in as a variable cidrs = { A = [1.1.1.1] B = [2.2.2.2, 3.3.3.3] Group1 = { C = [4.4.4.4] D = [5.5.5.5] } } and then within the locals ...