File tree Expand file tree Collapse file tree 3 files changed +19
-18
lines changed Expand file tree Collapse file tree 3 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 5
5
"Effect" : " Allow" ,
6
6
"Action" : [" sqs:SendMessage" , " sqs:GetQueueAttributes" ],
7
7
"Resource" : ${sqs_resource_arns }
8
+ %{ if kms_key_arn != "" ~}
9
+ },
10
+ {
11
+ "Effect" : " Allow" ,
12
+ "Action" : [
13
+ " kms:Decrypt" ,
14
+ " kms:GenerateDataKey"
15
+ ],
16
+ "Resource" : " ${kms_key_arn}"
17
+ %{ endif ~ }
8
18
}
9
19
]
10
20
}
Original file line number Diff line number Diff line change 2
2
"Version" : " 2012-10-17" ,
3
3
"Statement" : [
4
4
{
5
- "Effect" : " Allow" ,
6
- "Action" : [
7
- " ssm:GetParameter"
8
- ],
9
- "Resource" : [
10
- " ${github_app_webhook_secret_arn}"
11
- ]
12
- %{ if kms_key_arn != "" ~ }
13
- },
14
- {
15
- "Effect" : " Allow" ,
16
- "Action" : [
17
- " kms:Decrypt" ,
18
- " kms:GenerateDataKey"
19
- ],
20
- "Resource" : " ${kms_key_arn}"
21
- %{ endif ~ }
5
+ "Effect" : " Allow" ,
6
+ "Action" : [
7
+ " ssm:GetParameter"
8
+ ],
9
+ "Resource" : [
10
+ " ${github_app_webhook_secret_arn}"
11
+ ]
22
12
}
23
13
]
24
14
}
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ resource "aws_iam_role_policy" "webhook_sqs" {
88
88
89
89
policy = templatefile (" ${ path . module } /policies/lambda-publish-sqs-policy.json" , {
90
90
sqs_resource_arns = jsonencode ([for k , v in var . runner_config : v . arn ])
91
+ kms_key_arn = var.kms_key_arn != null ? var.kms_key_arn : " "
91
92
})
92
93
}
93
94
@@ -98,6 +99,7 @@ resource "aws_iam_role_policy" "webhook_workflow_job_sqs" {
98
99
99
100
policy = templatefile (" ${ path . module } /policies/lambda-publish-sqs-policy.json" , {
100
101
sqs_resource_arns = jsonencode ([var . sqs_workflow_job_queue . arn ])
102
+ kms_key_arn = var.kms_key_arn != null ? var.kms_key_arn : " "
101
103
})
102
104
}
103
105
@@ -107,6 +109,5 @@ resource "aws_iam_role_policy" "webhook_ssm" {
107
109
108
110
policy = templatefile (" ${ path . module } /policies/lambda-ssm.json" , {
109
111
github_app_webhook_secret_arn = var.github_app_parameters.webhook_secret.arn,
110
- kms_key_arn = var.kms_key_arn != null ? var.kms_key_arn : " "
111
112
})
112
113
}
You can’t perform that action at this time.
0 commit comments