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

Applying bucket changes without some attributes doesn't reflect in state after terraform refresh #3432

Closed
Chhed13 opened this issue Feb 18, 2018 · 5 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@Chhed13
Copy link
Contributor

Chhed13 commented Feb 18, 2018

Related on #2296 (comment)

Confirming that changing ACLs also doesn't show up - had a bucket set to public today and my terraform with acl = "private" showed no changes required in the plan.

And #2296 (comment)

I'll prepare PR ASAP

@Chhed13 Chhed13 changed the title Applying bucket changes without ACL doesn't reflect in state after terraform refresh Applying bucket changes without some attributes doesn't reflect in state after terraform refresh Feb 18, 2018
@Chhed13
Copy link
Contributor Author

Chhed13 commented Feb 18, 2018

I checked an ACLs (canned ACLs that we use) - looks like it's not possible to read them. s3conn.GetBucketAcl() return ACLs without canned, but s3conn.PutBucketAcl() take it.

request_payer attribute works fine
versioning - fails to update when it becomes disabled (deleted form config) after enabled.

@Chhed13
Copy link
Contributor Author

Chhed13 commented Feb 19, 2018

checked lifecycle_rule - there is also an issue with refresh command if all rules were removed not by Terraform.

@Chhed13
Copy link
Contributor Author

Chhed13 commented Feb 20, 2018

Current reproduction on versioning:

  1. Apply
resource "aws_s3_bucket" "bucket" {
	bucket = "tf-test-bucket-%d"
	versioning {
	  enabled = true
	}
}

2a. Apply

resource "aws_s3_bucket" "bucket" {
	bucket = "tf-test-bucket-%d"
	versioning { }
}

Diff:

~ aws_s3_bucket.bucket
versioning.0.enabled: "true" => "false"

Looks good.
2b. Apply

resource "aws_s3_bucket" "bucket" {
	bucket = "tf-test-bucket-%d"
}

Diff:

empty

2c. Remove Computed: true from versioning attribute and apply

resource "aws_s3_bucket" "bucket" {
	bucket = "tf-test-bucket-%d"
}

Diff:

~ aws_s3_bucket.bucket
versioning.#: "1" => "0" <- should stay "1"
versioning.0.enabled: "true" => "false"

According to what AWS returns this section in state should always present:

 "versioning.#": "1",
 "versioning.0.enabled": "true/false",
 "versioning.0.mfa_delete": "false/true",

@bflad could you, please, help. What is the better way to force TF keep this section in sync?

@bflad bflad added bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service. labels Feb 21, 2018
@github-actions
Copy link

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!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Mar 27, 2020
@ghost
Copy link

ghost commented May 28, 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 May 28, 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. service/s3 Issues and PRs that pertain to the s3 service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants