-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GCS backend for remote .tfstate storage
- Fixed terraform render in kite generate
- Loading branch information
1 parent
abd05f2
commit 5b22ddb
Showing
5 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Setup Terraform backend to be able to store .tfstate remotely | ||
terraform { | ||
backend "gcs" { | ||
bucket = "<%= @values['gcp']['tfstate_bucket_name'] %>" | ||
path = "terraform.tfstate" | ||
project = "<%= @values['gcp']['project'] %>" | ||
} | ||
} | ||
|
||
# Create GCS bucket to store .tfstate in | ||
resource "google_storage_bucket" "tfstate-bucket" { | ||
name = "<%= @values['gcp']['tfstate_bucket_name'] %>" | ||
location = "<%= @values['gcp']['region'] %>" | ||
} | ||
|
||
# Store .tfstate in a GCS bucket | ||
data "terraform_remote_state" "tfstate" { | ||
backend = "gcs" | ||
config { | ||
bucket = "<%= @values['gcp']['tfstate_bucket_name'] %>" | ||
path = "terraform.tfstate" | ||
project = "<%= @values['gcp']['project'] %>" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters