-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
r/s3_bucket_lifecycle_configuration: providing filter "and" clause with only "prefix" causes MalformedXML error #23882
Comments
Hi @Nuru , thank you for raising this issue and apologies you've come across some confusing behavior. One thing to note is that to use the
This occurs because we include a terraform-provider-aws/internal/service/s3/flex.go Lines 262 to 289 in a0cf29f
where the relevant portion is: if v, ok := m["prefix"].(string); ok {
result.Prefix = aws.String(v)
} I'll have a look at #23883 and #23884 as I would of expected |
Given #23884, I suggest a workaround of always including |
I have the same issue, with AWS provider 4.38.0.
The Terraform code
Also I tried
Same issue with the |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
Can we please get this fixed already? |
This issue is affecting us aswell. |
With the combination of this issue, #23883, and #23884 I have no way to fully use and maintain S3 lifecycle configuration rules.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v1.1.6
on darwin_amd64
Affected Resource(s)
Terraform Configuration Files
Debug Output
Here is the relevant PUT content and response (most headers removed):
Expected Behavior
S3 bucket with lifecycle configuration should be created without error.
Actual Behavior
Steps to Reproduce
terraform init -upgrade
terraform apply -auto-approve
Important Factoids
The
filter
takes an optionaland
configuration block which takes any of 4 optional arguments:It appears to work if you supply only one of any of the arguments except for
prefix
. If you only specifyprefix
, you get theMalformedXML
error. This is inconsistent, unnecessarily complex, and adds further confusion after the deprecation ofprefix
at other levels of the resources. Based on the comments on #23299 I though it would be safest to always put theprefix
in theand
block but even that doesn't work.If I try to work around this issue by changing from
filter { and {
tofilter { prefx =
then I trigger #23884 and #23883. So this is a blocker.References
prefix
#23325The text was updated successfully, but these errors were encountered: