[version_1.0]
The exercises in this course will have an associated charge in your AWS account. In this exercise, you will create the following resources:
The final exercise includes instructions to delete all the resources that you create in the exercises.
Familiarize yourself with Amazon EC2 pricing and the AWS Free Tier.
In this exercise, you will create the IAM roles that are needed to complete the exercise. You will launch an EC2 instance and install the CodeDeploy agent onto that instance.
In this task, you create the required IAM roles and assign the necessary permissions to them.
In the AWS Management Console, choose Services, and search for and open IAM.
In the navigation pane, choose Roles and then choose Create role.
Choose Next: Permissions.
Skip the Attached permissions policies and Add tags (optional) pages by choosing Next: Tags and then choosing Next: Review.
For Role name, enter CodeDeployServiceRole and choose Create role.
Choose Next: Permissions.
In the Filter policies search box, enter s3full and select the AmazonS3FullAccess policy.
Search the policies again for ssmmanaged and select the AmazonSSMManagedInstanceCore policy.
Skip the next two pages by choosing Next: Tags and then choosing Next: Review.
For Role name, enter EC2S3FullAccess and choose Create role.
In this task, you configure and launch an EC2 instance to work with AWS Systems Manager Session Manager.
In the console, choose Services, and search for and open EC2. Make sure you are in the Oregon (us-west-2) Region.
In the navigation pane, choose Instances and then choose Launch instances.
From the list of Amazon Machine Images (AMIs), select the Amazon Linux 2 AMI (HVM), SSD Volume Type, and keep the t2.micro instance type selected.
Choose Next: Configure Instance Details.
Choose Next: Add Storage and skip the Add Storage page by choosing Next: Add Tags.
NameTEST-environmentChoose Next: Configure Security Group.
Choose Review and Launch, and then choose Launch.
In the dialog box, select Proceed without a key pair, select the acknowledgement box, and choose Launch Instances.
In the Launch Status screen, open the list of EC2 instances by choosing the instance ID.
Wait for the Instance state column to change to Running and the Status check column to change to passed.
In this task you, install the CodeDeploy agent onto the EC2 instance.
From the list of instances, open the TEST-environment instance details by choosing the Instance ID link.
In the instance summary, choose Connect.
In Connect to instance, choose the Session Manager tab and then choose Connect.
In the terminal window, install the CodeDeploy agent by running the following commands. Note: wget might already be installed.
Install the latest version of the agent.
Verify that the agent is running.
Note: If the agent does not show as running, try the following commands.
``` bash
sudo service codedeploy-agent start
sudo service codedeploy-agent status
```
You will use this instance in the next exercise, where you will set up the CodeDeploy group and make some revisions to the code.