You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Error: Duplicate local value definition
│
│ on s3-redacted1-backup.tf line 26, in locals:
│ 26: lifecycle_configuration_rules = local.s3_redacted1_backup_rules
│
│ A local value named "lifecycle_configuration_rules" was already defined at s3-redacted-backup.tf:27,3-63. Local value names must be unique within a module.
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: