-
-
Notifications
You must be signed in to change notification settings - Fork 839
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
dynamically create website inputs with the new provider and its colli… #142
dynamically create website inputs with the new provider and its colli… #142
Conversation
We don't have a test for this yet. If that could be added to the completr test then that would ensure this functionality works correctly going forward |
redirect_all_requests_to = string | ||
routing_rules = string | ||
})) | ||
type = map(any) | ||
default = null |
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.
could we keep the variable type the same for backwards compatibility?
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.
Sure, but as linked 'redirect_all_requests_to' is mutually exclusive with the other 3 options.. So, you are either setting 'redirect_all_requests_to' or 'index_document', 'error_document' and 'routing_rules'. Not sure how to handle that? I saw there is an experimental 'optional' feature but that is subject to change.
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.
Hi, I would really appreciate some feedback to this, not sure how to handle it.
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.
the workaround has been to set unused options to null but maybe your way is the correct way forward, provided backwards compatibility is maintained
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.
Since this never worked in v2.0, I'm OK with having a breaking change here. Unfortunately, the "optional" feature is not usable (changes to it have been announced).
Let's make this 2 inputs.
website_redirect_all_requests_to
which is alist(object)
withhost_name
andprotocol
and a validation oflength <= 2
and default[]
website_configuration
which islist(object)
with the remaining configuration, including a list ofrouting_rule
objects, and a validation oflength <= 2
and default[]
What do you think @jurgen-weber-deltatre and @nitrocode ?
ok, never used that tool but I Can have a look tomorrow. |
the tests are built into the module and many tests are built into the examples/complete module and verified via test/src directory. If both can be expanded to include website inputs, then we can verify the changes coming in from this PR |
/test test/bats |
/test test/readme |
/test test/terratest |
This Pull Request has been updated, so we're dismissing all reviews.
@@ -90,24 +90,36 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "default" { | |||
} | |||
|
|||
resource "aws_s3_bucket_website_configuration" "default" { | |||
for_each = local.enabled && var.website_inputs != null ? toset(var.website_inputs) : toset([]) | |||
for_each = local.enabled && var.website_inputs != null ? var.website_inputs : {} |
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.
This cannot and should not be for_each
, because you can only have one configuration per bucket
redirect_all_requests_to = string | ||
routing_rules = string | ||
})) | ||
type = map(any) | ||
default = null |
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.
Since this never worked in v2.0, I'm OK with having a breaking change here. Unfortunately, the "optional" feature is not usable (changes to it have been announced).
Let's make this 2 inputs.
website_redirect_all_requests_to
which is alist(object)
withhost_name
andprotocol
and a validation oflength <= 2
and default[]
website_configuration
which islist(object)
with the remaining configuration, including a list ofrouting_rule
objects, and a validation oflength <= 2
and default[]
What do you think @jurgen-weber-deltatre and @nitrocode ?
@jurgen-weber-deltatre After implementing Please also add |
This Pull Request has been updated, so we're dismissing all reviews.
…ding options
what
why
references