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

Wrong validation foraws_cloudwatch_event_target input_transformer.input_paths maximum size #19698

Closed
kromol opened this issue Jun 7, 2021 · 4 comments · Fixed by #19703
Closed
Labels
bug Addresses a defect in current functionality.
Milestone

Comments

@kromol
Copy link

kromol commented Jun 7, 2021

According to AWS documentation maximum number of items in InputTransformer.InputPathsMap is 100. Provider limits it to 10.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.7

Affected Resource(s)

  • aws_cloudwatch_event_target

Expected Behavior

100 items in input_transformer.input_paths should be allowed.

Actual Behavior

Error is thrown:

Error: expected number of items in input_transformer.0.input_paths to be less than or equal to 10, got 27

Steps to Reproduce

Create event target resource and pass more than 10 items in input_paths:

variable "sns_targets" {
  type = list(object({
    sns_topic_arn = string
    input_transformer = object({
      input_paths     = map(string)
      input_templates = string
    })
  }))
  description = "List of SNS topics ARNs"
}

resource "aws_cloudwatch_event_target" "sns_targets" {
  for_each = {
    for index, value in var.sns_targets : index => value
  }

  arn            = each.value.sns_topic_arn
  rule           = aws_cloudwatch_event_rule.event_rule.name
  event_bus_name = "default"

  dynamic "input_transformer" {
    for_each = each.value.input_transformer == null ? [] : [each.value.input_transformer]

    content {
      input_paths    = input_transformer.value.input_paths
      input_template = input_transformer.value.input_templates
    }
  }
}
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/cloudwatchevents labels Jun 7, 2021
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. service/eventbridge labels Jun 7, 2021
@anGie44
Copy link
Contributor

anGie44 commented Jun 7, 2021

Hi @kromol , thank you for raising this issue. Looks like the AWS service has changed since the last time that validation check was added, but it's definitely adjustable within the resource code here:

https://github.com/hashicorp/terraform-provider-aws/blob/main/aws/resource_aws_cloudwatch_event_target.go#L259-L266

MaxMapItems can be increased to 100 👍

Reference: #10912.

@kromol
Copy link
Author

kromol commented Jun 7, 2021

Yeah, thanks for the hint
I am going to raise a PR today to fix it

@github-actions
Copy link

This functionality has been released in v3.45.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
2 participants