Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactored module to add one to many relationship for events to targets #2

Closed
wants to merge 0 commits into from

Conversation

johnricords
Copy link
Contributor

No description provided.

.bumpversion.cfg Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
tests/main.tf Outdated Show resolved Hide resolved
Copy link
Member

@lorengordon lorengordon left a comment

Choose a reason for hiding this comment

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

This change is a little confusing to me. Can you clarify the desired use case? My expectation would be that this module would create a single event rule, and associate many targets to that one rule. The variable definition doesn't match that though. So I think something somewhat foundational might be off about the implementation (or my expectation!)...

variables.tf Outdated Show resolved Hide resolved
Copy link
Member

@lorengordon lorengordon left a comment

Choose a reason for hiding this comment

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

Suggesting a few more changes...

variables.tf Outdated Show resolved Hide resolved
variables.tf Outdated
@@ -1,20 +1,25 @@
variable "cloudwatch_rule" {
Copy link
Member

Choose a reason for hiding this comment

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

Since the focus of this module is creating an event rule, what do you think about simplifying the variable a little, just making the event_rule object the top-level variable? (Also adding the name attribute, as suggested elsewhere) I.e....

variable "event_rule" {
  description = "Object of input configs for the CloudWatch Event Rule"
  type = object({
    name          = string
    description   = optional(string)
    event_pattern = optional(string)

    event_targets = optional(list(object({
      name = string
      arn  = string

      event_bus_name = optional(string)
      role_arn       = optional(string)
      target_id      = optional(string)

      dead_letter_config = optional(object({
        arn = string
      }))

      input_transformer = optional(object({
        input_paths    = optional(map(string))
        input_template = string
      }))
    })), [])
  }))
}

main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
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.

2 participants