File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -91,11 +91,24 @@ data "aws_iam_policy_document" "firehose_kms_key_policy" {
9191 condition {
9292 test = " StringEquals"
9393 variable = " kms:EncryptionContext:aws:logs:arn"
94- values = [
94+ values = [
9595 " arn:aws:logs:${ var . region } :${ data . aws_caller_identity . current . account_id } :log-group:/aws/kinesisfirehose/${ var . project_name } -${ var . environment } -audit"
9696 ]
9797 }
9898 }
99+
100+ statement {
101+ sid = " AllowLambdaUsage"
102+ effect = " Allow"
103+ principals {
104+ type = " AWS"
105+ identifiers = [var . eligibility_lambda_role_arn ]
106+ }
107+ actions = [
108+ " kms:*"
109+ ]
110+ resources = [aws_kms_key . firehose_cmk . arn ]
111+ }
99112}
100113
101114
Original file line number Diff line number Diff line change @@ -23,5 +23,11 @@ variable "kinesis_cloud_watch_log_stream" {
2323 type = string
2424}
2525
26+ variable "eligibility_lambda_role_arn" {
27+ description = " iam role of eligibility lambda"
28+ type = any
29+ }
30+
31+
2632
2733
Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ module "eligibility_audit_firehose_delivery_stream" {
99 tags = local. tags
1010 kinesis_cloud_watch_log_group_name = aws_cloudwatch_log_group. firehose_audit . name
1111 kinesis_cloud_watch_log_stream = aws_cloudwatch_log_stream. firehose_audit_stream . name
12+ eligibility_lambda_role_arn = aws_iam_role. eligibility_lambda_role . arn
1213}
You can’t perform that action at this time.
0 commit comments