Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support Terraform remote state when generating GCP resources #39

Merged
merged 8 commits into from Jun 2, 2021

Conversation

adlersantos
Copy link
Member

@adlersantos adlersantos commented May 26, 2021

Description

Based on #33. We need to optionally support Terraform remote state configuration via a backend.tf file that's auto-generated. It contains the following:

terraform {
  backend "gcs" {
    bucket = "REMOTE_STATE_BUCKET"
    prefix = "REMOTE_STATE_PREFIX"
  }
}

This allows users to store a file on GCS representing a record of the GCP resources that Terraform keeps track of for their pipelines.

It's now possible to do this via the --tf-state-bucket and --tf-state-prefix arguments for scripts/generate_terraform.py.

Because backend states differ per user per environment, we only create the backend.tf file in the env folder specified, e.g. .dev/datasets/ml_datasets/_terraform/backend.tf. That is, we don't check in Terraform remote state files in the repo to keep it optional for everyone.

Checklist

  • Tests pass.
  • Linters pass.
  • Please merge this PR for me once it is approved.
  • If this PR adds/edits/deletes a feature, I have updated the README accordingly.

@adlersantos adlersantos added feature request New feature or request revision: readme Improvements or additions to the README labels May 26, 2021
@adlersantos adlersantos merged commit 9e01936 into main Jun 2, 2021
@adlersantos adlersantos deleted the tf-remote-state branch June 2, 2021 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request revision: readme Improvements or additions to the README
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants