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 provider: aws_s3_bucket resource; lifecycle_rule silently overwrites tags #618

Closed
hashibot opened this issue Jun 13, 2017 · 5 comments
Closed
Labels
bug Addresses a defect in current functionality.

Comments

@hashibot
Copy link

This issue was originally opened by @bdashrad as hashicorp/terraform#12830. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform will overwrite lifecycle_rules on aws_s3_bucket resources that nearly match rules with tags, but without the filter applied.

S3 bucket lifecycle rules (and the s3 api: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) now support rules based on tags. If you add a rule with tags to an existing bucket, or import a bucket with a rule with tags, terraform will remove the tags from the rule without notifying you of changes that will happen (in a plan) or that did happen (in an apply).

Terraform Version

terraform v0.8.8

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

resource "aws_s3_bucket" "s3_maxwell-forms" {
  provider = "aws"
  bucket   = "files"

  versioning {
    enabled = true
  }

  lifecycle_rule {
    id      = "remove_zips"
    enabled = true
    prefix  = ""

    expiration {
      days = 16
    }
  }
}

Expected Behavior

Terraform should show changes that will happen to lifecycle rules.

Actual Behavior

Terraform overwrote them without showing changes.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. import an existing bucket with a lifecycle rule that uses tags terraform import aws_s3_bucket.my_bucket files
  2. Write the terraform above, which closely matches the lifecycle rule that already exists, with the exception of the tag filter.
  3. Run terraform plan|: you will see no changes to the lifecycle rules in the output.
  4. Run terraform apply: you will see no changes to the lifecycle rules in the output.
  5. Check the S3 console. Your lifecycle rule with tags has been replaced with a standard rule with no filters.
@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@bdashrad
Copy link

hashicorp/terraform#13680 would fix this.

@bdashrad
Copy link

New PR for fixing this: #899

@bdashrad
Copy link

This has been fixed since version 0.1.2 / #899.

@Ninir
Copy link
Contributor

Ninir commented Nov 10, 2017

Thanks for the ping @bdashrad !

@Ninir Ninir closed this as completed Nov 10, 2017
@ghost
Copy link

ghost commented Apr 10, 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 10, 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

No branches or pull requests

3 participants