Skip to content

No more than 1 "service_registries" blocks are allowed #9573

@ronniekk

Description

@ronniekk

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 "me too" comments, 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

Affected Resource(s)

  • aws_ecs_service

Terraform Configuration Files

resource "aws_ecs_service" "my-service" {
  name            = "my-service"
  cluster         = "${aws_ecs_cluster.main.id}"
  task_definition = "${aws_ecs_task_definition.my-service.arn}"
  desired_count   = "${var.app_count}"
  launch_type     = "FARGATE"

  network_configuration {
    security_groups  = [
      "${aws_security_group.my-service.id}"
    ]
    subnets          = data.aws_subnet_ids.private.ids
    assign_public_ip = false
  }

  service_registries {
    registry_arn = "${aws_service_discovery_service.my-service-thrift.arn}"
    port         = var.thrift_port
  }

  service_registries {
    registry_arn = "${aws_service_discovery_service.my-service-http.arn}"
    port         = var.http_port
  }
}

Expected Behavior

Multiple service_registries are used with single service.

Actual Behavior

Error: Too many service_registries blocks

  on  line 0:
  (source code not available)

No more than 1 "service_registries" blocks are allowed

Provider schema is capped at max one items: https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_ecs_service.go#L304

Steps to Reproduce

  1. Add more than one service_registries within an aws_ecs_service resource.
  2. terraform apply

References

Array of ServiceRegistry objects is supported in AWS API: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Service.html#ECS-Type-Service-serviceRegistries

Go API supports array of ServiceRegistry: https://docs.aws.amazon.com/sdk-for-go/api/service/ecs/#CreateServiceInput.SetServiceRegistries

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/ecsIssues and PRs that pertain to the ecs service.staleOld or inactive issues managed by automation, if no further action taken these will get closed.upstreamAddresses functionality related to the cloud provider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions