aws-samples / elasticache-refarch-chatapp

Example architecture for building a chat application using ElastiCache for Redis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Key Pair Not Documented, Creates ROLLBACK ISSUE

darkn3rd opened this issue · comments

DESCRIPTION: In the chatapp.yml, there's a requirements for a EC2 KeyPair to be created. This is not documented anywhere. In the chatapp.yaml, on line 27, snippet here:

Parameters:
  KeyName:
    Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
    Type: AWS::EC2::KeyPair::KeyName
    ConstraintDescription: Must be the name of an existing EC2 KeyPair.

STEPS

  1. Click on the [Launch Stack] button that refers to:
  2. Navigate through the deafults

ACTUAL RESULTS

ROLLBACK as required parameter to meet constraint is not there.

EXPECTED RESULTS

I would click on the button, run through the instructions and it would work. There's no documentation on this requirement, other than the CFN template code.

WORKAROUND

Putting this out for anyone wanting to learn and use a key pair, this assumes you have AWS CLI setup and configured for the account you'll run this stack, and that you have used ssh once to log into a system:

openssl genrsa -out ~/.ssh/chatapp.pem 4096
openssl rsa -in ~/.ssh/chatapp.pem -pubout > ~/.ssh/chatapp.pub
chmod 400 ~/.ssh/chatapp.pem
aws ec2 import-key-pair \
  --key-name chatapp \
  --public-key-material "$(grep -v PUBLIC  ~/.ssh/chatapp.pub | tr -d '\n')" \
  --region us-east-1

When launching the stack, in the Specify Details area, in the KeyName field, select the key you created above (or another one of your choosing that is available).