@@ -33,7 +33,8 @@ module "eventbridge" {
3333 }
3434
3535 api_destinations = {
36- smee = { # This key should match the key inside "connections"
36+ smee = {
37+ # This key should match the key inside "connections"
3738 description = " my smee endpoint"
3839 invocation_endpoint = " https://smee.io/6hx6fuQaVUKLfALn"
3940 http_method = " POST"
@@ -47,7 +48,8 @@ module "eventbridge" {
4748 source = aws_sqs_queue.source.arn
4849 target = aws_sqs_queue.target.arn
4950
50- enrichment = " smee" # This key should match the key inside "api_destinations"
51+ enrichment = " smee"
52+ # This key should match the key inside "api_destinations"
5153 enrichment_parameters = {
5254 input_template = jsonencode ({ input : " yes" })
5355
@@ -325,6 +327,16 @@ module "eventbridge" {
325327 }
326328 }
327329
330+ custom_kms_key = {
331+ source = aws_sqs_queue.source.arn
332+ target = aws_sqs_queue.target.arn
333+ kms_key_identifier = module.kms.key_id
334+
335+ tags = {
336+ Pipe = " minimal"
337+ }
338+ }
339+
328340 # Minimal with IAM role created outside of the module
329341 minimal_external_role = {
330342 create_role = false
@@ -350,25 +362,6 @@ module "eventbridge" {
350362 }
351363}
352364
353- module "eventbridge_pipe_only" {
354- source = " ../../"
355-
356- create_bus = false
357-
358- pipes = {
359- " pipe-for-existing-bus" = {
360- source = aws_sqs_queue.source.arn
361- target = aws_sqs_queue.target.arn
362- kms_key_identifier = module.kms.key_id
363- }
364-
365- tags = {
366- Pipe = " pipe-for-existing-bus"
367- }
368- }
369- depends_on = [aws_cloudwatch_event_bus . existing_bus ]
370- }
371-
372365# #################
373366# Extra resources
374367# #################
@@ -377,14 +370,6 @@ resource "random_pet" "this" {
377370 length = 2
378371}
379372
380- # ##############################
381- # Event Bus
382- # ##############################
383-
384- resource "aws_cloudwatch_event_bus" "existing_bus" {
385- name = " ${ random_pet . this . id } -existing-bus"
386- }
387-
388373# ##############################
389374# API Destination / Connection
390375# ##############################
0 commit comments