Skip to content

Instantly share code, notes, and snippets.

@t04glovern
Last active June 9, 2019 12:48
Show Gist options
  • Save t04glovern/f6f7b7d02501b7e1147975b4aee76ae0 to your computer and use it in GitHub Desktop.
Save t04glovern/f6f7b7d02501b7e1147975b4aee76ae0 to your computer and use it in GitHub Desktop.
IAM User - cloudformation - route53 - GetAccess
#!/bin/sh
# Wait for stack to finish creating
aws cloudformation wait stack-create-complete --stack-name iam-route53-user
# Get AccessKey to variable
ACCESS_KEY=$(aws cloudformation describe-stacks --stack-name iam-route53-user \
--query 'Stacks[0].Outputs[?OutputKey==`AccessKey`].OutputValue' \
--output text)
# Get SecretKey to variable
SECRET_KEY=$(aws cloudformation describe-stacks --stack-name iam-route53-user \
--query 'Stacks[0].Outputs[?OutputKey==`SecretKey`].OutputValue' \
--output text)
# Save external-dns.yaml file with credentials
tee <<EOF >./external-dns.yaml
provider: aws
aws:
secretKey: '$SECRET_KEY'
accessKey: '$ACCESS_KEY'
rbac:
create: true
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment