Skip to content

Instantly share code, notes, and snippets.

@harmy
Last active March 5, 2019 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harmy/65a3c2897fd23fcfb3d11faac76359d8 to your computer and use it in GitHub Desktop.
Save harmy/65a3c2897fd23fcfb3d11faac76359d8 to your computer and use it in GitHub Desktop.
delete all the aws cloudwatch logs in one command
aws stepfunctions list-executions --state-machine-arn arn:aws:states:us-east-1:415293337666:stateMachine:cpi-prod-install --status-filter RUNNING|jq '.executions[].executionArn'|xargs -L 1 aws stepfunctions stop-execution --execution-arn
aws logs describe-log-groups|jq ".logGroups[].logGroupName" | xargs -L 1 aws logs delete-log-group --log-group-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment