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.
Added validation for Task Definition.
Background
Scheduled Task is fail if specified not defined Task Definition or Revision. And it is need to effort for catch this problem. (no ECS error, no Task log..., see CloudWatchMetrics FailedInvocations)
ecschedule is able to set undefined Task Definition and Revision. On AWS management console, Task Definition is able to select only from defined Task Definitions and Revisions. However Scheduled Task API(CloudWatchEvent) does not check defined Task Definition.
Solution
If specified undefined Task Definition and Revision, then error and exit command.
sample validation error message
(
ClientException: Unable to describe task definition.
is return from ECS DescribeTaskDefinition API)Breaking change in specific case.
I chose default do validate, because I guess almost case is not affected.
It will not be setable ScheduledTask that use undefined Task Definition after this change. Would you like to need Opt-Out option? (ex.
-without-taskdef-validation
) or change to Opt-In option? (ex.-validate-task-definition
)