File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
infrastructure/terraform/components/dl Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 55 apim_api_key_ssm_parameter_name = " /${ var . component } /${ var . environment } /apim/api_key"
66 apim_private_key_ssm_parameter_name = " /${ var . component } /${ var . environment } /apim/private_key"
77 apim_keystore_s3_bucket = " nhs-${ var . aws_account_id } -${ var . region } -${ var . environment } -${ var . component } -static-assets"
8+ ssm_mesh_prefix = " /${ var . component } /${ var . environment } /mesh"
89 root_domain_name = " ${ var . environment } .${ local . acct . route53_zone_names [" digital-letters" ]} "
910 root_domain_id = local. acct . route53_zone_ids [" digital-letters" ]
1011 ttl_shard_count = 3
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ module "mesh_poll" {
3838 log_subscription_role_arn = local. acct . log_subscription_role_arn
3939
4040 lambda_env_vars = {
41- SSM_PREFIX = " /dl/ ${ var . environment } /mesh "
41+ SSM_PREFIX = " ${ local . ssm_mesh_prefix } "
4242 MAXIMUM_RUNTIME_MILLISECONDS = " 240000" # 4 minutes (Lambda has 5 min timeout)
4343 ENVIRONMENT = var.environment
4444 EVENT_PUBLISHER_EVENT_BUS_ARN = aws_cloudwatch_event_bus.main.arn
@@ -134,4 +134,17 @@ data "aws_iam_policy_document" "mesh_poll_lambda" {
134134 module . sqs_event_publisher_errors . sqs_queue_arn ,
135135 ]
136136 }
137+
138+ statement {
139+ sid = " SSMPermissions"
140+ effect = " Allow"
141+
142+ actions = [
143+ " ssm:GetParametersByPath" ,
144+ ]
145+
146+ resources = [
147+ " arn:aws:ssm:${ var . region } :${ var . aws_account_id } :parameter/${ local . ssm_mesh_prefix } /*"
148+ ]
149+ }
137150}
You can’t perform that action at this time.
0 commit comments