Questions tagged [terraform]

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

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

Terraform to update existing lifecycle policy and create new ecr with policy attached

Terraform to update existing lifecycle policy and create new ecr repo with policy attached. I am trying to import existing ecr using local vars and update those vars in csv files to maintain ecr ...
Kalim Sayyed's user avatar
0 votes
0 answers
8 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 &...
DavJ's user avatar
  • 1
1 vote
1 answer
17 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 ...
Danielle Murphy's user avatar
1 vote
1 answer
42 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 ...
Danielle Murphy's user avatar
0 votes
0 answers
12 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 "...
Vy Do's user avatar
  • 155
0 votes
1 answer
88 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 ...
Don Draper's user avatar
2 votes
1 answer
23 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?
Danielle Murphy's user avatar
1 vote
1 answer
23 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/...
Danielle Murphy's user avatar
0 votes
0 answers
29 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 ...
Iv7dev's user avatar
  • 1
1 vote
1 answer
31 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?
Danielle Murphy's user avatar
1 vote
1 answer
20 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?
Danielle Murphy's user avatar
0 votes
0 answers
19 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 = ...
piotrekkr's user avatar
  • 101
0 votes
1 answer
23 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 ...
Devang Sanghani's user avatar
1 vote
1 answer
41 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 ../...
Danielle Murphy's user avatar
1 vote
1 answer
89 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 ...
Peter Kahn's user avatar
0 votes
1 answer
23 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?
Evan Carroll's user avatar
  • 1,950
0 votes
0 answers
24 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, ...
Pau Trepat's user avatar
0 votes
1 answer
262 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 ...
Stuart.Sklinar's user avatar
1 vote
2 answers
320 views

How To Convert Jenkins String Parameter To Terraform Map Variable? (Invalid number literal)

Edit (8/16/2023): I figured it out! I'm trying to pass string parameter(s) to a Terraform map variable, but receiving error "Invalid number literal". Jenkinsfile: pipeline { agent any ...
Mark Matlock's user avatar
0 votes
1 answer
237 views

terraform remote state bucket on s3

I want to use a remote state bucket on s3 for my terraform tfstate files (described here: https://developer.hashicorp.com/terraform/language/settings/backends/s3). It looks pretty basic, but in ...
Nstevens's user avatar
  • 103
0 votes
1 answer
51 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 ...
George Udosen's user avatar
0 votes
0 answers
33 views

Error creating GCP notebook: Error waiting for Creating Instance: Error code 12, message: GCE unexpected error: RPC::UNREACHABLE: EOF

I'm trying to create a managed notebook for Google Cloud Vertex AI, and the application of the terraform template fails with: Plan: 1 to add, 0 to change, 0 to destroy. google_notebooks_instance....
JamesMatson's user avatar
0 votes
1 answer
131 views

& (ampersand) in Terraform string or/and AWS IAM policy

I coudn't find meaning of & sign in Terraform or/and AWS IAM policy. There is an example in Data Source: aws_iam_policy_document (docs) where you can see Basic Example (docs, github source): data &...
sobi3ch's user avatar
  • 123
1 vote
1 answer
78 views

Is terraform good option for data management

I have complex stack which consists of infrastructure, application and config parts, which are deployed to datacenters around the world. We have custom inhouse configuration system, based on database ...
Shadow's user avatar
  • 111
0 votes
0 answers
385 views

Import to non-existent module error from Terraform

I have this module in my code and I am trying to import the existing APIM to state. module apim { source = "source" environment = var.environment prefix ...
Bigfrog-coding's user avatar
0 votes
0 answers
66 views

SSH Keys not propagating correctly from instance metadata to authorized_keys: missing keys, user discrepancy, and duplicate key

I want to add eight public keys via instance metadata to avoid adding them manually (i.e.: ssh to VMs, pasting the keys to .ssh/authorized_keys, etc.). I added the keys in Terraform (four distinct ...
SkogensKonung's user avatar
0 votes
0 answers
42 views

Inject configuration from Terraform into Kubernetes without hardcoding

I have a pretty simple setup: An AWS DocumentDB managed using Terraform A container running on EKS, managed in a Flux (GitOps) repository The container needs to access the DocumentDB, so somehow I ...
ggradnig's user avatar
  • 113
3 votes
3 answers
469 views

Should I use multiple Terraform projects or only one?

I am starting to build a Terraform GIT project to build resources for azure. Currently my idea is to have a project that is taking care of identity and access topics & to have a project that is ...
Marvin Kern's user avatar
0 votes
1 answer
200 views

Configure Azure Terraform provider to only allow SSH access to my current IP address

After following this quick start guide https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-terraform, running lastb on the provisioned host shows login attempts from many IP ...
davejagoda's user avatar
1 vote
0 answers
193 views

Terraform GCP "API has not been used in project" for the wrong project

I'm trying to create a google_kms_key_ring in project b89d. When I run terraform apply, I can see the google_kms_key_ring project field is set to the project I want: + resource "...
Brad's user avatar
  • 181
0 votes
2 answers
71 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 ...
Evan Carroll's user avatar
  • 1,950
0 votes
0 answers
49 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 ...
Vinay Chiruvella's user avatar
0 votes
1 answer
815 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 ...
Don Draper's user avatar
0 votes
0 answers
282 views

How to edit a GitLab managed Terraform state file?

I seem to have encountered a long-standing Terraform issue, where I have attempted to create an AWS RDS Cluster without having specified skip_final_snapshot = true, however any attempt to extricate ...
David Buck's user avatar
0 votes
0 answers
52 views

How to retrieve required values from a kubeconfig file from AKS and give as values in a terraform script?

I'm trying to automate the creation of infrastructure - azurerm_container_registry, azurerm_kubernetes_cluster, azurerm_role_assignment (to pull the image from ACR) using one terraform script and in ...
prashanth_apolloyon's user avatar
0 votes
0 answers
372 views

Error When Importing to a for_each Resource

I'm trying to import multiple AWS IAM policies and IAM roles to my tfstate files using a shell script to automate the import mechanism. It works fine when I was trying to import the IAM roles, but ...
Rephael Charis's user avatar
0 votes
0 answers
84 views

Is there a way to automate service principal connections for ACR and AKS (in azure portal) from Azure Devops ? or can we acheive this with a pipeline?

Here, I'm trying to create ACR and AKS (in azure portal) with terraform tasks in azure devops pipeline and right after creating these resources I'm trying to add "deploy into AKS" task in ...
user39842's user avatar
2 votes
0 answers
412 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 ...
pdna's user avatar
  • 121
2 votes
2 answers
2k views

Terraform kubernetes_manifest: forbidden: User "system:anonymous" cannot get path "/apis"

Getting the following error with Terraform forbidden: User "system:anonymous" cannot get path "/apis" In context, │ Error: Invalid configuration for API client │ │ with acme....
Evan Carroll's user avatar
  • 1,950
2 votes
1 answer
380 views

Terraform error: Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module

Is there anyway to find out what triggers a message like this, Provider "registry.terraform.io/hashicorp/google" requires explicit configuration. Add a provider block to the root module and ...
Evan Carroll's user avatar
  • 1,950
1 vote
0 answers
54 views

How can I point Cloud Run to my latest container image when its path changes based on version?

I am trying to model continuous deployment infrastructure in Terraform. The problem I have is Cloud Run requires a path to the container image, and that image's path changes based on its 'version'. ...
Check12's user avatar
  • 111
0 votes
0 answers
21 views

How do I provide my app with a service account key to access a GCP bucket?

I'm experimenting with terraform and GCP at the moment. For now I want to run a ruby project locally that have access to a bucket. For that I supposedly need a service account and a key. terraform ...
x-yuri's user avatar
  • 143
0 votes
2 answers
864 views

Can terraform re-create a vm that was manually deleted

I have a terraform managed infrastructure with a set of 4 virtually identical VMs. One of them has been deleted in VSphere by mistake. I had expected terraform refresh to re-create it, but I ...
Elros's user avatar
  • 103
1 vote
0 answers
459 views

Triggering local-exec provisioner on resource change

We're needing to run a 3rd party python script to do some testing/validation on RDS resources provisioned by terraform. We use Terraform Enterprise where the runtime environment is simplistic and ...
shalomb's user avatar
  • 111
0 votes
1 answer
611 views

Terraform's OpenStack provider: Error: One of 'auth_url` or 'cloud` must be specified

When I run terraform apply (but not terraform validate) I get the following error, Error: Invalid provider configuration Provider "registry.terraform.io/terraform-provider-openstack/openstack&...
Evan Carroll's user avatar
  • 1,950
1 vote
2 answers
2k views

How can I read a file if it exists, but if it doesn't do not throw a fatal error?

Terraform give us the ability to a read a local file, which has a secret.. data "local_sensitive_file" "foo" { filename = "/tmp/foo" } But, what is the right way to ...
Evan Carroll's user avatar
  • 1,950
3 votes
2 answers
6k views

How do I find out the attributes of a terraform object?

I'm creating a Terraform file, and something is obviously wrong, Error: Incorrect condition type on ssh.tf line 47, in locals: 47: is_generated = data.local_sensitive_file.public_key ? true : ...
Evan Carroll's user avatar
  • 1,950
0 votes
1 answer
354 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 ...
Evan Carroll's user avatar
  • 1,950
0 votes
1 answer
22 views

Does OpenStack meta data carry the remote-exec provisioner stanza?

I have a Terraform HCL file with a remote-exec provisioner that looks like this.. resource "openstack_compute_instance_v2" "sandboxvm" { provisioner "remote-exec" { ...
Evan Carroll's user avatar
  • 1,950
4 votes
1 answer
5k views

Getting "(sensitive value)" from `terraform state show`, how can I uncensor the value?

When I run I try to use terraform state show on variables flagged sensitive on some addresses I get private_data = (sensitive value) How can I get around this problem?
Evan Carroll's user avatar
  • 1,950

1
2 3 4 5
7