diff --git a/terraform/bootstrap/remote-state/main.tf b/terraform/bootstrap/remote-state/main.tf index 9072262..7cf1422 100644 --- a/terraform/bootstrap/remote-state/main.tf +++ b/terraform/bootstrap/remote-state/main.tf @@ -1,5 +1,6 @@ provider "aws" { region = "<% index .Params `region` %>" + allowed_account_ids = [ "<% index .Params `accountId` %>" ] } resource "aws_s3_bucket" "terraform_remote_state" { diff --git a/terraform/bootstrap/secrets/main.tf b/terraform/bootstrap/secrets/main.tf index bfaa619..7f9fc13 100644 --- a/terraform/bootstrap/secrets/main.tf +++ b/terraform/bootstrap/secrets/main.tf @@ -1,30 +1,32 @@ -provider "aws" { - region = "<% index .Params `region` %>" -} +provider "aws" { + region = "<% index .Params `region` %>" + allowed_account_ids = [ "<% index .Params `accountId` %>" ] +} + -terraform { - required_version = ">= 0.12" -} +terraform { + required_version = ">= 0.12" +} locals { project = "<% .Name %>" } -# Create the CI User -resource "aws_iam_user" "ci_user" { - name = "${local.project}-ci-user" -} +# Create the CI User +resource "aws_iam_user" "ci_user" { + name = "${local.project}-ci-user" +} -# Create a keypair to be used by CI systems -resource "aws_iam_access_key" "ci_user" { - user = aws_iam_user.ci_user.name -} +# Create a keypair to be used by CI systems +resource "aws_iam_access_key" "ci_user" { + user = aws_iam_user.ci_user.name +} -# Add the keys to AWS secrets manager -module "ci_user_keys" { - source = "../../modules/secret" +# Add the keys to AWS secrets manager +module "ci_user_keys" { + source = "../../modules/secret" - name_prefix = "ci-user-aws-keys" - type = "map" - values = map("access_key_id", aws_iam_access_key.ci_user.id, "secret_key", aws_iam_access_key.ci_user.secret) -} + name_prefix = "ci-user-aws-keys" + type = "map" + values = map("access_key_id", aws_iam_access_key.ci_user.id, "secret_key", aws_iam_access_key.ci_user.secret) +}