Questions tagged [tfstate]
11 questions
8
votes
4 answers
Local state cannot be unlocked by another process on terraform
My terraform remote states and lockers are configured on s3 and dynamodb under aws account, On gitlab runner some plan task has been crashed and on the next execution plan the following error pops up:
Error: Error locking state: Error acquiring the…

avivamg
- 12,197
- 3
- 67
- 61
2
votes
3 answers
Possibility to re-generate tfstate file
I just recently started learning Terraform and created a terraform file (main.tf) to generate AWS Glue catalog database and some Glue catalog tables added to it. I ran the needed commands (terraform init, terraform plan, terraform apply) and…

Perez
- 101
- 1
- 1
- 9
1
vote
1 answer
How to reference resources in the default value of a Terraform variable?
I have an output from subnets and vpc id from the networking terraform implementation on my AWS. The tfstate is stored in the s3 example/networking/terraform.tfstate.
public_subnets = [
"subnet-0c1ed9933fxxxxxf",
"subnet-0ee61aaa65xxxx3",
…

user5820327
- 181
- 1
- 2
- 15
0
votes
1 answer
Terraform replacement of resources prob due to index_key changes
I'm creating Cloudflare's records with Terraform using a module I created from the resource's documentation- https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/record.
I created a key value variable in which the key…

korenlios
- 11
- 2
0
votes
1 answer
How can I run a shell script from my git repository using Azure CLI to create Terraform resources on Azure?
How execute a shell script which is in my git repository through azure cli to create resources on Azure like remote storage account for Terraform state files and an Azure AD group for AKS admins
I tried to perform git clone in azure cli and then run…
0
votes
1 answer
Share AWS resources between Terraform and CDK
My team has two completely different environments: a Terraform one (which allow us to create and manage some AWS resources as databases) and a CDK one, with contains API resources and its logics as well.
We would like to use databases resources…

Gigs
- 199
- 1
- 12
0
votes
0 answers
Is it possible to get the terraform state file from the remote backend and set it for modifications
I need to get the terraform state file from the backend GCS and to use it while I update the resource is it possible to overwrite the excising terraform state file and fetch it on need.
this is my main.tf
provider "google" {
project =…

meerashine
- 1
- 1
0
votes
2 answers
Is there a way to run terraform apply for a specific tfstate file?
Is there a way to run terraform apply for a specific tfstate file?
By default it takes terraform.tfstate but I need to rename it as I am managing multiple state files in azure.
Folder structure:

Ghost rider
- 43
- 1
- 9
0
votes
1 answer
Terraform command is not using the values from the tfvars file provide with --var-file
I am pretty new in Terraform, trying to create separate backend for each AWS Region under each environment (dev, stg, prod) of my application. So, I am using separate .config files to configure separate backend, and separate .tfvars files to create…

Rafiq
- 1,380
- 4
- 16
- 31
0
votes
0 answers
terraform upgrade by creating a state file from scratch for an existing code and infrastructure
I have a terraform repo and infrastructure and its state in s3. But its 0.11 version of terraform and all the modules used in the code were never upgraded. Now it has become a useless piece of code and a bottleneck.
Here is my plan:
Create a new…

Prasanna P
- 114
- 4
-1
votes
1 answer
Issue Storing tfstate File in Azure Storage Account using cdktf and TypeScript
I'm using cdktf with TypeScript to manage my Infrastructure as Code (IaC), and I'm trying to store my tfstate file in an Azure Storage Account. However, I'm encountering the following error during this process:
Initializing the backend...
src ╷
…

ZunX
- 1
- 3