Closed AnonymousWP closed 3 months ago
Hmmm, after all it doesn't seem to be needed. Solution is to use a custom variable, like so:
variables.tf
:
variable "lifecycle_configuration_rules_redacted1" {
type = list(any)
description = "Lifecycle configuration for redacted1"
}
variable "lifecycle_configuration_rules_redacted" {
type = list(any)
description = "Lifecycle configuration for redacted"
}
And then within the module block use
lifecycle_configuration_rules = var.lifecycle_configuration_rules_redacted
. However, VSC still complains that it's not expected there, yet it does work for some reason. Perhaps a VSC Terraform extension bug or something related to the module/provider/deps/whatever.
Describe the Feature
I'd like the module to support multiple locals. For example, a solution like this would be sufficient:
locals.tf
where you define your lifecyclelocals.tf
:redacted1_backup.tf
:redacted_backup.tf
:Expected Behavior
I expect the module to support multiple locals in any form.
Use Case
Currently, the module doesn't support having multiple locals. For example, I have one stack for S3 with buckets. Each bucket can require different configuration rules, so I defined two locals (for two different buckets). But because the module expects something like
lifecycle_configuration_rules
, it complains that there are duplicate local names:Describe Ideal Solution
The above (see "Describe the Feature"), where I can define multiple locals in a file, then call them in the files where I am using the module.
Alternatives Considered
Different solution would be to fork this repo and support it, but preferably not. Another one is to use separate resources. I guess another alternative is to continue using the deprecated input
lifecycle_rules
, but that's far from ideal, as its configuration is longer (it expects you to explicitly define whether transition etc. is enabled or not).Additional Context
No response