Skip to content

Commit 5773ff4

Browse files
[PRMP-1580] Removed implicit dependencies, extended Lambda timeout
1 parent b829849 commit 5773ff4

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

infrastructure/lambda-nhs-oauth-token-generator.tf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module "nhs-oauth-token-generator-lambda" {
22
source = "./modules/lambda"
33
name = "NhsOauthTokenGeneratorLambda"
44
handler = "handlers.nhs_oauth_token_generator_handler.lambda_handler"
5-
lambda_timeout = 60
5+
lambda_timeout = 120
66
iam_role_policy_documents = [
77
aws_iam_policy.ssm_access_policy.policy,
88
module.ndr-app-config.app_config_policy
@@ -26,7 +26,6 @@ module "nhs-oauth-token-generator-alarm" {
2626
namespace = "AWS/Lambda"
2727
alarm_actions = [module.nhs-oauth-token-generator-alarm-topic.arn]
2828
ok_actions = [module.nhs-oauth-token-generator-alarm-topic.arn]
29-
depends_on = [module.nhs-oauth-token-generator-lambda, module.nhs-oauth-token-generator-alarm-topic]
3029
}
3130

3231
module "nhs-oauth-token-generator-alarm-topic" {
@@ -56,6 +55,4 @@ module "nhs-oauth-token-generator-alarm-topic" {
5655
}
5756
]
5857
})
59-
60-
depends_on = [module.nhs-oauth-token-generator-lambda, module.sns_encryption_key]
6158
}

infrastructure/schedules.tf

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,16 @@ resource "aws_cloudwatch_event_rule" "nhs_oauth_token_generator_schedule" {
172172
schedule_expression = "rate(9 minutes)"
173173
}
174174

175-
resource "aws_cloudwatch_event_target" "nhs_oauth_token_generator_schedule_event" {
175+
resource "aws_cloudwatch_event_target" "nhs_oauth_token_generator_schedule" {
176176
rule = aws_cloudwatch_event_rule.nhs_oauth_token_generator_schedule.name
177177
target_id = "nhs_oauth_token_generator_schedule"
178-
179178
arn = module.nhs-oauth-token-generator-lambda.lambda_arn
180-
depends_on = [
181-
module.nhs-oauth-token-generator-lambda,
182-
aws_cloudwatch_event_rule.nhs_oauth_token_generator_schedule
183-
]
184179
}
185180

186-
resource "aws_lambda_permission" "nhs_oauth_token_generator_schedule_permission" {
181+
resource "aws_lambda_permission" "nhs_oauth_token_generator_schedule" {
187182
statement_id = "AllowExecutionFromCloudWatch"
188183
action = "lambda:InvokeFunction"
189184
function_name = module.nhs-oauth-token-generator-lambda.function_name
190185
principal = "events.amazonaws.com"
191186
source_arn = aws_cloudwatch_event_rule.nhs_oauth_token_generator_schedule.arn
192-
depends_on = [
193-
module.nhs-oauth-token-generator-lambda,
194-
aws_cloudwatch_event_rule.nhs_oauth_token_generator_schedule
195-
]
196187
}

0 commit comments

Comments
 (0)