terraform/examples/aws-s3-cross-account-access
Michael H. Oshita 90d70786ac Align IAM version number to the current version (2012-10-17) 2015-11-13 00:32:45 +09:00
..
README.md aws: Add example w/ S3 & cross-account access 2015-08-19 10:15:43 +01:00
main.tf Align IAM version number to the current version (2012-10-17) 2015-11-13 00:32:45 +09:00
prod.txt aws: Add example w/ S3 & cross-account access 2015-08-19 10:15:43 +01:00
terraform.template.tfvars aws: Add example w/ S3 & cross-account access 2015-08-19 10:15:43 +01:00
test.txt aws: Add example w/ S3 & cross-account access 2015-08-19 10:15:43 +01:00
variables.tf aws: Add example w/ S3 & cross-account access 2015-08-19 10:15:43 +01:00

README.md

S3 bucket with cross-account access

This example describes how to create an S3 bucket in one AWS account and give access to that bucket to another user from another AWS account using bucket policy. It demonstrates capabilities of provider aliases.

See more in the S3 documentation.

How to run

Either cp terraform.template.tfvars terraform.tfvars and modify that new file accordingly or provide variables via CLI:

terraform apply \
	-var="prod_access_key=AAAAAAAAAAAAAAAAAAA" \
	-var="prod_secret_key=SuperSecretKeyForAccountA" \
	-var="test_account_id=123456789012" \
	-var="test_access_key=BBBBBBBBBBBBBBBBBBB" \
	-var="test_secret_key=SuperSecretKeyForAccountB" \
	-var="bucket_name=tf-bucket-in-prod" \