Questions tagged [terraform]

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

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

how to prevent aws ecs service scaleOut policy from performing a scaleIn operation?

Intro: I am having an issue with autoscaling on my ECS service, the ScaleUp policy is sometimes scaling down my tasks. this is not expected or desired. The problem: I have autoscaling StapScaling with ...
0
votes
0answers
7 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 ...
0
votes
1answer
20 views

SubnetsHaveNoServiceEndpointsConfigured error when deplying cosmosdb account

I'm trying to deploy cosmosdb account with mongodb on azure with terraform. But 'terraform apply' times out with SubnetsHaveNoServiceEndpointsConfigured error. Error: creating CosmosDB Account "...
0
votes
0answers
34 views

Terrafrom | count is set and used inside resource but still gives Reference to "count" in non-counted context error

first I set my data (here is service principle) to access the resources, the idea is do not create any if it is not a production environment by count = var.env == "prod" ? 1 : 0 data "...
0
votes
1answer
62 views

AWS ECS Green/Blue with CodePipeline: The ELB could not be updated due to the following error: Primary taskset target group must be behind listener

I've been trying for hours to get a basic CodePipeline up and running with ECS Green/Blue. We're creating a prototype, so everything is in a single repo for now, and the Dockerfile, taskdef.json, ...
0
votes
0answers
12 views

assig different network_security_groups to different VM

I have a terraform config with multiple virtual machines in its vnet. The machines are on the same vnet + subnet and that subnet has a network_security_group attached, like so: resource "...
0
votes
1answer
47 views

network_security_group_id not expected in azurerm_network_interface

I'm following a lecture on terraform for azure. They add a property network_security_group_id to an azurerm_network_interface resource "azurerm_network_interface" "demo-instance" { ...
0
votes
1answer
72 views

Terraform: add to existing AWS policy, or create policy if needed

Several of our terraform root modules need add to an existing policy that provides read-only permissions for S3 buckets -- each module has its own bucket. I cannot figure out how to add to the ...
0
votes
0answers
20 views

Terraform dynamic configuration for AWS EMR task fleet: How to include Spot or On-Demand capacity and launch specifications?

I am trying to create a Terraform configuration that would allow me to launch an EMR cluster with a Task Fleet running on either On-Demand or Spot instances, according to user's choice made when ...
0
votes
1answer
23 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 | ...
0
votes
1answer
72 views

Terraform/AWS Macie: how to use managed data identifiers?

I am trying to enable AWS Macie via Terraform to run scheduled jobs that scan S3 buckets for sensitive data. I've been able to create an account and execute an initial scan of my buckets, but I would ...
1
vote
1answer
55 views

How to mount EC2 intances to AWS EFS via Terraform [closed]

I'm trying to Terraform a few EC2 instances, and would like to automate the provisioning steps that involve mounting their filesystems to EFS. The commands to run this manually are as follows: $ sudo ...
0
votes
0answers
32 views

Terraform cannot destroy with EBS volume attached

to detach from Instance (): unexpected state 'busy', wanted target 'detached'. last error: %!s(<nil>) I get the above error when I try to run terraform destroy. I think the ebs volume must be ...
0
votes
0answers
13 views

Restricting one module for one tf file

So I have file called main.tf in which I am calling the existing module for iam_role, but in same main.tf I have called one more module for service_role but I want to restrict that service_role module ...
1
vote
1answer
48 views

Why is Terraform not picking up locals.tf?

Here are my files so far. main.tf data "my_vars" "vars" { certificate_arn = local.certificate_arn } variables.tf variable "certificate_arn" { description = "...
0
votes
1answer
40 views

Are multiline lists valid in Terraform?

I currently have the following. module "module-name" { source = "./directory" environment = var.environment team_names ...
0
votes
0answers
5 views

How to handle configuration dependency which has links to resources beyound subscription?

I have a subscription in Azure that is a part of bigger configuration, which I don't have access to. (I know they use Ansible). I am given a Private DNS Zone which has been originally created by ...
0
votes
0answers
49 views

Error 403 while connect azure with terraform

I am trying to create VM on azure using terraform using article while getting below error : root@ip:~/terraform-azure-windows-vm-scale-set# terraform plan ╷ │ Warning: Value for undeclared variable │ │...
2
votes
0answers
27 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 ...
3
votes
1answer
71 views

Gitlab CI: change pipeline definition dynamically

I need to pass info from stage A to stage B so I can change stage B dynamically. Details: I have a stage (A) where I validate a terraform plan and check if it's going to destroy resources. I have ...
1
vote
1answer
132 views

Making aws_lb_listener default_action dynamic

I use Terraform a mostly uniform group of servers - EC2, S3 etc. This works reasonably well, except we need to have rather different actions for the load balancers depending on the specific group, and ...
2
votes
2answers
125 views

Get a list of remote VPCs on AWS using Terraform?

I'd like to get a list of all remote VPCs from AWS with terraform. I've read the documentation and found two data sources: AWS_DEFAULT_VPC AWS_VPC The first one will give you the default VPC and the ...
3
votes
2answers
332 views

Get private key from terraform state?

I used the terraform resource tls_private_key to generate a key and push that into AWS, but it didn't give me the private key to use to access the related resources. How can I recover that key?
1
vote
2answers
57 views

Dynamic environments per client, which is the best approach, if any?

I don't know how to explain this problem better, but I'll try to explain it clearly: Where I work our customers are companies, with lots of users We offer a SaaS solution for them to manage stuff For ...
0
votes
1answer
279 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. ...
0
votes
0answers
16 views

How to limit access to internal AWS instances by other services and developers?

I have a dozen instances and lambdas, most of which are not publicly accessible. There are several dozen developers. Everything is currently managed by terraform. I would like to restrict access to ...
1
vote
1answer
41 views

Root ssh key for ansible control node

Scenario: Deploy 30 VMs using terraform and then run ansible - how many ssh keys do you generate? Virtual machine definition in terraform requires administrator ssh key or password provided. Do you ...
0
votes
1answer
61 views

Terraform import and using ip address as attribute name

I am building terrform.tfstate files from Terraform managed Fortigate devices. After producing output JSON files using Terraform output and a custom script to produce tf.address.tf.json, I wish to ...
3
votes
1answer
442 views

Terraform apply output only

I'm trying to apply only the output variable definition. Here is the "output" I want to apply. output "environment_information" { value = { foo = "value1" ...
1
vote
0answers
24 views

Native Terraform AWS Auto-Scaling Group Management with health Checks

I have been using CloudFormation for the past 3 years to manage AWS infrastructure which consists of multiple auto-scaling groups with immutable AMIs (amongst other things). I am trying to rewrite ...
1
vote
1answer
109 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 ...
1
vote
3answers
139 views

Does it make sense to create CloudFormation Stack using Terraform?

I am not very familiar with AWS, but I know the basics. So please forgive me for any newbie mistakes in the question. I am trying to integrate our AWS accounts with a vendor app. The vendor has ...
0
votes
1answer
21 views

Resources don't seem to show up in Terraform state after import

I'm in the middle of importing a bunch of AWS resources into Terraform by doing the following: put a stub resource into a .tf file terraform import the resource (using the same address) copy the ...
1
vote
1answer
214 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 ...
4
votes
1answer
272 views

Terraform: how do you inspect sensitive data?

In a resource of type aws_ecs_task_definition my plan has an line that looks like this: ~ container_definitions = (sensitive) # forces replacement Now in principle this could be doing anything - ...
0
votes
3answers
318 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 ...
1
vote
1answer
103 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
38 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
2answers
55 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
19 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?
3
votes
2answers
5k 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" "...
2
votes
1answer
369 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 ...
1
vote
1answer
411 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
852 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
28 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
361 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
200 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
69 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
2answers
81 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 ...
1
vote
1answer
74 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 ...

1
2 3 4 5