-
Notifications
You must be signed in to change notification settings - Fork 126
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
Add support for message_storage_policy to customize locations #15
Conversation
1d50929
to
624acb2
Compare
aac733d
to
dfbb060
Compare
dfbb060
to
2dd66fc
Compare
2dd66fc
to
6089d4e
Compare
There was a problem hiding this 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?
9334cfd
to
baa66c2
Compare
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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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" { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
baa66c2
to
6826570
Compare
6826570
to
9fd7b46
Compare
message_storage_policy
to the topic #14