-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.sh
executable file
·47 lines (39 loc) · 1.06 KB
/
launch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#/bin/sh
set -e
source launch.config
instuction()
{
echo ""
echo "Welcome to pulumi backend launchpad"
echo "Usage: launch.sh storage"
echo
}
if [ $# -lt 1 ]; then
instuction
exit 1
fi
if [ "$1" = "storage" ];then
echo "Launching resources..."
echo
echo "Creating resources group ..."
az group create \
--location $AZURE_LOCATION \
--name $AZURE_RESOURCEGROUP \
--output json
echo
echo "Creating backend storage ..."
az storage account create \
--name $AZURE_STORAGE_ACCOUNT \
--resource-group $AZURE_RESOURCEGROUP \
--location $AZURE_LOCATION \
--sku Standard_ZRS \
--kind StorageV2 \
--output json
echo
echo "Creating state container..."
key1=$(az storage account keys list -g $AZURE_RESOURCEGROUP -n $AZURE_STORAGE_ACCOUNT --output table | grep key1 | awk '{print $3}')
az storage container create --name "statescontainer" \
--account-name $AZURE_STORAGE_ACCOUNT \
--account-key $key1 \
--output json
fi