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

Update GCS backend docs for TF >=0.12 #32065

Merged
merged 5 commits into from Oct 28, 2022
Merged

Conversation

lnesteroff
Copy link
Contributor

@lnesteroff lnesteroff commented Oct 24, 2022

Updated GCS remote backend to include the >=0.12 remote backend data source formatting (incl .output before output name). The current documentation is not valid if it is run with TF >= 0.12

Fixes #

Target Release

1.4.0

Draft CHANGELOG entry

ENHANCEMENTS

backend/gcs:  Update documentation for usage of `gcs` with `terraform_remote_state` [GH-32065]

Updated GCS remote backend to include the >=0.12 remote backend data source formatting (incl .output before output name)
removed old data source example
@crw
Copy link
Collaborator

crw commented Oct 26, 2022

Thanks for this submission!

Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lnesteroff 👋 thanks for this update

This section of the docs is pretty old (6 years!) so there's a bunch of things that can be improved here. I went to go read up about the template provider used for this example config and I found that it has been deprecated and isn't recommended for use in newer versions of Terraform. Because of this, I'm thinking we should change the example to use a different resource so we don't encourage people to use it.

Would you be happy to update your PR with a new example resource that uses data from data.terraform_remote_state.foo? A simple example I thought of was the local_file resource (see example below) but you could pick a different resource if you'd like

resource "local_file" "foo" {
  content  = data.terraform_remote_state.foo.outputs.greeting
  filename = "${path.module}/outputs.txt"
}

The above is more of a nit than a required change- please feel free to not do if you don't have time. The only thing I think requires changes is updating output to outputs.

Cheers! - Sarah

@lnesteroff
Copy link
Contributor Author

Good catch, updated both your suggestions

removed "outputs" from the pre 0.12 ref
Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll get this merged now

@SarahFrench SarahFrench merged commit 5957d26 into hashicorp:main Oct 28, 2022
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

jbardin pushed a commit that referenced this pull request Nov 2, 2022
* Update gcs.mdx

Updated GCS remote backend to include the >=0.12 remote backend data source formatting (incl .output before output name)

* Update gcs.mdx

removed old data source example

* Update gcs.mdx

updated to local_file and output->outputs

* Update gcs.mdx

removed "outputs" from the pre 0.12 ref
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants