|
|
(30 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| '''EDX Course'''<br> | | '''EDX Course'''<br> |
| + | |
| + | Week 1 - Exercise 2 <br> |
| + | [[ Launch an Amazon EC2 instance with a user data script. ]]<br> |
| + | |
| + | Week 1 - Exercise 3 <br> |
| + | [[ Launch an AWS CloudFormation template to create VPC and subnets. ]]<br> |
| + | [[ Step by step instructions ot launch a CloudFormation template ]]<br> |
| + | [[ Launch an Amazon EC2 instance with a user data script in a VPC ]]<br> |
| + | [[ Step by step - Launch an Amazon EC2 instance with a user data script in a VPC ]]<br> |
| + | |
| Week 2 - Exercise 4 <br> | | Week 2 - Exercise 4 <br> |
− | <source lang="text">
| |
| [[ Create an AWS IAM policy ]]<br> | | [[ Create an AWS IAM policy ]]<br> |
− |
| |
| [[ Create and IAMS user ]]<br> | | [[ Create and IAMS user ]]<br> |
| [[ Create an IAMS user in step by step ]] | | [[ Create an IAMS user in step by step ]] |
− | | + | [[ Create an Amazon EC2 instance and configure AWS CLI with the access keys of the AWS IAM user ]]<br> |
− | Create an Amazon EC2 instance and configure AWS CLI with the access keys of the AWS IAM user edXProjectUser | + | [[ Create an Amazon EC2 instance and configure AWS CLI step by step ]]<br> |
− | <source lang="text"> | + | [[ Connect to the instance using SSH. ]] |
− | | + | |
− | Sign-in to your AWS account as the edXProjectUser AWS IAM user.
| + | |
− | Create an Amazon EC2 instance using the properties below. If you are familiar with Amazon EC2, you may
| + | |
− | want to attempt to complete this portion before reading the step-by-step instructions.
| + | |
− | | + | |
− | Region: Oregon (us-west-2)
| + | |
− | Amazon Machine Image (AMI): Amazon Linux AMI (Do not use the Amazon Linux 2 AMI)
| + | |
− | Instance Type: t2.micro
| + | |
− | Network VPC: edx-build-aws-vpc
| + | |
− | Subnet: edx-subnet-public-a
| + | |
− | Tag: Ex4WebServer
| + | |
− | Security group name: Use the security group created in the third exercise, exercise3-sg.
| + | |
− | Key Pair: Use the key pair created in the third exercise.
| + | |
− | | + | |
− | </source>
| + | |
− | | + | |
− | '''Step by step instructions'''
| + | |
− | <source lang="text">
| + | |
− | | + | |
− | In the AWS Console, click Services, then click EC2 to go to the EC2 dashboard.
| + | |
− | Make sure you are in the Oregon region.
| + | |
− | From the EC2 dashboard, click Launch Instance.
| + | |
− | On the Choose an Amazon Machine Image (AMI) page, select the Amazon Linux AMI. This AMI is free-tier eligible.
| + | |
− | Note: Do not select the Amazon Linux 2 AMI option.
| + | |
− | On the Choose an Instance Type page, select t2.micro.
| + | |
− | Click Next: Configure Instance Details.
| + | |
− | For Network, select edx-build-aws-vpc.
| + | |
− | For Subnet, select edx-subnet-public-a in the us-west-2a availability zone.
| + | |
− | Click Next: Add Storage. Skip through this page and click Next: Add Tags.
| + | |
− | Click Add Tag.
| + | |
− | In the Key textbox, type Name.
| + | |
− | In the Value textbox, type Ex4WebServer.
| + | |
− | Click Next: Configure Security Group. Select the Select an existing security group option.
| + | |
− | From the list of security groups, select exercise3-sg.
| + | |
− | Click Review and Launch.
| + | |
− | On the Review Instance Launch page, review the details and click Launch.
| + | |
− | When prompted for a key pair, select Choose an existing key pair, and then choose the key pair you created in the third exercise.
| + | |
− | Select the acknowledgement check box, and then click Launch Instances.
| + | |
− | Click View Instances to return to the instances page.
| + | |
− | On the Instances page, you can view the status of the launch. It can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks. You can view this information in the Status Checks column.
| + | |
− | Once the instance is ready, select the instance and note down the IPv4 Public IP found in the Descriptions tab at the bottom.
| + | |
− | | + | |
− | | + | |
− | </source>
| + | |
− | | + | |
− | | + | |
− | <source lang="text">
| + | |
− | | + | |
− | Connect to the instance using SSH. You may refer to the instructions in the third exercise for connecting
| + | |
− | to the instance.
| + | |
− | Open the credentials.csv file that you downloaded earlier. Find the entry for edXProjectUser, and note
| + | |
− | the values for Access Key Id and Secret Access Key.
| + | |
− | On the instance terminal, type the below command.
| + | |
− | | + | |
− | aws configure
| + | |
− | | + | |
− | Follow the prompts on the screen and paste in the values for Access Key Id and Secret Access Key.
| + | |
− | For Region, type us-west-2.
| + | |
− | For Default output format, press ENTER.
| + | |
− | You have now configured the AWS CLI so that any CLI calls will operate with the credentials of the AWS IAM user edXProjectUser.
| + | |
− | Now query the information about the Amazon EC2 instances in your account. Type the command below.
| + | |
− | | + | |
− | aws ec2 describe-instances
| + | |
− | | + | |
− | You should see a JSON output with all the information of the Amazon EC2 instances in your account.
| + | |
− | This means that you were able to successfully execute the AWS CLI command with the permissions attached
| + | |
− | to the edXProjectUser.
| + | |
− | | + | |
− | </source>
| + | |