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

Cyclic dependency error when creating buckets with two way replication #14295

Closed
chetandeshmukh opened this issue May 8, 2017 · 2 comments
Closed

Comments

@chetandeshmukh
Copy link

chetandeshmukh commented May 8, 2017

provider "aws" {
    alias   = "east"
    region  = "${var.aws_region_east}"
    profile = "${var.profile}"
}

provider "aws" {
    alias   = "west"
    region  = "${var.aws_region_west}"
    profile = "${var.profile}"
}

resource "aws_s3_bucket" "bucket_west" {
    provider = "aws.west"
    bucket   = "${var.bucket_west}"
    region   = "${var.aws_region_west}"
    acl      = "private"

    versioning {
    enabled = true
    }
    replication_configuration {
        role = "${data.aws_iam_role.cove_iam_role.arn}"
        rules {
            id     = "bucket_west"
            prefix = ""
            status = "Enabled"

            destination {
            bucket        = "${aws_s3_bucket.bucket_east.arn}"
            storage_class = "STANDARD"
            }
        }
    }
}

resource "aws_s3_bucket" "bucket_east" {
    provider = "aws.east"
    bucket   = "${var.bucket_east}"
    region   = "${var.aws_region_east}"
    acl      = "private"

    versioning {
    enabled = true
    }

    replication_configuration {
    role = "${data.aws_iam_role.cove_iam_role.arn}"
        rules {
            id     = "bucket_east"
            prefix = ""
            status = "Enabled"

            destination {
                bucket        = "${aws_s3_bucket.bucket_west.arn}"
                storage_class = "STANDARD"
            }
        }
    }
}
@chadbean
Copy link

chadbean commented May 20, 2017

I have the need for this as well. I can confirm that it's supported in AWS via console or CLI. Would it require creating the buckets without the replication options in the aws_s3_bucket resource, and then having Terraform update the buckets after-the-fact in order to set the replication configuration? Is this a pattern that is used for other resources in Terraform?

@ghost
Copy link

ghost commented Apr 9, 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 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants