Skip to content

Commit eacdfa0

Browse files
authored
chore: FDOS-614 Merge remote-tracking branch main (#848)
1 parent 3e901cc commit eacdfa0

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

infrastructure/stacks/account_wide/kms.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@ module "secrets_manager_encryption_key" {
4545
"kms:DescribeKey"
4646
]
4747
Resource = "*"
48+
},
49+
{
50+
Sid = "AllowAthenaConnectorSecretsAccess"
51+
Effect = "Allow"
52+
Principal = {
53+
AWS = "*"
54+
}
55+
Action = [
56+
"kms:Decrypt",
57+
"kms:DescribeKey"
58+
]
59+
Resource = "*"
60+
Condition = {
61+
ArnLike = {
62+
"aws:PrincipalArn" = [
63+
"arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/serverlessrepo-${local.project_prefix}-*"
64+
]
65+
}
66+
}
4867
}
4968
]
5069
}

infrastructure/stacks/athena/athena.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ resource "aws_serverlessapplicationrepository_cloudformation_stack" "rds_connect
7979

8080
parameters = {
8181
SpillBucket = module.athena_spill_bucket[0].s3_bucket_id
82-
DefaultConnectionString = "postgres://jdbc:postgresql://${local.rds_secret.host}:${local.rds_secret.port}/${local.rds_secret.dbname}"
83-
SecretNamePrefix = "/${var.project}/${var.environment}/target-rds"
82+
DefaultConnectionString = "postgres://jdbc:postgresql://${local.rds_secret.host}:${local.rds_secret.port}/${local.rds_secret.dbname}?$${${data.aws_secretsmanager_secret.target_rds_credentials[0].name}}"
83+
SecretNamePrefix = "/${var.project}/${var.environment}/${var.target_rds_credentials}"
8484
LambdaFunctionName = "${local.resource_prefix}-rds-connector"
8585
SecurityGroupIds = aws_security_group.rds_connector_sg[0].id
8686
SubnetIds = join(",", data.aws_subnets.private_subnets.ids)

infrastructure/stacks/athena/data.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data "aws_lambda_function" "rds_lambda_connector" {
3232
}
3333

3434
data "aws_security_group" "dms_replication_security_group" {
35-
name = "${local.project_prefix}-account-wide-etl-replication-sg"
35+
name = "${local.project_prefix}-data-migration-rds-sg"
3636
}
3737

3838
data "aws_secretsmanager_secret" "target_rds_credentials" {

infrastructure/stacks/athena/iam.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ resource "aws_iam_role_policy" "athena_dynamodb_policy" {
7878
"dynamodb:Scan",
7979
"dynamodb:PartiQLSelect"
8080
],
81-
Resource = "arn:aws:dynamodb:${var.aws_region}:${data.aws_caller_identity.current.account_id}:table/${local.account_prefix}-*"
81+
Resource = "arn:aws:dynamodb:${var.aws_region}:${data.aws_caller_identity.current.account_id}:table/*"
8282
},
8383
# checkov:skip=CKV_AWS_355: Justification: S3 DynamoDB list tables
8484
# checkov:skip=CKV_AWS_290: Justification: S3 DynamoDB list tables

infrastructure/stacks/github_runner/app_github_runner_policy.json.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"resource-groups:*",
2424
"dynamodb:*",
2525
"rds:*",
26+
"athena:*",
2627
"dms:*",
2728
"glue:*"
2829
],
@@ -139,6 +140,7 @@
139140
"Resource": [
140141
"arn:aws:iam::*:role/${repo_name}-*",
141142
"arn:aws:iam::*:role/${project}-*",
143+
"arn:aws:iam::*:role/serverlessrepo-${project}-*",
142144
"arn:aws:iam::*:policy/${project}-*",
143145
"arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess",
144146
"arn:aws:iam::*:role/aws-service-role/shield.amazonaws.com/AWSServiceRoleForAWSShield",

0 commit comments

Comments
 (0)