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

aws_s3_bucket: Removing lifecycle_rule fails #8113

Closed
asicoe opened this issue Aug 10, 2016 · 2 comments · Fixed by #9031
Closed

aws_s3_bucket: Removing lifecycle_rule fails #8113

asicoe opened this issue Aug 10, 2016 · 2 comments · Fixed by #9031

Comments

@asicoe
Copy link

asicoe commented Aug 10, 2016

Hi,

Terraform POSTs the "" xml when a lifecycle policy is removed - this is wrong according to http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html which states that there are required xml tags/fields.

Terraform Version

terraform -v
Terraform v0.6.16

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

# Step 1: Initial config that got deployed successfully.
resource "aws_s3_bucket" "logs" {
    bucket = "bucket-xxx"
    acl    = "log-delivery-write"
    lifecycle_rule {
        id = "lcr-1"
        prefix = ""
        enabled = true
        transition {
            days = 30
            storage_class = "STANDARD_IA"
        }
        transition {
            days = 90
            storage_class = "GLACIER"
        }
        abort_incomplete_multipart_upload_days = 7
    }
}
# Step 2: Reverted the policy changes which fails the terraform deploy.
resource "aws_s3_bucket" "logs" {
    bucket = "bucket-xxx"
    acl    = "log-delivery-write"
}

Debug Output

https://gist.github.com/asicoe/034a1fc105bd958fa1a8eb07e6216440

Expected Behavior

Terraform should have had a successful run and change the S3 bucket configuration by removing the lifecycle policy.

Actual Behavior

Terraform failed the run and did not remove the lifecycle policy from the S3 bucket.

Steps to Reproduce

  1. terraform apply for the first terraform hcl above.
  2. terraform apply for the second terraform hcl above.
@radeksimko radeksimko changed the title aws_s3_bucket: Error putting S3 lifecycle: MalformedXML: The XML you provided was not well-formed or did not validate against our published schema aws_s3_bucket: Removing lifecycle_rule fails Aug 11, 2016
@karoldrazek
Copy link

Issue still persists in version v0.7.4

@ghost
Copy link

ghost commented Apr 22, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants