Skip to content

Conversation

yuntac
Copy link
Contributor

@yuntac yuntac commented Jul 25, 2025

Description

Allow to use eventbus data for event archive when create_bus is set to false

Motivation and Context

In case of create_bus is set to false, we can't use the aws_cloudwatch_event_bus data in aws_cloudwatch_event_archive resource. we have to set a new data in root module and use it in archives.event_source_arn. This feature allow to directly use the data of the child module if it's desired

Breaking Changes

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@yuntac yuntac force-pushed the feat-use-event-bus-data-for-event-archives branch 2 times, most recently from 8bd6b6b to 11f6db8 Compare July 25, 2025 10:22
@yuntac yuntac changed the title feat: allow to use eventbus data for event archive when create_bus is… feat: use eventbus data for event archive when create_bus is set to false Jul 25, 2025
@yuntac yuntac changed the title feat: use eventbus data for event archive when create_bus is set to false feat: Use eventbus data for event archive when create_bus is set to false Jul 25, 2025
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added stale and removed stale labels Aug 25, 2025
Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Sep 26, 2025

name = lookup(each.value, "name", each.key)
event_source_arn = try(each.value["event_source_arn"], aws_cloudwatch_event_bus.this[0].arn)
event_source_arn = try(each.value["event_source_arn"], var.create_bus ? aws_cloudwatch_event_bus.this[0].arn : data.aws_cloudwatch_event_bus.this[0].arn)
Copy link
Member

Choose a reason for hiding this comment

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

this looks like a valid change, can we remove all the other changes?

@github-actions github-actions bot removed the stale label Oct 5, 2025
@bryantbiggs bryantbiggs force-pushed the feat-use-event-bus-data-for-event-archives branch from 11f6db8 to 65202cc Compare October 6, 2025 21:54
@bryantbiggs bryantbiggs changed the title feat: Use eventbus data for event archive when create_bus is set to false fix: Use correct eventbus for event archive when create_bus is set to false Oct 6, 2025
@bryantbiggs bryantbiggs changed the title fix: Use correct eventbus for event archive when create_bus is set to false fix: Use externally created eventbus for event archive when create_bus is set to false Oct 6, 2025
@bryantbiggs bryantbiggs merged commit e30c402 into terraform-aws-modules:master Oct 6, 2025
19 checks passed
antonbabenko pushed a commit that referenced this pull request Oct 6, 2025
## [4.2.1](v4.2.0...v4.2.1) (2025-10-06)

### Bug Fixes

* Use externally created eventbus for event archive when `create_bus` is set to `false` ([#176](#176)) ([e30c402](e30c402))
@antonbabenko
Copy link
Member

This PR is included in version 4.2.1 🎉

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