@@ -5,6 +5,8 @@ read -p "Host domain for the instance: " DOMAIN
5
5
read -p " Contact email to use for LetsEncrypt SSL registration: " LETSENCRYPT_EMAIL
6
6
read -p " Instance type [t3a.small]: " INSTANCE_TYPE
7
7
INSTANCE_TYPE=${INSTANCE_TYPE:= t3a.small}
8
+ read -p " Instance root volume size in GB [12]: " VOLUME_SIZE
9
+ VOLUME_SIZE=${VOLUME_SIZE:= 12}
8
10
9
11
# determine architecture type from instance type
10
12
if [[ " $INSTANCE_TYPE " =~ g\. ]]; then
16
18
# get the appropriate Debian 12 (Bookworm) AMI for the current region and architecture
17
19
IMAGE_ID=` aws ssm get-parameters-by-path --path /aws/service/debian/release/bookworm/latest --output text | grep -m 1 -oP " ${TARGET_ARCH} [[:blank:]]+String[[:blank:]]+\K(ami-[^[:blank:]]+)" `
18
20
19
- aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name dokku- ${APP_NAME} --template-body file://./dokku.json --parameters ParameterKey=ApplicationName,ParameterValue=$APP_NAME ParameterKey=LetsEncryptEmail,ParameterValue=$LETSENCRYPT_EMAIL ParameterKey=DokkuHostname,ParameterValue=" $DOMAIN " ParameterKey=InstanceImageId,ParameterValue=" $IMAGE_ID " ParameterKey=InstanceType,ParameterValue=" $INSTANCE_TYPE "
21
+ aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name ${APP_NAME} -dokku --template-body file://./dokku.json --parameters ParameterKey=ApplicationName,ParameterValue=$APP_NAME ParameterKey=LetsEncryptEmail,ParameterValue=$LETSENCRYPT_EMAIL ParameterKey=DokkuHostname,ParameterValue=" $DOMAIN " ParameterKey=InstanceImageId,ParameterValue=" $IMAGE_ID " ParameterKey=InstanceType,ParameterValue=" $INSTANCE_TYPE " ParameterKey=InstanceRootVolumeSize,ParameterValue= " $VOLUME_SIZE "
20
22
21
23
# wait for key pair to become available
22
24
while : ; do
23
- KEY_NAME=` aws ec2 describe-key-pairs --filters Name=key-name,Values=dokku- ${APP_NAME} -key-pair --query KeyPairs[* ].KeyPairId --output text`
25
+ KEY_NAME=` aws ec2 describe-key-pairs --filters Name=key-name,Values=${APP_NAME} -dokku -key-pair --query KeyPairs[* ].KeyPairId --output text`
24
26
if [ " $KEY_NAME " != " " ]; then
25
27
break
26
28
fi
27
29
sleep 1
28
30
done
29
31
30
32
# download into a pem file in ~/.ssh
31
- aws ssm get-parameter --name /ec2/keypair/${KEY_NAME} --with-decryption --query Parameter.Value --output text > ~ /.ssh/dokku- ${APP_NAME} -key-pair.pem
32
- chmod 600 ~ /.ssh/dokku- ${APP_NAME} -key-pair.pem
33
+ aws ssm get-parameter --name /ec2/keypair/${KEY_NAME} --with-decryption --query Parameter.Value --output text > ~ /.ssh/${APP_NAME} -dokku -key-pair.pem
34
+ chmod 600 ~ /.ssh/${APP_NAME} -dokku -key-pair.pem
0 commit comments