Created
March 12, 2023 21:50
-
-
Save aveek22/5505b47a4886fe9cf06f5e8d39821f58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locals { | |
| bucket_name = "tf-multi-account-test-1234-${terraform.workspace}" | |
| } | |
| module "s3_bucket_dev" { | |
| source = "./modules/s3" | |
| count = terraform.workspace == "dev" ? 1 : 0 | |
| providers = { | |
| aws = aws.dev | |
| } | |
| bucket_name = local.bucket_name | |
| } | |
| module "s3_bucket_prod" { | |
| source = "./modules/s3" | |
| count = terraform.workspace == "prod" ? 1 : 0 | |
| providers = { | |
| aws = aws.prod | |
| } | |
| bucket_name = local.bucket_name | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment