Questions tagged [terraform]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
81 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&...
3 votes
1 answer
306 views

How to use same terraform code for both kubernetes clusters Oracle (OKE) and AWS (EKS)?

I want to use same terraform code for both kubernetes clusters oracle (OKE) and AWS (EKS) and install the argocd helm chart on it, I given my code below for your reference, now the problem I am facing ...
0 votes
1 answer
54 views

How to pass terraform locals variables into AWS resource template body

I am trying to apply aws conformance pack to my aws account using terraform. I am using the sample aws config rules in cloudformation syntax provided in the awslabs repository. Now from an example ...
0 votes
1 answer
231 views

Switching to multi-part cloud-init, getting: SyntaxError: invalid syntax

I used to have user_data = data.template_file.user_data.rendered I changed that to, user_data = data.template_cloudinit_config.master.rendered And I added, data "template_cloudinit_config&...
0 votes
0 answers
6 views

Terraform or azure tries using wrong storage account type

I'm creating a new storage account, storage container, storage blob, service plan, and finally - function. Everything but the last one is created successfully, and the last step fails with a message: ...
1 vote
1 answer
113 views

Making AWS EFS Replication play nice with Terraform for disaster recovery

How do I use EFS block replication for disaster recovery when the replica volume is unknown to terraform? After breaking the replication/mirror I need to import the volume into the plan so it can ...
0 votes
0 answers
6 views

AWS EKS Fargate pod scheduling issue with Prometheus deployment

I'm encountering a problem with scheduling Prometheus pods on AWS EKS Fargate within my Kubernetes cluster. Here are the details of my setup: I have configured an AWS EKS Fargate profile named ...
0 votes
1 answer
204 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
0 answers
22 views

Register gitlab-runner through terraform after deploying the runner as a container

Context and code used Here is the code I produced to deploy any kind of container on Azure. (We are doing the same on AWS and facing the same kind of issues) resource "azurerm_container_group&...
0 votes
1 answer
3k views

Retrieving arn from another module

I'm trying to get the arn of the kms key for use in the S3 bucket kms_master_key_id, the code below is how I thought it might work. I can output the arn value to the root but am unsure how to access ...
0 votes
0 answers
7 views

Extract RDS address value using data external in terraform

I am using data external block to extract the address of RDS data "external" "rds_endpoint" { program = ["/bin/bash", "-c", "aws rds describe-db-...
0 votes
1 answer
223 views

Terraform wanting to redeploy azure vms for 'no' reason

I got a VM defined in terraform like this: resource "azurerm_linux_virtual_machine" "vm" { name = var.vm-name resource_group_name = var....
0 votes
0 answers
14 views

Terraform code in AWS deploys instance but not not running bash script

I have Terraform code in AWS deploying an instance but not not running bash script. Script runs updates, deploys apache, creates small page etc. I can connect to instance after it's deployed, but ...
0 votes
0 answers
13 views

AWS Certificate in ACM service does not get validated successfully

I use Terraform to deploy ACM in front of my CloudFront service: resource "aws_route53_zone" "primary" { name = var.domain_name comment = "Hosted Zone for ...
0 votes
0 answers
10 views

OIDC configuration for Terraform/GitLab CI in a multi-account context

I wrote some Terraform code. I logged in locally using AWS Identity Center so that I would not have to generate IAM access and secret keys (as per AWS's good practice recommendations). I'm going to ...
0 votes
1 answer
427 views

Is there a way to pass secrets in cloud-init using Terraform?

Cloud-init has the ability to compliment Terraform in configuring the Virtual Machine it just created. My problem is that cloud-init as uploaded through user-data means that the script especially if ...
11 votes
1 answer
3k views

Provisioning times for Redis in cloud taking too long, how can we shorten it?

Provisioning a 1 GB Redis cache service on AWS takes around 8 minutes. Doing the same on Azure takes around 16 minutes. Ours Terraform scripts need the call back from the Redis systems. Why is this ...
0 votes
1 answer
115 views

Unable to connect from my local system to ec2 instance created by terraform script

Following is the source code: variable "ec2_instance_type_name" { type = string default = "t2.nano" } terraform { required_providers { aws = { ...
1 vote
1 answer
2k views

Terraform plan does not update AWS Task Definition with last active revision value

I would like your help on a situation that I'm facing with terrafom. My company recently launched a new website whose wordpress is hosted in an AWS ECS container. I had to make some adjustments to the ...
2 votes
1 answer
397 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 ...
1 vote
2 answers
194 views

How should I organize a large number of unrelated Infrastructure as Code projects?

I work at a municipal government with many departments. Teams from these departments request new servers for specific uses/applications. Our environment is currently using VMware VSphere (~1500 VMs, 2 ...
0 votes
1 answer
538 views

How to enable ContainerInsights (setting) on an ECS cluster created from a Batch compute environment using Terraform?

I have an AWS Batch compute environment defined in my Terraform files. The creation of the compute environment creates an ECS Cluster, where the containers are being run. The issue I have with ...
0 votes
0 answers
11 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 &...
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). ...
2 votes
1 answer
30 views

How do I export my state from my stack while using Spacelift?

I am currently using Spacelift and on my stack, the state is managed by Spacelift. I am happy with this but I want to export the state to an Amazon S3 bucket, is there any way to do this?
1 vote
1 answer
48 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/...
1 vote
1 answer
21 views

Worker Pool in Spacelift showing as 0 workers

I created a private worker using https://github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2 However, my worker pool shows as 0 even though I can see the worker in my AWS Console. What ...
1 vote
1 answer
81 views

Spacelift - local run - is it possible

I am trying to run my Spacelift stack with my files from a local folder, but using all the context / env vars etc that are present in my Spacelift stack, is this possible?
1 vote
1 answer
74 views

Spacelift - external state access - cannot create a workspace error

I am trying to use Spacelift's external state access however I get the following error: Error: Error loading state error │ │ with module.service.data.terraform_remote_state.environment, │ on ../...
1 vote
1 answer
34 views

Why is my private worker crashing on Spacelift?

I am using a private worker on Spacelift but my run keeps failing with the error "worker crashed". This is only happening on one stack, any suggestions?
1 vote
1 answer
62 views

How can I attach multiple AWS accounts to my Spacelift stack?

How can I connect my Spacelift stack to deploy resources into my multiple AWS accounts? I have a current integration set up, and this works perfectly to deploy resources to my account but how can I ...
2 votes
1 answer
4k views

Does AWS CloudFront work with a Network Load Balancer?

I am aware that it is straightforward to use AWS CloudFront with an AWS Application Load Balancer (Layer 7) origin (using a certificate in each for E2E encryption). However, is it possible to use AWS ...
1 vote
1 answer
2k views

Terraform: Why is null_resource's remote-exec not connecting to aws_instance via SSH?

I've been going through answers to similar questions on this StackExchange and on StackOverflow and reading through documentations all day ... Here's the .tf file I'm executing: # defines the AWS ...
0 votes
2 answers
76 views

Is there a way to migrate from HCL with the Terraform provider to YAML?

Currently I have a deployment of an applicationn done with HCL in Terraform. Is it possible to have the terraform provider for Kubernetes output to a directory or in some form the YAML that it is ...
0 votes
1 answer
326 views

Key Vault managed stored account encryption permissions denied

Trying to amend an existing storage account to add Customer-Managed-Key Rotation to it, using key vault, as per the docs from Terraform and MS. Looks like we've done everything right, but we're just ...
0 votes
0 answers
13 views

How to enter \ character in terraform?

I have resource "aws_secretsmanager_secret" "mcasz2" { name = "mcasz/client/credentials" description = "mcasz 2.0 secretes for back-end" } resource "...
0 votes
1 answer
178 views

metrics-server on EKS - no metrics to server

I am attempting to setup metrics-server to server my 'horizon pod autoscaling' and manage my app pods scaling based on CPU. I am unable to get the metrics-server to run properly which fails with ...
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 ...
0 votes
1 answer
27 views

Terraform conditions : How to have a multiple values in case of False condition?

I need to have two urls in case if my environment is nonprod(sit,uat,dev) and my application is Techno, otherwise only one url. In order to do that, I have made every string into a list here, so that ...
0 votes
0 answers
30 views

How do I recover from Amazon ECS the private key of each node that generated the Terraform script?

I have used the following repository to create a private test Blockchain and it turns out that I don't know how to recover the private keys of the nodes. some help? Thanks GitHub: terraform aws ecs ...
1 vote
1 answer
1k 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 ...
0 votes
0 answers
44 views

How to mount secret as a file inside a specific non empty directory with Cloud Run second gen?

I have this rather simple Terraform configuration for first generation cloud run service resource "google_cloud_run_v2_service" "pricing" { project = var.project_id name = ...
3 votes
1 answer
986 views

"ipv6_cidr_block": all of `ipv6_cidr_block,ipv6_ipam_pool_id` must be specified

Usage: import Version: Terraform v1.1.9 provider registry.terraform.io/hashicorp/aws v4.11.0 I've something like this defined: assign_generated_ipv6_cidr_block = "true" cidr_block ...
0 votes
1 answer
31 views

How can I delete Terraform assets and statefiles created in a pipeline using the remote GitLab backend?

Currently I have a detached pipeline which uses the Terraform with the remote Gitlab backend. How can I after the pipeline has run delete BOTH the assets created and the statefile?
2 votes
0 answers
453 views

Terraform init too slow on installing hashicorp/aws

It takes a few minutes to install the following provider but installs modules and other providers quickly. There is an open issue on GitHub for this but no steps for troubleshooting. Installing ...
4 votes
3 answers
12k views

Skip terraform resource if it exists

I'm Getting an error creating a secret because it was created manually. Error: error creating Secrets Manager Secret: ResourceExistsException: The operation failed because the secret <SECRET> ...
0 votes
0 answers
50 views

EFS is getting unmounted from lambda when there is an update to efs

I have created EFS, and mounted this on lambda using terraform. It works, but when there is an update in EFS, then EFS gets unmounted. I need terraform to detect this update and automatically mount it ...
2 votes
1 answer
2k views

Is it possible to run a droplet on Digital Ocean without a public IP?

I am provisioning droplets on Digital Ocean with Terraform. I would like some of those droplets to be blocked from the internet, except for the Shared Private Network, and their appropriate gateway on ...
0 votes
0 answers
25 views

How to set database cluster arguments (like password) with terraform?

I deploy a digitalocean_database_cluster with Terraform. It's working and I can connect to it with the username and password that Terraform generates in .tfstate I want to set a concrete username, ...
3 votes
1 answer
3k 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
2 3 4 5
7