Skip to content

Commit

Permalink
[PRMP-1123] Add environment variables and IAM permissions to ecs task
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadIqbalAD-NHS committed Nov 8, 2024
1 parent 1d1e5b0 commit 9525620
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions infrastructure/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,34 @@ module "ndr-ecs-fargate-ods-update" {
{
"name" : "PDS_FHIR_IS_STUBBED",
"value" : tostring(local.is_sandbox)
},
{
"name" : "LLOYD_GEORGE_BUCKET_NAME",
"value" : "${terraform.workspace}-${var.lloyd_george_bucket_name}"
},
{
"name" : "LLOYD_GEORGE_DYNAMODB_NAME",
"value" : "${terraform.workspace}_${var.lloyd_george_dynamodb_table_name}"
},
{
"name" : "DOCUMENT_STORE_BUCKET_NAME",
"value" : "${terraform.workspace}-${var.docstore_bucket_name}"
},
{
"name" : "DOCUMENT_STORE_DYNAMODB_NAME",
"value" : "${terraform.workspace}_${var.docstore_dynamodb_table_name}"
},
{
"name" : "STATISTICAL_REPORTS_BUCKET",
"value" : "${terraform.workspace}-${var.statistical_reports_bucket_name}"
},
{
"name" : "STATISTICS_TABLE",
"value" : "${terraform.workspace}_${var.statistics_dynamodb_table_name}"
},
{
"name" : "WORKSPACE",
"value" : terraform.workspace
}
]
ecs_container_definition_memory = 512
Expand All @@ -74,6 +102,13 @@ resource "aws_iam_role" "ods_weekly_update_task_role" {
managed_policy_arns = [
module.lloyd_george_reference_dynamodb_table.dynamodb_policy,
aws_iam_policy.ssm_access_policy.arn,
module.statistics_dynamodb_table.dynamodb_policy,
module.statistical-reports-store.s3_object_access_policy,
module.ndr-app-config.app_config_policy_arn,
module.ndr-lloyd-george-store.s3_list_object_policy,
module.ndr-document-store.s3_list_object_policy,
module.document_reference_dynamodb_table.dynamodb_policy,
aws_iam_policy.cloudwatch_log_query_policy.arn
]
assume_role_policy = jsonencode(
{
Expand Down

0 comments on commit 9525620

Please sign in to comment.