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

Update docs on aws_cloudwatch_event_target's ecs_target.task_count tosay it is required #9680

Closed
wants to merge 1 commit into from

Conversation

alex
Copy link
Contributor

@alex alex commented Aug 8, 2019

The docs previously said it defaulted to 1 and was optional, but actually omitting the value produced an AWS error:

Error: Creating CloudWatch Event Target failed: InvalidParameter: 1 validation error(s) found.

  • minimum field value of 1, PutTargetsInput.Targets[0].EcsParameters.TaskCount.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

NONE

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

… say it is required

The docs previously said it defaulted to 1 and was optional, but actually omitting the value produced an AWS error:

Error: Creating CloudWatch Event Target failed: InvalidParameter: 1 validation error(s) found.
- minimum field value of 1, PutTargetsInput.Targets[0].EcsParameters.TaskCount.
@alex alex requested a review from a team August 8, 2019 13:54
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. service/cloudwatchevents labels Aug 8, 2019
@aeschright aeschright self-assigned this Aug 9, 2019
@aeschright
Copy link
Contributor

Thanks @alex -- could I have a look at the relevant section of your config? From the code it looks like the documentation should be correct, so I'd like to figure out where that error is coming from.

@alex
Copy link
Contributor Author

alex commented Aug 12, 2019

resource "aws_cloudwatch_event_rule" "scheduled_task" {
  name                = var.name
  description         = "Run ${var.name} on schedule: ${var.schedule_expression}"
  schedule_expression = var.schedule_expression
}

resource "aws_cloudwatch_event_target" "task_target" {
  rule     = aws_cloudwatch_event_rule.scheduled_task.name
  arn      = var.cluster_arn
  role_arn = aws_iam_role.event_role.arn

  ecs_target {
    launch_type         = "FARGATE"
    platform_version    = "LATEST"
    task_definition_arn = var.task_definition_arn
    task_count          = 1
    network_configuration {
      subnets         = var.subnet_ids
      security_groups = var.security_group_ids
    }
  }
}

is the relevant bit, without the task_count = 1 line I get the error I indicated.

@aeschright
Copy link
Contributor

The underlying bug was fixed in #9773 and released with v2.25.0. Thanks for pointing us to this problem!

@aeschright aeschright closed this Aug 23, 2019
@ghost
Copy link

ghost commented Nov 1, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants