Skip to content

Commit 2d3497e

Browse files
committed
[NDR-50] add indexes
1 parent 6e7b638 commit 2d3497e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

infrastructure/iam.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ resource "aws_iam_policy" "s3_document_data_policy_for_get_doc_ref_lambda" {
132132
}
133133

134134
data "aws_iam_policy_document" "assume_role_policy_for_get_doc_ref_lambda" {
135+
count = local.is_production ? 0 : 1
135136
statement {
136137
actions = ["sts:AssumeRole"]
137138

138139
principals {
139140
type = "AWS"
140-
identifiers = [module.get-doc-fhir-lambda.lambda_execution_role_arn]
141+
identifiers = [module.get-doc-fhir-lambda[0].lambda_execution_role_arn]
141142
}
142143
}
143144
}
@@ -147,8 +148,9 @@ moved {
147148
}
148149

149150
resource "aws_iam_role" "get_fhir_doc_presign_url_role" {
151+
count = local.is_production ? 0 : 1
150152
name = "${terraform.workspace}_get_fhir_doc_presign_url_role"
151-
assume_role_policy = data.aws_iam_policy_document.assume_role_policy_for_get_doc_ref_lambda.json
153+
assume_role_policy = data.aws_iam_policy_document.assume_role_policy_for_get_doc_ref_lambda[0].json
152154
}
153155

154156
moved {
@@ -157,7 +159,8 @@ moved {
157159
}
158160

159161
resource "aws_iam_role_policy_attachment" "get_doc_presign_url" {
160-
role = aws_iam_role.get_fhir_doc_presign_url_role.name
162+
count = local.is_production ? 0 : 1
163+
role = aws_iam_role.get_fhir_doc_presign_url_role[0].name
161164
policy_arn = aws_iam_policy.s3_document_data_policy_for_get_doc_ref_lambda.arn
162165
}
163166

infrastructure/lambda-get-document-fhir.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module "get-doc-fhir-lambda" {
4343
APPCONFIG_CONFIGURATION = module.ndr-app-config.app_config_configuration_profile_id
4444
WORKSPACE = terraform.workspace
4545
ENVIRONMENT = var.environment
46-
PRESIGNED_ASSUME_ROLE = aws_iam_role.get_fhir_doc_presign_url_role.arn
46+
PRESIGNED_ASSUME_ROLE = aws_iam_role.get_fhir_doc_presign_url_role[0].arn
4747
LLOYD_GEORGE_DYNAMODB_NAME = "${terraform.workspace}_${var.lloyd_george_dynamodb_table_name}"
4848
OIDC_CALLBACK_URL = contains(["prod"], terraform.workspace) ? "https://${var.domain}/auth-callback" : "https://${terraform.workspace}.${var.domain}/auth-callback"
4949
CLOUDFRONT_URL = module.cloudfront-distribution-lg.cloudfront_url

0 commit comments

Comments
 (0)