Skip to content

Commit

Permalink
refactor: import state bucket via tf import block
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 committed Sep 18, 2024
1 parent 6b28644 commit 60f1aac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions examples/gcp/bin/prep-inception.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ EOF
sleep 5

terraform init
terraform state show module.inception.google_storage_bucket.tf_state || \
terraform import module.inception.google_storage_bucket.tf_state ${tf_state_bucket_name}
terraform state show module.inception.google_storage_bucket.tf_state

terraform state show module.inception.google_project_iam_custom_role.inception_destroy || \
terraform apply \
Expand Down
4 changes: 4 additions & 0 deletions modules/inception/gcp/import.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {
id = var.tf_state_bucket_name
to = google_storage_bucket.tf_state
}

0 comments on commit 60f1aac

Please sign in to comment.