Skip to content

Commit

Permalink
Updates s3-cross-account-access
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Jul 23, 2020
1 parent ed95f0d commit 579dc73
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions examples/s3-cross-account-access/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
terraform {
required_version = ">= 0.12"
}

provider "aws" {
alias = "prod"

region = "us-east-1"
access_key = "${var.prod_access_key}"
secret_key = "${var.prod_secret_key}"
access_key = var.prod_access_key
secret_key = var.prod_secret_key
}

resource "aws_s3_bucket" "prod" {
provider = "aws.prod"
provider = aws.prod

bucket = "${var.bucket_name}"
bucket = var.bucket_name
acl = "private"

policy = <<POLICY
Expand All @@ -31,9 +35,9 @@ POLICY
}

resource "aws_s3_bucket_object" "prod" {
provider = "aws.prod"
provider = aws.prod

bucket = "${aws_s3_bucket.prod.id}"
bucket = aws_s3_bucket.prod.id
key = "object-uploaded-via-prod-creds"
source = "${path.module}/prod.txt"
}
Expand All @@ -42,14 +46,14 @@ provider "aws" {
alias = "test"

region = "us-east-1"
access_key = "${var.test_access_key}"
secret_key = "${var.test_secret_key}"
access_key = var.test_access_key
secret_key = var.test_secret_key
}

resource "aws_s3_bucket_object" "test" {
provider = "aws.test"
provider = aws.test

bucket = "${aws_s3_bucket.prod.id}"
bucket = aws_s3_bucket.prod.id
key = "object-uploaded-via-test-creds"
source = "${path.module}/test.txt"
}

0 comments on commit 579dc73

Please sign in to comment.