-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/email
Copy pathMore file actions
executable file
·17 lines (12 loc) · 953 Bytes
/email
File metadata and controls
executable file
·17 lines (12 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
read -p "App name (lowercase, letters, numbers, hyphen only): " APP_NAME
aws cloudformation create-stack --capabilities CAPABILITY_NAMED_IAM --stack-name ${APP_NAME}-email --template-body file://./email.json --parameters ParameterKey=ApplicationName,ParameterValue=$APP_NAME --output text
# wait for completion
aws cloudformation wait stack-create-complete --stack-name ${APP_NAME}-email --output text
# output the access key id
echo "Access Key ID:"
aws cloudformation describe-stacks --stack-name ${APP_NAME}-email --query 'Stacks[0].Outputs[?OutputKey==`SESUserAccessKeyId`].OutputValue' --output text
# output the secret access key
SECRET_ARN=`aws cloudformation describe-stacks --stack-name ${APP_NAME}-email --query 'Stacks[0].Outputs[?OutputKey==\`SESUserSecretAccessKeyARN\`].OutputValue' --output text`
echo "Secret Access Key:"
aws secretsmanager get-secret-value --query 'SecretString' --output text --secret-id $SECRET_ARN