See Medium article for a detailed walk through. https://medium.com/@nilanthanb1994/aws-ec2-cluster-using-cloudformation-3f2106faa51
- Create your EC2 key on the AWS console and save pem file in your local directory.
- Update
REGION
,EC2_KEY_NAME
,EC2_AMI_ID
as appropriate. - Deploy cloudformation set up stack
bash scripts/cfn-deploy.sh setup
- Navigate to the CloudFormation section on the AWS console and execute the changeset created for the setup-stack.
- Once setup stack is deployed, run master stack.deployment.
bash scripts/cfn-deploy deploy
- Navigate to the CloudFormation section on the AWS console again and execute the changeset created for the master-stack.
- Wait for deployment to complete then check the node IPs on the EC2 section of the AWS console.
Use Bastion as the SSH jump host to reach private instances.
ssh-agent bash
ssh-add ${PATH_TO_PEM_FILE}
BASTION_HOST=$(aws ec2 describe-instances --filters 'Name=tag:Name,Values=Public-Node-Bastion' --output text --query 'Reservations[].Instances[].PublicIpAddress')
ssh -o ForwardAgent=yes -o ProxyCommand="ssh -q -W %h:%p ec2-user@${BASTION_HOST}" ec2-user@xx.x.x.xxx
- Scope down cloudformation iam role
- Enable network-acl-stack into vpc-stack.