Skip to content

Commit efd185d

Browse files
committed
CCM-7939: add pipe logging and encryption
1 parent 051d8c5 commit efd185d

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

infrastructure/terraform/modules/backend-api/pipes_pipe_template_table_events.tf

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
resource "aws_pipes_pipe" "template_table_events" {
2-
name = "${local.csi}-template-table-events"
3-
role_arn = aws_iam_role.pipe_template_table_events.arn
4-
source = aws_dynamodb_table.templates.stream_arn
5-
target = module.sqs_template_table_events.sqs_queue_arn
6-
desired_state = var.enable_event_stream ? "RUNNING" : "STOPPED"
2+
name = "${local.csi}-template-table-events"
3+
role_arn = aws_iam_role.pipe_template_table_events.arn
4+
source = aws_dynamodb_table.templates.stream_arn
5+
target = module.sqs_template_table_events.sqs_queue_arn
6+
desired_state = var.enable_event_stream ? "RUNNING" : "STOPPED"
7+
kms_key_identifier = var.kms_key_arn
78

89
source_parameters {
910
dynamodb_stream_parameters {
@@ -16,6 +17,19 @@ resource "aws_pipes_pipe" "template_table_events" {
1617
message_group_id = "$.dynamodb.Keys.id.S"
1718
}
1819
}
20+
21+
log_configuration {
22+
level = "ERROR"
23+
cloudwatch_logs_log_destination {
24+
log_group_arn = aws_cloudwatch_log_group.pipe_template_table_events.arn
25+
}
26+
}
27+
}
28+
29+
resource "aws_cloudwatch_log_group" "pipe_template_table_events" {
30+
name = "/aws/vendedlogs/pipes/${local.csi}-template-table-events"
31+
kms_key_id = var.kms_key_arn
32+
retention_in_days = var.log_retention_in_days
1933
}
2034

2135
resource "aws_iam_role" "pipe_template_table_events" {

0 commit comments

Comments
 (0)