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

fix: Use subscription names as the keys instead of numeric indexes #67

Merged

Conversation

askoriy
Copy link
Contributor

@askoriy askoriy commented Apr 6, 2021

This PR fixes #66 and fixes #26.

As it has breaking changes, renaming google_pubsub_subscription resources in the state file is necessary for preventing destroy/recreate subscriptions:

terraform state mv 'google_pubsub_subscription.pull_subscriptions[0]' 'google_pubsub_subscription.pull_subscriptions["subscription1-name"]'
terraform state mv 'google_pubsub_subscription.pull_subscriptions[1]' 'google_pubsub_subscription.pull_subscriptions["subscription2-name"]'

@comment-bot-dev
Copy link

comment-bot-dev commented Apr 6, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

@askoriy
Copy link
Contributor Author

askoriy commented Apr 6, 2021

resolves #26 too

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Please also add an upgrade guide (example).

main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
@askoriy askoriy requested a review from morgante April 6, 2021 20:32
docs/upgrading_to_v2.0.md Outdated Show resolved Hide resolved
@morgante morgante merged commit b07ab12 into terraform-google-modules:master Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing one subscription affect recreating anothers with data loss. Use for_each for subscriptions
3 participants