From 15b2e4e1f41764d9786e6ac84099ff7346052158 Mon Sep 17 00:00:00 2001 From: Sophie Waldman <62553142+sjwmoveon@users.noreply.github.com> Date: Tue, 23 Jun 2020 12:52:54 -0400 Subject: [PATCH] Allow for multiple instances of loader_lambda_role This change allows for multiple copies of the sync to run on a single account (e.g. for a main and test database). The loader lambda role references specific DynamoDB resources, so unlike the other two lambda roles created in iam.tf, you can't just reuse the existing role for a new instance of the sync. Allowing for multiple instances by switching to name_prefix makes it possible to sync to separate Redshift databases in separate regions (though still only one sync can run per AWS region). --- iam.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iam.tf b/iam.tf index 87b5f18..5bb33ca 100644 --- a/iam.tf +++ b/iam.tf @@ -64,7 +64,7 @@ resource "aws_iam_role_policy_attachment" "gateway_cloudwatch_logging" { } resource "aws_iam_role" "loader_lambda_role" { - name = "LoaderLambdaRole" + name_prefix = "LoaderLambdaRole" description = "Used by the controlshift-redshift-loader Lambda for processing db replication data from ControlShift into Redshift" assume_role_policy = data.aws_iam_policy_document.lambda_assume_role.json }