Created
October 23, 2020 00:13
-
-
Save ipolyzos/933168fea618911ab55c7cdfa5dd47fa to your computer and use it in GitHub Desktop.
Cleanup AWS Batch Compute Environments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# NOTE | |
# this script expects the user to be logged in | |
# to the right AWS account and have the proper | |
# credential to delete the compute environments | |
# Create a list with all the compute environments | |
CENV=($(aws batch describe-compute-environments --query 'computeEnvironments[*].computeEnvironmentName' --output text)) | |
# Iteratate the compute environments list deleting each environment | |
for e in ${CENV}; | |
do | |
aws batch delete-compute-environment --compute-environment $e; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment