question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ECS.client.create_service() Incorrectly Requiring loadBalancers param

See original GitHub issue

Attempting to run ECS.client.create_service() without a load balancer. Per the documentation, loadBalancers parameter is not required: https://boto3.readthedocs.org/en/latest/reference/services/ecs.html#ECS.Client.create_service

When executed via boto3, I’m seeing the following error:

(Error code 400)
  File "/usr/local/lib/python3.5/site-packages/botocore/client.py", line 310, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.5/site-packages/botocore/client.py", line 407, in _make_api_call
    raise ClientError(parsed_response, operation_name)
  botocore.exceptions.ClientError: An error occurred (InvalidParameterException) when calling the CreateService operation: A role was passed, but no load balancers were present.

The aws_cli tool does not require the loadBalancers parameter.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mccammoncommented, Jan 26, 2016

Removing role fixes the issue. It appears that there is some confusion on whether adding a role param means that loadBalancers param is required:

https://boto3.readthedocs.org/en/latest/reference/services/ecs.html#ECS.Client.create_service role:…“This parameter is only required if you are using a load balancer with your service.”

As stated before, role can be used with the aws_cli tool without requiring loadBalancers.

0reactions
swetashrecommented, Oct 4, 2019

@mccammon - Not the documentation is updated with more detail. You can see in our documentation https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.create_service:

Role: This parameter is only permitted if you are using a load balancer with your service and your task definition does not use the awsvpc network mode. If you specify the role parameter, you must also specify a load balancer object with the loadBalancers parameter.

I am closing the issue as the issue has been resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot common errors with API calls in Amazon ECS
This error is logged when the AWS Identity and Access Management (IAM) user or role making the API call doesn't have the required...
Read more >
Service definition parameters - Amazon Elastic Container ...
A service definition defines how to run your Amazon ECS service. The following parameters can be specified in a service definition.
Read more >
EcsClient (AWS SDK for Java - 2.18.41)
Service client for accessing Amazon ECS. This can be created using the static builder() method. Amazon Elastic Container Service.
Read more >
Deploy services to a swarm - Docker Documentation
the image name and tag the service containers should run; how many containers participate in the service; whether any ports are exposed to...
Read more >
Network.AWS.ECS.CreateService - Hackage
The load balancer distributes traffic across the tasks that are associated ... This parameter is required for task definitions that use the awsvpc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found