Skip to content

Commit a2ae81c

Browse files
authored
Merge pull request #36 from proactiveops/remove-dlq-key
Make CMK mandatory for the DLQ
2 parents ef71dee + 3848789 commit a2ae81c

File tree

18 files changed

+57
-81
lines changed

18 files changed

+57
-81
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023-2025 Dave Hall
3+
Copyright (c) 2023-2026 Dave Hall, https://proactiveops.io
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ module "eventbus_dlq_example" {
205205
source = "git::ssh://git@github.com/proactiveops/eventbus//modules/dlq?ref=main"
206206
207207
queue_name = "[sub-name]-[optional-rule-name]" # Must not exceed 60 characters as the module appends "-dlq" to the name
208-
kms_key_id = aws_kms_key.my_key.id # omit if you want a new KMS key to be created.
208+
kms_key_id = aws_kms_key.my_key.id # The key is required. If needed, create a new one and pass it to the module.
209209
tags = var.tags
210210
}
211211
@@ -220,13 +220,13 @@ EventBus++ is built and maintained by [ProactiveOps](https://proactiveops.com/).
220220
| Name | Version |
221221
|------|---------|
222222
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0, < 2.0 |
223-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0, <6.0 |
223+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0, <7.0 |
224224

225225
## Providers
226226

227227
| Name | Version |
228228
|------|---------|
229-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.94.1 |
229+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0, <7.0 |
230230

231231
## Modules
232232

event_bus.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2023 - 2026 Dave Hall, https://proactiveops.io, MIT License
2+
13
resource "aws_cloudwatch_event_bus" "this" {
24
name = local.namespace
35

event_bus_iam.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2023 - 2026 Dave Hall, https://proactiveops.io, MIT License
2+
13
data "aws_iam_policy_document" "event_bus" {
24
statement {
35
sid = "iamManageBus"

event_bus_rules.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2023 - 2026 Dave Hall, https://proactiveops.io, MIT License
2+
13
resource "aws_cloudwatch_event_rule" "targets" {
24
for_each = { for index, rule in var.cross_bus_rules : rule.name => rule }
35

examples/full/main.tf

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1-
/**
2-
* Example of using EventBus++ module with multiple event buses and cross-bus rules.
3-
*/
1+
# Copyright 2023 - 2026 Dave Hall, https://proactiveops.io, MIT License
2+
3+
resource "aws_kms_key" "this" {
4+
description = "EvenBus Example"
5+
6+
deletion_window_in_days = 14
7+
enable_key_rotation = true
8+
9+
tags = local.tags
10+
}
11+
12+
resource "aws_kms_alias" "this" {
13+
name = "alias/eventbus-example"
14+
target_key_id = aws_kms_key.this.key_id
15+
}
416

517
module "eventbus_dlq_example" {
618
source = "../../modules/dlq"
719

20+
kms_key_id = aws_kms_alias.this.arn
821
queue_name = "example"
9-
tags = local.tags
22+
23+
tags = local.tags
1024
}
1125

1226
module "eventbus_partner" {
1327
source = "../../"
1428

29+
# Note: Zendesk no longer supports EventBridge partnet buses.
1530
name = "aws.partner/zendesk.com/12345678/default"
1631

1732
cross_bus_rules = [

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2023 - 2026 Dave Hall, https://proactiveops.io, MIT License
2+
13
data "aws_caller_identity" "current" {}
24

35
data "aws_partition" "current" {}

modules/dlq/README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
<!-- BEGIN_TF_DOCS -->
21
# EventBus Dead Letter Queue (DLQ) Sub Module
32

43
This module creates a SQS queue that can be used by Amazon EventBridge as a DLQ.
54

5+
<!-- BEGIN_TF_DOCS -->
66
## Requirements
77

88
| Name | Version |
99
|------|---------|
10-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
11-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0 |
10+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0, < 2.0 |
11+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0, <7.0 |
1212

1313
## Providers
1414

1515
| Name | Version |
1616
|------|---------|
17-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0 |
17+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0, <7.0 |
1818

1919
## Modules
2020

@@ -24,19 +24,15 @@ No modules.
2424

2525
| Name | Type |
2626
|------|------|
27-
| [aws_kms_alias.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource |
28-
| [aws_kms_key.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource |
2927
| [aws_sqs_queue.dlq](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource |
3028
| [aws_sqs_queue_policy.dlq](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) | resource |
31-
| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
3229
| [aws_iam_policy_document.dlq](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
33-
| [aws_iam_policy_document.kms](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
3430

3531
## Inputs
3632

3733
| Name | Description | Type | Default | Required |
3834
|------|-------------|------|---------|:--------:|
39-
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | The ID of the existing KMS key. If empty, then a new key will be created with permissions for EventBridge. | `string` | `""` | no |
35+
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | The ID of the existing KMS key. | `string` | n/a | yes |
4036
| <a name="input_queue_name"></a> [queue\_name](#input\_queue\_name) | The name of the queue to create. -dlq will be appended to the end. The name should the [bus-name]-[rule-name] convention. | `string` | n/a | yes |
4137
| <a name="input_tags"></a> [tags](#input\_tags) | Tags help you manage, identify, organize search and filter resources. | `map(string)` | n/a | yes |
4238

modules/dlq/kms.tf

Lines changed: 0 additions & 46 deletions
This file was deleted.

modules/dlq/main.tf

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)