File tree Expand file tree Collapse file tree 5 files changed +25
-4
lines changed
Expand file tree Collapse file tree 5 files changed +25
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ data "aws_lambda_function" "rds_lambda_connector" {
3232}
3333
3434data "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
3838data "aws_secretsmanager_secret" "target_rds_credentials" {
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 2323 " resource-groups:*" ,
2424 " dynamodb:*" ,
2525 " rds:*" ,
26+ " athena:*" ,
2627 " dms:*" ,
2728 " glue:*"
2829 ],
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" ,
You can’t perform that action at this time.
0 commit comments