- Newest
- Most votes
- Most comments
You've encountered a known issue with AWS App Runner regarding the removal of the "Start command" (also known as StartCommand). This is indeed a limitation of the App Runner service that many users have experienced.
When you set a StartCommand for an App Runner service, it becomes difficult to completely remove or unset it through conventional methods. Attempts to clear this field through the AWS console, AWS CLI, SDKs like boto3, or infrastructure-as-code tools like Terraform often fail to persist the changes. The service continues to use the previously set command, even after attempts to remove it.
As a workaround, some users have found that setting the StartCommand to a single space character can help, but this isn't ideal as it doesn't truly revert to using the Dockerfile's CMD or ENTRYPOINT instructions.
The approach you've taken - creating a new project without specifying the StartCommand and then deleting the old one - is currently one of the most effective ways to address this issue. While it's not the most convenient solution, it does ensure that your service runs without the unwanted start command.
For future reference, if you need to change or remove the StartCommand, consider the following steps:
- Create a new App Runner service configuration without specifying the StartCommand.
- Migrate your application to this new service and verify that it runs as expected.
- Once the new service is operational, delete the old service with the problematic StartCommand.
This issue highlights the importance of carefully considering whether to set a custom StartCommand when initially configuring an App Runner service, as it can be challenging to remove later on. It's generally better to rely on the Dockerfile's instructions unless absolutely necessary to override them.
Sources
cannot unset StartCommand in AppRunner | AWS re:Post
answered 2 years ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
