Add wait_until_stable option for ECS services #14224
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I initially considered raising this as an issue, but then decided I'd be better placed to show an example through a PR.
There are quite a few elements of an ECS service that cause the resource to be recreated. Upon creation, we do not wait for the service to be stable, which means even using lifecycle rules to
create_before_destroy
, we will suffer downtime.This commit seeks to introduce a basic assessment on whether a service is stable. The attributes for this assessment are:
If all 3 of these conditions are met, we can be reasonably sure that the service has at least started and provisioned some tasks. It won't account for tasks that end up crashing, but if you're confident of your service it should be safe to use.
I haven't added any tests yet, because I'm honestly not quite sure the best way to add them. I would appreciate some guidance, if possible! I'm OK to run an acceptance test, so more than happy to poke at finding the right solution.
Community Note
Relates OR Closes #0000
Release note for CHANGELOG:
Output from acceptance testing: