cannot unset StartCommand in AppRunner


So I recently deployed some apprunner services, and we were experimenting with different configurations... one of which included specifying the StartCommand in AppRunner's image configuration.

Since then we've decided to instead specify the entrypoint directly in the Dockerfile, and would like to remove AppRunner's StartCommand. However attempts to do this in the aws console, via boto, and via terraform have all failed. the request goes through, but nothing happens and the start command remains set to the undesired value. I was able to set it to a single space, but I'd really prefer it to be cleared completely... null or empty string or whatever it is when it's not set.

asked 3 months ago204 views
1 Answer

if you're struggling to unset the StartCommand in AWS AppRunner, and have already tried updating this through the AWS console, boto3, and Terraform without success, you're facing a common challenge. Unfortunately, the AWS documentation and user experiences indicate that once a StartCommand is set in AppRunner, it cannot be directly unset to null through conventional update methods.

A workaround to this issue is to set the StartCommand to a single space, as you have done, which you've noted is not ideal. This method is commonly used as a temporary fix, but it doesn't revert the command to the Dockerfile's CMD instruction.

Currently, there isn't a direct method to completely remove the StartCommand so that AppRunner defaults back to using the Dockerfile's ENTRYPOINT or CMD. This behavior appears to be a limitation within the AppRunner service.

  1. Create a new AppRunner service configuration without specifying the StartCommand.
  2. Migrate your service to the new configuration and ensure it runs as expected.
  3. Delete the old service configuration once the new one is operational.

While these steps involve more work compared to directly editing an existing service, they will ensure that the StartCommand is effectively unset.

profile picture
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions