terraform-aws-ecs-service icon indicating copy to clipboard operation
terraform-aws-ecs-service copied to clipboard

Service discovery fails on apply in bridge mode

Open ddriddle opened this issue 6 years ago • 0 comments

Scenario Instance of 'aws_ecs_service' 'all' in file as-aws-modules/test/features/ecs-service/ecs-service.feature fails with the following error:

Error: Error applying plan:
1 error(s) occurred:
* aws_ecs_service.all: 1 error(s) occurred:
* aws_ecs_service.all: InvalidParameterException: When specifying 'host' or 'bridge' for networkMode, values for 'containerName' and 'containerPort' must be specified from the task definition. Registry: arn:aws:servicediscovery:us-east-2:224588347132:service/srv-l2ijonw3ungcigcj
        status code: 400, request id: 34d40946-e9ba-11e8-bdb8-9b87bd765b46 "delete-me-behave-tf-IHSKR34F3D" 

This is because the service_registries map on object aws_ecs_service.all lacks the required arguments container_name and container_port. Please note that these are not required in general but are required for bridge and host mode.

ddriddle avatar Nov 16 '18 16:11 ddriddle