This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree 7 files changed +15
-32
lines changed
7 files changed +15
-32
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ No modules.
34
34
| [ aws_lambda_function.webhook] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function ) | resource |
35
35
| [ aws_lambda_permission.webhook] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission ) | resource |
36
36
| [ null_resource.github_app_parameters] ( https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource ) | resource |
37
- | [ null_resource.ssm_parameter_runner_matcher_config] ( https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource ) | resource |
38
37
| [ aws_iam_policy_document.lambda_assume_role_policy] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
39
38
| [ aws_iam_policy_document.lambda_xray] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
40
39
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ resource "aws_lambda_function" "webhook" {
28
28
REPOSITORY_ALLOW_LIST = jsonencode (var. config . repository_white_list )
29
29
SQS_WORKFLOW_JOB_QUEUE = try (var. config . sqs_workflow_job_queue . id , null )
30
30
PARAMETER_RUNNER_MATCHER_CONFIG_PATH = var.config.ssm_parameter_runner_matcher_config.name
31
+ PARAMETER_RUNNER_MATCHER_VERSION = var.config.ssm_parameter_runner_matcher_config.version # enforce cold start after Changes in SSM parameter
31
32
} : k => v if v != null
32
33
}
33
34
}
@@ -50,7 +51,7 @@ resource "aws_lambda_function" "webhook" {
50
51
}
51
52
52
53
lifecycle {
53
- replace_triggered_by = [null_resource. ssm_parameter_runner_matcher_config , null_resource . github_app_parameters ]
54
+ replace_triggered_by = [null_resource. github_app_parameters ]
54
55
}
55
56
}
56
57
@@ -68,7 +69,7 @@ resource "aws_lambda_permission" "webhook" {
68
69
principal = " apigateway.amazonaws.com"
69
70
source_arn = var. config . api_gw_source_arn
70
71
lifecycle {
71
- replace_triggered_by = [null_resource. ssm_parameter_runner_matcher_config , null_resource . github_app_parameters ]
72
+ replace_triggered_by = [null_resource. github_app_parameters ]
72
73
}
73
74
}
74
75
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ No modules.
25
25
| [ aws_cloudwatch_event_archive.main] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_archive ) | resource |
26
26
| [ aws_cloudwatch_event_bus.main] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_bus ) | resource |
27
27
| [ aws_cloudwatch_event_rule.workflow_job] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule ) | resource |
28
- | [ aws_cloudwatch_event_target.github_welcome ] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target ) | resource |
28
+ | [ aws_cloudwatch_event_target.dispatcher ] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target ) | resource |
29
29
| [ aws_cloudwatch_log_group.dispatcher] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group ) | resource |
30
30
| [ aws_cloudwatch_log_group.webhook] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group ) | resource |
31
31
| [ aws_iam_role.dispatcher_lambda] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role ) | resource |
@@ -48,7 +48,6 @@ No modules.
48
48
| [ aws_lambda_permission.allow_cloudwatch_to_call_lambda] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission ) | resource |
49
49
| [ aws_lambda_permission.webhook] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission ) | resource |
50
50
| [ null_resource.github_app_parameters] ( https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource ) | resource |
51
- | [ null_resource.ssm_parameter_runner_matcher_config] ( https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource ) | resource |
52
51
| [ aws_iam_policy_document.lambda_assume_role_policy] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
53
52
| [ aws_iam_policy_document.lambda_xray] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document ) | data source |
54
53
Original file line number Diff line number Diff line change @@ -12,14 +12,12 @@ resource "aws_cloudwatch_event_rule" "workflow_job" {
12
12
EOF
13
13
}
14
14
15
-
16
- resource "aws_cloudwatch_event_target" "github_welcome" {
15
+ resource "aws_cloudwatch_event_target" "dispatcher" {
17
16
arn = aws_lambda_function. dispatcher . arn
18
17
rule = aws_cloudwatch_event_rule. workflow_job . name
19
18
event_bus_name = aws_cloudwatch_event_bus. main . name
20
19
}
21
20
22
-
23
21
resource "aws_lambda_function" "dispatcher" {
24
22
s3_bucket = var. config . lambda_s3_bucket != null ? var. config . lambda_s3_bucket : null
25
23
s3_key = var. config . lambda_s3_key != null ? var. config . lambda_s3_key : null
@@ -45,6 +43,7 @@ resource "aws_lambda_function" "dispatcher" {
45
43
POWERTOOLS_TRACER_CAPTURE_ERROR = var.config.tracing_config.capture_error
46
44
# Parameters required for lambda configuration
47
45
PARAMETER_RUNNER_MATCHER_CONFIG_PATH = var.config.ssm_parameter_runner_matcher_config.name
46
+ PARAMETER_RUNNER_MATCHER_VERSION = var.config.ssm_parameter_runner_matcher_config.version # enforce cold start after Changes in SSM parameter
48
47
REPOSITORY_ALLOW_LIST = jsonencode (var. config . repository_white_list )
49
48
SQS_WORKFLOW_JOB_QUEUE = try (var. config . sqs_workflow_job_queue . id , null )
50
49
} : k => v if v != null
@@ -67,10 +66,6 @@ resource "aws_lambda_function" "dispatcher" {
67
66
mode = var. config . tracing_config . mode
68
67
}
69
68
}
70
-
71
- lifecycle {
72
- replace_triggered_by = [null_resource. ssm_parameter_runner_matcher_config , null_resource. github_app_parameters ]
73
- }
74
69
}
75
70
76
71
resource "aws_cloudwatch_log_group" "dispatcher" {
Original file line number Diff line number Diff line change @@ -13,9 +13,3 @@ resource "aws_cloudwatch_event_archive" "main" {
13
13
event_source_arn = aws_cloudwatch_event_bus. main . arn
14
14
retention_days = var. config . archive . retention_days
15
15
}
16
-
17
- resource "null_resource" "ssm_parameter_runner_matcher_config" {
18
- triggers = {
19
- version = var.config.ssm_parameter_runner_matcher_config.version
20
- }
21
- }
Original file line number Diff line number Diff line change
1
+ resource "null_resource" "github_app_parameters" {
2
+ triggers = {
3
+ github_app_webhook_secret_name = var.config.github_app_parameters.webhook_secret.name
4
+ }
5
+ }
6
+
1
7
resource "aws_lambda_function" "webhook" {
2
8
s3_bucket = var. config . lambda_s3_bucket != null ? var. config . lambda_s3_bucket : null
3
9
s3_key = var. config . lambda_s3_key != null ? var. config . lambda_s3_key : null
@@ -48,7 +54,7 @@ resource "aws_lambda_function" "webhook" {
48
54
}
49
55
50
56
lifecycle {
51
- replace_triggered_by = [null_resource. ssm_parameter_runner_matcher_config , null_resource . github_app_parameters ]
57
+ replace_triggered_by = [null_resource. github_app_parameters ]
52
58
}
53
59
}
54
60
@@ -65,14 +71,9 @@ resource "aws_lambda_permission" "webhook" {
65
71
function_name = aws_lambda_function. webhook . function_name
66
72
principal = " apigateway.amazonaws.com"
67
73
source_arn = var. config . api_gw_source_arn
68
- lifecycle {
69
- replace_triggered_by = [null_resource. ssm_parameter_runner_matcher_config , null_resource. github_app_parameters ]
70
- }
71
- }
72
74
73
- resource "null_resource" "github_app_parameters" {
74
- triggers = {
75
- github_app_webhook_secret = var.config.github_app_parameters.webhook_secret.name
75
+ lifecycle {
76
+ replace_triggered_by = [null_resource. github_app_parameters ]
76
77
}
77
78
}
78
79
You can’t perform that action at this time.
0 commit comments