Questions tagged [terraform-remote-state]

24 questions
8
votes
3 answers

Cannot convert Terraform remote state in S3 backend to local state with `terraform init -reconfigure`

I'm using Terraform v1.0.0 and created a remote backend using AWS S3 and AWS DynamoDB as explained in Terraform Up & Running by Yevgeniy Brikman: I wrote the code for the S3 bucket and the DynamoDB table and created the resources via terraform…
oschlueter
  • 2,596
  • 1
  • 23
  • 46
8
votes
2 answers

Terraform settings - remote state s3 - InvalidParameter validation error

Environment Terraform v0.12.24 + provider.aws v2.61.0 Running in an alpine container. Background I have a basic terraform script running ok, but now I'm extending it and am trying to configure a remote (S3) state. terraform.tf: terraform { backend…
Software Engineer
  • 15,457
  • 7
  • 74
  • 102
6
votes
1 answer

How can I make the Docker provider in Terraform wait for an address to become available before attempting to connect to it?

I have the following resource in Terraform: provider "docker" { host = "tcp://${digitalocean_droplet.docker_server.ipv4_address}:2376/" } This relies on the value ipv4_address to be known before it can connect to the docker machine. This value…
user377628
6
votes
2 answers

Use variable in Terraform remote backend

# Using a single workspace: terraform { backend "remote" { hostname = "app.terraform.io" organization = "company" workspaces { name = "my-app-prod" } } } For Terraform remote backend, would there be a way to use variable…
woodykiddy
  • 6,074
  • 16
  • 59
  • 100
4
votes
1 answer

Use Terraform state output from another project

I recently upgraded Terraform from 11.11 to 12.24, and after running the 0.12upgrade, accessing the remote terraform_state output no longer works. The error I get is : This object does not have an attribute named "subnet_id" This is my config: Repo…
Carbonman
  • 61
  • 1
  • 3
2
votes
2 answers

Terragrunt with modules of terraform using local state instead of s3 remote state

I am using terragrunt to create an environment using the approach of storing the remote state into my local path. remote_state { backend = "local" config = { path= "../..//mypath/terraform.tfstate" } } but because terragrunt downloads…
2
votes
1 answer

CDK/Cloudformation shared state

Pretty new to CDK/Cloudformation, just moving from Terraform, and was wondering if CDK/Cloudformation have something similar to Terraform's remote state? Or some other way that different team members could work on updating the same AWS resources…
Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136
2
votes
3 answers

Terraform_Remote_State Error: This object has no argument, nested block, or exported attribute named "vpc_id"

Working with Terraform (TF) in AWS and am stuck with an error when trying to call the vpc_id using terraform_remote_state. We segmented out the different pieces of the network in order to mitigate state slippage. However, it also requires…
2
votes
1 answer

terraform remote backend using postgres

i am planning to use remote backend as postgres instead of s3 as enterprise standard. terraform { backend "pg" { conn_str = "postgres://user:pass@db.example.com/schema_name" } } When we use postgres remote backend, when we run terraform init,…
SASI
  • 475
  • 2
  • 7
  • 16
2
votes
1 answer

Import terraform workspaces from S3 remote state

I am using terraform to deploy to multiple AWS accounts and each account with its own set of environments. I'm using terraform workspaces and s3 remote state. When I switch between these accounts my terraform workspace list is empty now for one of…
1
vote
1 answer

Github Actions with OIDC roles to deploy the resource (terraform) while accessing to the remote state file in a different AWS account S3 bucket

I'm almost a newbie with AWS/Terraform/Github Action and I need your helps .. We have two AWS accounts, A is for storing the remote tfstate file in S3 bucket B is for deploying the resources I need to deploy the resources (written in Terraform)…
1
vote
1 answer

Securing storage account with remote tfstate

How to disable public access to Azure storage account but still accessible from cloudshell. What I have and works: Az-storage account that contains "terraform.tfstate" with public access main.tf file in my "Azure Cloudshell" with "backend" config…
1
vote
1 answer

Terraform cloud run triggers with Azure

I'm having issue with accessing my data "terrafrom_remote_state" objects.. So I'm following the hashicorp site to deploy azure resource with terraform cloud with run triggers. The trigger is working , running the plan for the second workspace, but…
1
vote
2 answers

Terraform Remote State - state file location

I'm using Terraform with AWS and S3/Dynamo for the remote state of all our modules. This works fine and is great. But where are you going to save your state file for the module, where you create the S3 bucket and the DynamoDB (for the remote…
Sven
  • 13
  • 3
1
vote
1 answer

Store terraform remote state file dynamic location in S3

Basically, I have multiple running environments so when I try to upload the hard-code key address of terraform .tfstate state file it works perfectly but I wanna store my .tfstate file based on an environment variable or based on condition so I can…
1
2