-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
aws_s3_bucket: lifecycle_rule and count does not work #1402
Comments
At this point in time, |
Hi folks 👋 This issue is resolved in Terraform 0.12, which supports new functionality in the configuration language aimed at solving this issue. The new Given this configuration: terraform {
required_providers {
aws = "2.20.0"
}
required_version = "0.12.5"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "test" {
bucket = "tf-dynamic-test-1402"
dynamic "lifecycle_rule" {
# The for_each argument is a hardcoded list in this illustrative example,
# however it can be sourced from a variable or local value as well as
# support multiple argument values as a map.
for_each = ["a", "b", "c"]
content {
enabled = true
id = lifecycle_rule.value
prefix = "${lifecycle_rule.value}/"
expiration {
days = 10
}
}
}
} Produces the following apply output:
Enjoy! 🚀 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/joscha/a18add0d7b1b0fad265e96ded20bf927
Panic Output
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the
crash.log
.Expected Behavior
An S3 bucked with three
lifecycle_rule
parts ofa
,b
,c
should have been planned.Actual Behavior
Steps to Reproduce
terraform plan
References
Potentially hashicorp/terraform#3116, however it is not about the S3 bucket resource.
The text was updated successfully, but these errors were encountered: