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

Add support for message_storage_policy to customize locations #15

Conversation

paulpalamarchuk
Copy link
Contributor

@paulpalamarchuk paulpalamarchuk force-pushed the add_message_storage_policy branch 2 times, most recently from 1d50929 to 624acb2 Compare October 23, 2019 13:20
@paulpalamarchuk paulpalamarchuk changed the title Add message_storage_policy variable Add message_storage_policy block Oct 23, 2019
@paulpalamarchuk paulpalamarchuk force-pushed the add_message_storage_policy branch 5 times, most recently from aac733d to dfbb060 Compare October 25, 2019 11:56
@paulpalamarchuk paulpalamarchuk requested review from nick4fake and removed request for nick4fake October 25, 2019 12:03
nick4fake
nick4fake previously approved these changes Oct 28, 2019
@paulpalamarchuk paulpalamarchuk marked this pull request as ready for review October 28, 2019 13:02
@aaron-lane aaron-lane added the enhancement New feature or request label Oct 28, 2019
@aaron-lane aaron-lane self-assigned this Oct 28, 2019
Copy link
Contributor

@aaron-lane aaron-lane left a comment

Choose a reason for hiding this comment

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

Thanks @paulpalamarchuk!

Can you please provide evidence that this change solves the permanent diff?

README.md Outdated
@@ -73,6 +74,7 @@ In order to execute this module you must have a Service Account with the followi
#### Roles

- `roles/pubsub.editor`
- `roles/dataproc.viewer` or simular, that allows `compute.regions.list`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `roles/dataproc.viewer` or simular, that allows `compute.regions.list`
- `roles/dataproc.viewer` or similar, that allows `compute.regions.list`

main.tf Outdated
allowed_persistence_regions = var.allowed_persistence_regions == null ? data.google_compute_regions.available.names : var.allowed_persistence_regions
}

data "google_compute_regions" "available" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd really like to avoid adding this requirement if we don't absolutely need to.

Instead of doing this, I'd like to update this PR so the message_storage_policy block is only configured if regions are provided.

@@ -22,6 +22,13 @@ resource "google_pubsub_topic" "topic" {
project = var.project_id
name = var.topic
labels = var.topic_labels

dynamic "message_storage_policy" {
for_each = var.message_storage_policy
Copy link
Contributor

Choose a reason for hiding this comment

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

for_each should be of a list, not a map. The way this is structured is very weird.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to use such structure, because for_each accepts a map or a set

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it works, but it's non-intuitive.

@morgante morgante merged commit 72a59a2 into terraform-google-modules:master Oct 31, 2019
@morgante morgante changed the title Add message_storage_policy block Add support for message_storage_policy to customize locations Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support of message_storage_policy to the topic
4 participants