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

Fixes 'Error putting S3 policy' on terraform apply #33

Merged
merged 1 commit into from
Jun 6, 2021

Conversation

millionpoundhat
Copy link
Contributor

I have been getting the following errors when doing a terrform apply using the module : -

Error: Error putting S3 policy: OperationAborted: A conflicting conditional operation is currently in progress against this resource. Please try again.
	status code: 409, request id: 731DE7B56FE9B4FF, host id:

  on .terraform/modules/tf_remote_state/bucket.tf line 224, in resource "aws_s3_bucket_policy" "state_force_ssl":
 224: resource "aws_s3_bucket_policy" "state_force_ssl" {



Error: Error putting S3 policy: OperationAborted: A conflicting conditional operation is currently in progress against this resource. Please try again.
	status code: 409, request id: EE9BACB85562B1CD, host id: 

  on .terraform/modules/tf_remote_state/bucket.tf line 305, in resource "aws_s3_bucket_policy" "replica_force_ssl":
 305: resource "aws_s3_bucket_policy" "replica_force_ssl" {

I've added a depends_on to the force_ssl policy referencing the aws_s3_bucket_public_access_blockfor both replica and state, this fixes the issue and provides a clean apply each time as one will always happen after the other.

…ce_ssl block being applied at the same time as some other policy, adding a depends_on referencing the public access block ensures a clean apply each time
@nozaq
Copy link
Owner

nozaq commented Jun 6, 2021

@millionpoundhat Sorry for taking a while to respond. LGTM, thank you!

@nozaq nozaq merged commit 9210c32 into nozaq:master Jun 6, 2021
yyxi pushed a commit to escapace/terraform-aws-terraform-backend that referenced this pull request Oct 27, 2024
Co-authored-by: millionpoundhat <illya.sparkes-santos@rovco.com>

Fixes 'Error putting S3 policy' which appears to be caused by the force_ssl block being applied at the same time as some other policy, adding a depends_on referencing the public access block ensures a clean apply each time (nozaq#33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants