-
Notifications
You must be signed in to change notification settings - Fork 7
/
create-stack.sh
33 lines (33 loc) · 1.54 KB
/
create-stack.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
#!/bin/sh
#########################################################################
# Copyright (C) 2020 Sebastian Francisco Colomar Bauza #
# SPDX-License-Identifier: GPL-2.0-only #
#########################################################################
set -x ;
#########################################################################
test -n "${engine}" || exit 101 ;
test -n "${os}" || exit 102 ;
test -n "${template}" || exit 104 ;
test -n "${version_major}" || exit 105 ;
test -n "${version_minor}" || exit 106 ;
#########################################################################
location=etc/cloudformation/${template}.yaml ;
stack=${os}-${engine}-${version_major}-${version_minor} ;
#########################################################################
export stack=${stack}-$( date +%s | rev | cut -c1,2 ) ;
#########################################################################
aws \
cloudformation \
create-stack \
--capabilities \
CAPABILITY_NAMED_IAM \
--parameters \
ParameterKey=RecordSetNameWorker,ParameterValue=${stack}\
--stack-name \
${stack} \
--template-body \
file://${location} \
;
#########################################################################
set +x ;
#########################################################################