File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,7 @@ module "lambda" {
57
57
# Logging
58
58
is_create_cloudwatch_log_group = true # Default is `true`
59
59
cloudwatch_log_retention_in_days = 90 # Default is `90`
60
- cloudwatch_log_group_kms_key_arn = " arn:aws:kms:ap-southeast-1:562563527952:key/73ab5420-3183-4185-83de-19f6137cb13c"
61
-
60
+ additional_lambda_log_group_kms_policy = data. aws_iam_policy_document . allow_github_oidc . json
62
61
# Env
63
62
ssm_params = {}
64
63
environment_variables = {
@@ -72,3 +71,27 @@ module "lambda" {
72
71
73
72
tags = var. generic_info . custom_tags
74
73
}
74
+
75
+
76
+ data "aws_iam_policy_document" "allow_github_oidc" {
77
+ statement {
78
+ sid = " AllowGitHubActionsEncryptDecrypt"
79
+ effect = " Allow"
80
+
81
+ principals {
82
+ type = " AWS"
83
+ identifiers = [
84
+ " arn:aws:iam::562563527952:role/oozou-internal-devops-github-action-oidc-role"
85
+ ]
86
+ }
87
+
88
+ actions = [
89
+ " kms:Encrypt" ,
90
+ " kms:Decrypt" ,
91
+ " kms:GenerateDataKey*" ,
92
+ " kms:DescribeKey"
93
+ ]
94
+
95
+ resources = [" *" ]
96
+ }
97
+ }
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ module "cloudwatch_log_group_kms" {
340
340
key_type = " service"
341
341
append_random_suffix = true
342
342
description = format (" Secure Secrets Manager's service secrets for service %s" , local. name )
343
- additional_policies = [data . aws_iam_policy_document . cloudwatch_log_group_kms_policy . json ]
343
+ additional_policies = [data . aws_iam_policy_document . cloudwatch_log_group_kms_policy . json , var . additional_lambda_log_group_kms_policy ]
344
344
345
345
tags = merge (local. tags , { " Name" : format (" %s-function-log-group" , var. name ) })
346
346
}
Original file line number Diff line number Diff line change @@ -213,3 +213,9 @@ variable "ssm_params" {
213
213
type = map (string )
214
214
default = {}
215
215
}
216
+
217
+ variable "additional_lambda_log_group_kms_policy" {
218
+ description = " Additional IAM policy document for the Lambda log group KMS key."
219
+ type = string
220
+ default = null
221
+ }
You can’t perform that action at this time.
0 commit comments