Skip to content

Commit ea7fc23

Browse files
Initial development of lambda authoriser
1 parent 2839323 commit ea7fc23

File tree

7 files changed

+1317
-18
lines changed

7 files changed

+1317
-18
lines changed

infrastructure/terraform/components/app/module_templates_api.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ module "templates_api" {
88
group = var.group
99
csi = local.csi
1010
log_retention_in_days = var.log_retention_in_days
11+
12+
cognito_config = jsondecode(aws_ssm_parameter.cognito_config.value)
1113
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "aws_ssm_parameter" "cognito_config" {
2+
3+
name = "/${local.csi}/cognito_config"
4+
description = "Configuration values for Cognito instance"
5+
type = "SecureString"
6+
value = data.aws_ssm_parameter.sftp_mock_config.value
7+
8+
lifecycle {
9+
ignore_changes = [
10+
value,
11+
]
12+
}
13+
}

infrastructure/terraform/modules/templates-api/module_authorizer_lambda.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ module "authorizer_lambda" {
99
handler = "index.handler"
1010

1111
log_retention_in_days = var.log_retention_in_days
12+
13+
environment_variables = var.cognito_config
1214
}
1315

1416
module "authorizer_build" {

infrastructure/terraform/modules/templates-api/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,11 @@ variable "log_retention_in_days" {
5252
description = "The retention period in days for the Cloudwatch Logs events to be retained, default of 0 is indefinite"
5353
default = 0
5454
}
55+
56+
variable "cognito_config" {
57+
type = object({
58+
user_pool_id: string,
59+
user_pool_client_id: string
60+
})
61+
description = "Cognito config"
62+
}

0 commit comments

Comments
 (0)