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

Incorrect error message surfaced #11719

Closed
ipmb opened this issue Jan 22, 2020 · 3 comments
Closed

Incorrect error message surfaced #11719

ipmb opened this issue Jan 22, 2020 · 3 comments
Labels
regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@ipmb
Copy link

ipmb commented Jan 22, 2020

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 Version

terraform -v
Terraform v0.12.8
+ provider.aws v2.45.0
+ provider.cloudflare v2.3.0
+ provider.template v2.1.2

Affected Resource(s)

  • aws_ecs_service

Terraform Configuration Files

resource "aws_lb_target_group" "this" {
  name_prefix          = var.name_prefix
  port                 = 8000
  protocol             = "HTTP"
  vpc_id               = var.vpc_id
  target_type          = "ip"
  deregistration_delay = 30
  stickiness {
    type    = "lb_cookie"
    enabled = true
  }

  health_check {
    healthy_threshold   = 2
    unhealthy_threshold = 5
    timeout             = 10
    path                = "/-/alive/"
    interval            = 30
  }

  tags = var.tags

  lifecycle {
    create_before_destroy = true
  }
}

resource "aws_ecs_service" "web" {
  name            = "${var.name}-web"
  cluster         = var.ecs_cluster_arn
  task_definition = aws_ecs_task_definition.placeholder.arn
  enable_ecs_managed_tags = true
  propagate_tags          = "SERVICE"
  desired_count   = 1
  deployment_maximum_percent = 200
  ordered_placement_strategy {
    type = "binpack"
    field = "memory"
  }
  capacity_provider_strategy {
    base = 0
    capacity_provider = var.capacity_provider_name
    weight = 100
  }

  load_balancer {
    container_name = "web"
    container_port = local.port
    target_group_arn = aws_lb_target_group.this.arn
  }

  lifecycle {
    # Allow rev'ing the task definition outside terraform
    ignore_changes = [task_definition, desired_count]
  }
  tags = var.tags
}

Debug Output

https://gist.github.com/ipmb/d173fb4f78d8e73d9d1294c71f641045

Panic Output

Expected Behavior

Actual error surfaced in output:

{"__type":"InvalidParameterException","message":"The provided target group arn:aws:elasticloadbalancing:us-east-1:xxx:targetgroup/llprd20200122052638603300000006/a0a2d775807f6620 has target type ip, which is incompatible with the bridge network mode specified in the task definition."}

Actual Behavior

Unhelpful error is shown in output:

Error: InvalidParameterException:  "example-prod-web"

  on apps/example/main.tf line 216, in resource "aws_ecs_service" "web":
 216: resource "aws_ecs_service" "web" {

Steps to Reproduce

  1. terraform apply
@ghost ghost added service/ecs Issues and PRs that pertain to the ecs service. service/elbv2 Issues and PRs that pertain to the elbv2 service. labels Jan 22, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 22, 2020
@bflad bflad added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 22, 2020
@bflad bflad added this to the v2.46.0 milestone Jan 22, 2020
@bflad
Copy link
Contributor

bflad commented Jan 22, 2020

Hi @ipmb 👋 Thank you for reporting this and sorry you are running into trouble here. The error code and symptoms indicate that this is related to #11706 and #11682 (which is a regression where the error messaging is not correctly surfaced by the AWS Go SDK) so to consolidate discussions and efforts, I'm going to close this issue in preference of the existing one. The good news is that this should be resolved via AWS Go SDK update today and Terraform AWS Provider release tomorrow. 👍

@ghost
Copy link

ghost commented Jan 23, 2020

This has been released in version 2.46.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 27, 2020

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 Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

No branches or pull requests

2 participants