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 bucket replication cycle error #7467

Closed
ghost opened this issue Feb 7, 2019 · 3 comments
Closed

S3 bucket replication cycle error #7467

ghost opened this issue Feb 7, 2019 · 3 comments
Labels
service/s3 Issues and PRs that pertain to the s3 service.

Comments

@ghost
Copy link

ghost commented Feb 7, 2019

This issue was originally opened by @jerryhxu as hashicorp/terraform#20253. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform version v0.11.7

I am trying to implement S3 bucket cross-region bidirectional replication. I have one bucket in us-east-1, second bucket in us-west-2. I am trying to figure out a way to configure S3 bucket replication_configuration to point to each other. Here is the sample Terraform code:

resource "aws_s3_bucket" "east_bucket" {
  bucket        = "s3-east"
  acl           = "private"
  region        = "us-east-1"
  force_destroy = true

  versioning {
    enabled = true
  }

  replication_configuration {
		role = "${var.replicate_bucket_role_arn}"
		rules {
			prefix = ""
			status = "Enabled"
			destination {
				bucket        = "${aws_s3_bucket.west_bucket.arn}"
				storage_class = "STANDARD"
			}
		}
	}
}

resource "aws_s3_bucket" "west_bucket" {
  provider      = "aws.secondary_region"
  bucket        = "s3-west"
  region        = "${var.secondary_region}"
  acl           = "private"
  force_destroy = true
  
  versioning {
    enabled = true
  }

  replication_configuration {
		role = "${var.replicate_bucket_role_arn}"

		rules {
			prefix = ""
			status = "Enabled"
			destination {
				bucket        = "${aws_s3_bucket.east_bucket.arn}"
				storage_class = "STANDARD"
			}
		}
	}
}

Debug Output

Cycle: aws_s3_bucket.east_bucket, aws_s3_bucket.west_bucket

Additional Context

If my Terraform code is wrong, can someone suggest a solution? I can do bi-directional replication on AWS console, but would like to automate that in Terraform code.

Thank you very much!

@ewbankkit
Copy link
Contributor

Related:

@nywilken nywilken added the service/s3 Issues and PRs that pertain to the s3 service. label Feb 8, 2019
@bflad
Copy link
Contributor

bflad commented Feb 8, 2019

@ewbankkit thanks so much for the references!

@jerryhxu thanks for submitting this and hopefully we can point you in the right direction. I would suggest checking out/asking in/following #749 otherwise while we may be able to help with some simple problems in the GitHub repository here, it's generally suggested to use one of the community forums where there are far more people ready to help; the GitHub issues here are generally monitored only by our few maintainers and a small subset of community members who are generally only working on Terraform provider bugs or enhancements.

Since this issue appears to relate to some previously existing enhancement and proposal issues, I'm going to opt to close this in preference of consolidating any discussions and efforts to the existing ones. 👍

@bflad bflad closed this as completed Feb 8, 2019
@ghost
Copy link
Author

ghost commented Apr 1, 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 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

3 participants