dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.3k stars 659 forks source link

Terraform plan is destroying the resources #485

Closed skadem07 closed 5 years ago

skadem07 commented 5 years ago

I'm working on dynamodb , Tried to do an import of all my tables.

terraforming ddb --tfstate > terraform.tfstate terraform plan ( showed zero changes) and then did terraform state push terraform.tfstate (i had a backend file s3 bucket configured) When I ran terraform init, terraform plan command says its deleting all the resources .

my backend.tf

terraform {
  required_version = "0.11.13"

  backend "s3" {
    bucket         = "nonprod"
    key            = "tfstate/terraforming/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
  }
}

provider.tf

provider "aws" {
  region  = "us-east-1"
  version = "~> 2.22"
}

terraform plan

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_dynamodb_table.dev-vault: Refreshing state... (ID: dev-vault)

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  - destroy

Terraform will perform the following actions:

  - aws_dynamodb_table.dev-vault

can someone please help me with this? is it a issue or i'm doing it wrongly?