mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 18:38:14 -04:00
Add basic terraform bootstrap and staging environments
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
org="gsa-10x-prototyping"
|
||||
|
||||
usage="
|
||||
$0: Destroy a Service User Account in a given space
|
||||
|
||||
Usage:
|
||||
$0 -h
|
||||
$0 -s <SPACE NAME> -u <USER NAME> [-o <ORG NAME>]
|
||||
|
||||
Options:
|
||||
-h: show help and exit
|
||||
-s <SPACE NAME>: configure the space to act on. Required
|
||||
-u <USER NAME>: configure the service user name to destroy. Required
|
||||
-o <ORG NAME>: configure the organization to act on. Default: $org
|
||||
"
|
||||
|
||||
set -e
|
||||
|
||||
space=""
|
||||
service=""
|
||||
|
||||
while getopts ":hs:u:o:" opt; do
|
||||
case "$opt" in
|
||||
s)
|
||||
space=${OPTARG}
|
||||
;;
|
||||
u)
|
||||
service=${OPTARG}
|
||||
;;
|
||||
o)
|
||||
org=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
echo "$usage"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $space = "" || $service = "" ]]; then
|
||||
echo "$usage"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cf target -o $org -s $space
|
||||
|
||||
# destroy service key
|
||||
cf delete-service-key $service service-account-key -f
|
||||
|
||||
# destroy service
|
||||
cf delete-service $service -f
|
||||
Reference in New Issue
Block a user