Skip to content
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

S3 lifecycle_rule transition with days = 0 has MalformedXML #952

Closed
devonbleak opened this issue Jun 23, 2017 · 1 comment · Fixed by #957
Closed

S3 lifecycle_rule transition with days = 0 has MalformedXML #952

devonbleak opened this issue Jun 23, 2017 · 1 comment · Fixed by #957
Labels
bug Addresses a defect in current functionality.

Comments

@devonbleak
Copy link
Contributor

Terraform Version

$ terraform -v
Terraform v0.9.8

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

resource "aws_s3_bucket" "bucket" {
  bucket = "bucket"
  acl    = "private"

  lifecycle_rule {
    id      = "zero-day-glacier"
    prefix  = ""
    enabled = true

    transition {
      days          = 0
      storage_class = "GLACIER"
    }
  }
}

Debug Output

https://gist.github.com/devonbleak/ae05399e61db6c9e94bc2b7eb3a37bce

Expected Behavior

Lifecycle policy applied to bucket with transition to glacier after 0 days.

Actual Behavior

Error putting S3 lifecycle: MalformedXML: The XML you provided was not well-formed or did not validate against our published schema
status code: 400, request id: EXAMPLE, host id: EXAMPLE

Steps to Reproduce

  1. terraform apply

Looking at the XML, the required element is missing entirely. As this is an optional parameter (have to specify either days or date) my hunch is that the 0 is evaluating to false so the element isn't being sent. Also tried setting days = "0" as a string with the same result. This may actually be more of a core issue with needing a way to represent a literal 0 that's different from boolean false.

kjmkznr added a commit to kjmkznr/terraform-provider-aws that referenced this issue Jun 23, 2017
Transition's days can use non-negative integer value.

Fixes: hashicorp#952
@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Jun 25, 2017
@ghost
Copy link

ghost commented Apr 12, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants