Skip to content

Instantly share code, notes, and snippets.

@chadjvw
Created November 15, 2018 13:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chadjvw/cf6a580677ba178226d6b7fedae2317d to your computer and use it in GitHub Desktop.
Save chadjvw/cf6a580677ba178226d6b7fedae2317d to your computer and use it in GitHub Desktop.
StopInstances:
Type: Task
Resource: ${self:custom.function-arn}-StopInstances
Next: WaitForInstancesStop
WaitForInstancesStop:
Type: Wait
Seconds: 15
Next: CheckInstancesStopped
CheckInstancesStopped:
Type: Task
Resource: ${self:custom.function-arn}-CheckInstancesStopped
Next: EvaluateInstancesStopped
EvaluateInstancesStopped:
Type: Choice
Choices:
- Variable: '$.instanceShutdownStatus'
StringEquals: 'FAILED'
Next: StopInstancesFailure
- Variable: '$.instanceShutdownStatus'
StringEquals: 'SUCCESS'
Next: DetachVolumes
Default: WaitForInstancesStop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment