mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Add basic terraform bootstrap and staging environments
This commit is contained in:
Executable
+67
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
org="gsa-10x-prototyping"
|
||||
|
||||
usage="
|
||||
$0: Set egress rules for given space
|
||||
|
||||
Usage:
|
||||
$0 -h
|
||||
$0 -s <SPACE NAME> [-o <ORG NAME>] [-p] [-t]
|
||||
|
||||
Options:
|
||||
-h: show help and exit
|
||||
-s <SPACE NAME>: configure the space to act on. Required
|
||||
-o <ORG NAME>: configure the organization to act on. Default: $org
|
||||
-p: Add the public egress rules
|
||||
-t: Add the trusted egress rules
|
||||
|
||||
Notes:
|
||||
* If -p or -t are not passed, the related security groups will be removed, if they were present
|
||||
"
|
||||
|
||||
set -e
|
||||
|
||||
space=""
|
||||
public=false
|
||||
trusted=false
|
||||
|
||||
while getopts ":hs:o:pt" opt; do
|
||||
case "$opt" in
|
||||
s)
|
||||
space=${OPTARG}
|
||||
;;
|
||||
o)
|
||||
org=${OPTARG}
|
||||
;;
|
||||
p)
|
||||
public=true
|
||||
;;
|
||||
t)
|
||||
trusted=true
|
||||
;;
|
||||
h)
|
||||
echo "$usage"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ $space = "" ]]; then
|
||||
echo "$usage"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $public = true ]]; then
|
||||
cf bind-security-group public_networks_egress $org --space $space
|
||||
else
|
||||
cf unbind-security-group public_networks_egress $org $space
|
||||
fi
|
||||
|
||||
if [[ $trusted = true ]]; then
|
||||
cf bind-security-group trusted_local_networks_egress $org --space $space
|
||||
else
|
||||
cf unbind-security-group trusted_local_networks_egress $org $space
|
||||
fi
|
||||
|
||||
echo "Done"
|
||||
Reference in New Issue
Block a user