Skip to content

Commit 8c46e20

Browse files
committed
Fixed docs and log_config (required)
1 parent ca4ccdb commit 8c46e20

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ module "eventbridge" {
2222
2323
bus_name = "my-bus"
2424
25-
logging = {
25+
log_config = {
2626
include_detail = "FULL"
2727
level = "INFO"
28+
}
29+
30+
log_delivery = {
2831
cloudwatch_logs = {
29-
enabled = true
30-
arn = "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group"
32+
destination_arn = "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group"
3133
}
3234
s3 = {
33-
enabled = true
34-
arn = "arn:aws:s3:::my-log-bucket"
35+
destination_arn = "arn:aws:s3:::my-log-bucket"
3536
}
3637
}
3738
@@ -360,7 +361,8 @@ module "eventbridge" {
360361
create_schedule_groups = false # to control creation of EventBridge Schedule Group resources
361362
create_schedules = false # to control creation of EventBridge Schedule resources
362363
create_pipes = false # to control creation of EventBridge Pipes resources
363-
create_logging = false # to control creation of EventBridge Logging resources
364+
create_log_delivery_source = false # to control creation of EventBridge Log Delivery Source resources
365+
create_log_delivery = false # to control creation of EventBridge Log Delivery resources
364366
365367
attach_cloudwatch_policy = false
366368
attach_ecs_policy = false

examples/with-bus-logging/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module "eventbridge" {
1717
bus_name = random_pet.this.id
1818

1919
log_config = {
20-
include_detail = "FULL"
20+
include_detail = "NONE"
2121
level = "INFO"
2222
}
2323

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ resource "aws_cloudwatch_log_delivery_source" "this" {
9999
region = var.region
100100

101101
name = coalesce(var.log_delivery_source_name, var.bus_name)
102-
log_type = format("%s_LOGS", try(contains(["INFO", "ERROR", "TRACE"], upper(var.log_config.level)), false) ? upper(var.log_config.level) : "ERROR")
102+
log_type = try(format("%s_LOGS", contains(["INFO", "ERROR", "TRACE"], upper(var.log_config.level)) ? upper(var.log_config.level) : "ERROR"), "ERROR_LOGS")
103103
resource_arn = var.create_bus ? aws_cloudwatch_event_bus.this[0].arn : data.aws_cloudwatch_event_bus.this[0].arn
104104

105105
tags = var.tags

0 commit comments

Comments
 (0)