1. Step: Create AWS Container & EC2 Instance - koglak/SWE573 GitHub Wiki

INITIAL STEPS

1. Complete Docker step: Docker Tutorial

2. Create AWS account: AWS Account

3. Download AWS CLI and test if you downloaded with cmd: AWS CLI

  aws --version

CREATE ECR CONTAINER

4. Go AWS Management Console and Select Elastic Container Registry (ECR)

image

5. Create Repository

image

6. Container is ready.

image

7. Select New Repository and click the "View push Commands"

image

8. Push your local image to AWS Container

You don't need to push your postgresql image. AWS has ready-to-use one. Just push your website image. Ignore 2nd step at "View push commands" instruction. You already have an docker container. You should follow:

 aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin <repository_url>

 docker tag <your local docker image> <repository_url/repository_name>

 docker push <repository_url/repository_name>

9. Click your repository name, you should see the pushed image.

You can redo 8th step when you revised your local image.

image

CREATE YOUR INSTANCE

10. Go AWS Management Console and Select EC2

11. Click "Launch Instance" and name it

image

12. "Create New Key Pair"

image

**13. Name the keypair and download .pem file"

image

14. Select all of them.

image

**15. Click "advanced details" and create new IAM user.

image

16. Go to IAM User new Tab, click users and add user.

image

17. Name new user such as SSMRole

image

18. Set the user permission as below and create it.

image

19. Turn back to previous instance creation page and select new created IAM user

20. Finally "Launch Instance."