Skip to content

eventbridge-fan-in-terraform: Update AWS Provider to v6 with bug fixes and README improvements - #3274

Open
kakakakakku wants to merge 9 commits into
aws-samples:mainfrom
kakakakakku:eventbridge-fan-in-terraform
Open

eventbridge-fan-in-terraform: Update AWS Provider to v6 with bug fixes and README improvements#3274
kakakakakku wants to merge 9 commits into
aws-samples:mainfrom
kakakakakku:eventbridge-fan-in-terraform

Conversation

@kakakakakku

Copy link
Copy Markdown
Contributor

Issue #, if available:
N/A

Description of changes:

Hi😀 Thanks for the useful patterns!

To keep this pattern maintainable, I updated the AWS Provider to v6.

And I tried this pattern and found some issues, so I fixed them as well.

Changes

  • Updated the AWS Provider to v6
  • Replaced the deprecated is_enabled argument with state
  • Pinned the EventBridge module version to ~> 4.3
  • Fixed missing provider aliases on aws_cloudwatch_event_target and aws_cloudwatch_log_resource_policy
  • Removed unused outputs and an unused Lambda handler stub (src/app.js)
  • README updates

Note: a deprecation warning about inline_policy still remains, but it comes from the terraform-aws-modules/eventbridge module itself, so it should be fixed upstream.

Check

terraform apply completed successfully and I verified the fan-in works. Events published to eventBus1 / eventBus2 in us-east-2 arrived in the log group of the central event bus in ca-central-1.

$ aws events put-events --region us-east-2 --entries '[
  {
    "EventBusName": "eventBus1",
    "Source": "demo.test",
    "DetailType": "TestEvent",
    "Detail": "{\"message\": \"hello from eventBus1\"}"
  }
]'
{
    "FailedEntryCount": 0,
    "Entries": [
        {
            "EventId": "923a927e-fa40-b9c6-c8c9-68e00cb7848f"
        }
    ]
}

$ aws events put-events --region us-east-2 --entries '[
  {
    "EventBusName": "eventBus2",
    "Source": "demo.test",
    "DetailType": "TestEvent",
    "Detail": "{\"message\": \"hello from eventBus2\"}"
  }
]'
{
    "FailedEntryCount": 0,
    "Entries": [
        {
            "EventId": "c432b097-7c13-eb73-5689-fb7d65193572"
        }
    ]
}

$ aws logs tail /aws/events/central-bus-logs/logs --region ca-central-1 --since 10m
2026-08-09T09:16:52.000000+00:00 da1cd3c2-dd8f-38c8-b81e-88f87b17aabf {"version":"0","id":"0cf20d49-1ddd-7056-1356-d272597ce011","detail-type":"TestEvent","source":"demo.test","account":"000000000000","time":"2026-08-09T09:16:52Z","region":"us-east-2","resources":[],"detail":{"message":"hello from eventBus1"}}
2026-08-09T09:18:34.000000+00:00 d5a833f7-6120-34a5-add4-416fb6a0716f {"version":"0","id":"48d43345-ddd1-a3b9-da22-625717796373","detail-type":"TestEvent","source":"demo.test","account":"000000000000","time":"2026-08-09T09:18:34Z","region":"us-east-2","resources":[],"detail":{"message":"hello from eventBus2"}}

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: It's unused code

local.account_id
]
})
is_enabled = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

╷
│ Warning: Argument is deprecated
│ 
│   with aws_cloudwatch_event_rule.ebrule,
│   on main.tf line 15, in resource "aws_cloudwatch_event_rule" "ebrule":
│   15:   is_enabled = true
│ 
│ is_enabled is deprecated. Use state instead.
╵

```
aws events create-event-bus --name eventBus1 --region us-east-2
aws events create-event-bus --name eventBus2 --region us-east-2
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Added AWS CLI commands to create the fan-in event buses (the pattern assumes they already exist, but most readers need to create them first)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants