Hello,
I am trying to deploy my application to the AWS Lightsail container service that I have created. When I try to run the create-container-service-deployment command from the aws-cli, I get the following error:
An error occurred (InvalidInputException) when calling the CreateContainerServiceDeployment operation: Invalid container name. You must specify the name of a container that is in the containers portion of the request.
This seems to be an issue cause by the containerName parameter specified in the public-endpoint.json file. If I use 'flask' as the container name (as mentioned in this tutorial), the deployment works. But if I use any other string as name it throws the above error.
But when I try to deploy from the AWS Lightsail console directly, any container name proceeds with successful deployment. If I try to use the exact same name with the cli, under the same options, it fails.
Please find the details in the image below:

I am using a Mac OS with the M1 chip
Solutions tried:
- Tried updating the aws-cli package and lightsail package; does not resolve the error
- Tried different container names, without hyphens, with hyphens, other words with 'flask'. Everything throws the same error, even for the example tutorial.
- Tried the example tutorial in a linux machine, the issue persists. Application gets deployed if public-endpoint.json file's containerName parameter is defined as 'flask' and fails otherwise.
Kindly help with this, Thanks!
Thank you so much for pointing this out Yujie! It works now! I did not realise that the 'flask' in the containers.json file was supposed to be the container name.