Questions tagged [terraform]

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

Filter by
Sorted by
Tagged with
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 ...
0
votes
1answer
23 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 ...
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
2answers
68 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
1answer
30 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
43 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
0answers
23 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 ...
0
votes
1answer
53 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&...
1
vote
0answers
14 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 ...
0
votes
0answers
25 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
133 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:...
1
vote
1answer
111 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 ...
0
votes
0answers
23 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
0answers
53 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
33 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
168 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
274 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
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!
1
vote
1answer
53 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
1answer
195 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 ...
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? ...
1
vote
3answers
205 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 ...
0
votes
1answer
73 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 ...
0
votes
1answer
75 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}" ...
0
votes
1answer
133 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 ...
0
votes
0answers
13 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
45 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
280 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
21 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....
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
35 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 ...
0
votes
1answer
26 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 ...
1
vote
2answers
58 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 ...
3
votes
1answer
127 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 ...
1
vote
1answer
116 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 ...
0
votes
2answers
175 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 ...
0
votes
1answer
61 views

Find relevant domain/hosted zone under which to host subdomain

Context In Terraform, to create a new domain record, I first need to find the zone under which it should be hosted. E.g. If I want to create a DNS record for mysite.example.com, I'd get the zone ...
1
vote
3answers
369 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 "...
1
vote
0answers
174 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 ...
2
votes
1answer
65 views

Are manual changes to an aws IAM policy detected by Terraform plan?

I know that Terraform dose some checks before the plan and can detect some changes but not others such as detecting changes to variables on a lambda but not detecting a new secret in a secret manager. ...
1
vote
1answer
223 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
0answers
36 views

Terraform duplicates the security groups, how do I stop it?

I'm using terraform to create two instances and a security group. Here is how I did it: # bastion host resource "aws_instance" "bastion_1a" { ami = data.aws_ami....
1
vote
3answers
71 views

Run integration test with ansible playbook using terraform provisioning

Ok so I am totally new to devops! I am an experienced developer, but at my new job I have been tasked to automate CI/CD. Non-existing so far. Only CI with Travis. So the ideal workflow is: Push to CI ...
1
vote
1answer
381 views

Troubleshooting VPC flow logs with an S3 bucket using SSE-KMS encryption with CMK

I'm using Terraform and trying to set up automatic export of VPC flow logs into an S3 bucket in the same AWS account and region (ca-central-1) that has default encryption turned on with AWS-KMS (using ...
1
vote
2answers
112 views

How do we move to a modern CICD approach

This may also be a general pulse; but here lies the issue We use EKS, we have Jenkins, we have Ansible, we have Terraform, we have BitBucket; but none of these really form a pipeline and I'm stuck ...
1
vote
0answers
30 views

secret id in docker terraform file

what value secret_id variable is referring in below main.tf and terraform.tfstate code There is no variable called "id" in my secrets.tf file main.tf resource "docker_service" "mysql-service" {...
1
vote
3answers
409 views

Terraform syntax error after V0.12 upgrade

I have just upgraded from terraform v0.11 to v0.12 But i am facing lot of error complete code @ https://github.com/sivatest82/Terraform1/tree/master/secretsv12 especially in the block secrets = [ ...
2
votes
1answer
82 views

Terraform fails to modify DNS settings a recently created VPC Peering connection because it is not yet active

I have the following configuration file: environment/main.tf: resource "aws_vpc_peering_connection" "sb_vpc_peering" { vpc_id = var.vpc_id peer_vpc_id = var.peer_vpc_id peer_region = var....
2
votes
1answer
369 views

Terraform conditionally create VPC

I am in the process of creating a terraform template, part of which can create a VPC. The user has the option to specify the parameter create-vpc. This will be passed to the module https://github.com/...