Aws Lab Manual Final PDF
Aws Lab Manual Final PDF
Aws Lab Manual Final PDF
AWS Identity and Access Management (IAM) is a web service that enables Amazon Web
Services (AWS) customers to manage users and user permissions in AWS. With IAM, you can
centrally manage users, security credentials such as access keys, and permissions that
control which AWS resources users can access.
Topics covered
This lab will demonstrate:
cannot do in AWS. However, instead of being uniquely associated with one person, a
Role is intended to be assumable by anyone who needs it.
Manage federated users and their permissions: You can enable identity federation to
allow existing users in your enterprise to access the AWS Management Console, to call
AWS APIs and to access resources, without the need to create an IAM User for each
identity.
Duration
This lab takes approximately 40 minutes to complete.
1. At the top of these instructions, choose Start Lab to launch your lab.
A Start Lab panel opens displaying the lab status. In the Start Lab dialog box that opens,
note the AWS Region, as you will need to refer to it later in this lab.
2. Wait until you see the message "Lab status: ready", then click the X to close the Start
Lab panel.
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to
make it easier to follow the lab steps.
Business Scenario
For the remainder of this lab, you will work with these Users and Groups to enable
permissions supporting the following business scenario:
Your company is growing its use of Amazon Web Services, and is using many Amazon EC2
instances and a great deal of Amazon S3 storage. You wish to give access to new staff
depending upon their job function:
User In Group Permissions
user-
S3-Support Read-Only access to Amazon S3
1
user- EC2-
Read-Only access to Amazon EC2
2 Support
user- EC2- View, Start and Stop Amazon EC2
3 Admin instances
o Select user-1.
o At the bottom of the screen, choose Add Users.
In the Users tab you will see that user-1 has been added to the group.
You have hired user-2 into a role where they will provide support for Amazon EC2.
29.Using similar steps to the ones above, add user-2 to the EC2-Support group.
user-2 should now be part of the EC2-Support group.
30.Using similar steps to the ones above, add user-3 to the EC2-Admin group.
user-3 should now be part of the EC2-Admin group.
33.Copy the Sign-in URL for IAM users in this account to a text editor.
35.Paste the IAM users sign-in link into the address bar of your private browser session
and press Enter.
Next, you will sign-in as user-1, who has been hired as your Amazon S3 storage
support staff.
36.Sign-in with:
o IAM user name: user-1
o Password: Lab-Password1
38.Choose the name of the bucket that exists in the account and browse the contents.
Since your user is part of the S3-Support Group in IAM, they have permission to view a
list of Amazon S3 buckets and the contents.
Note: The bucket does not contain any objects.
Now, test whether they have access to Amazon EC2.
41.Sign user-1 out of the AWS Management Console by completing the following actions:
o At the top of the screen, choose user-1
o Choose Sign Out
42.Paste the IAM users sign-in link into your private browser tab's address bar and
press Enter.
Note: This link should be in your text editor.
43.Sign-in with:
o IAM user name: user-2
o Password: Lab-Password2
You will receive an error stating You are not authorized to perform this operation. This
demonstrates that the policy only allows you to view information, without making
changes.
50.Sign user-2 out of the AWS Management Console by completing the following actions:
o At the top of the screen, choose user-2
o Choose Sign Out
51.Paste the IAM users sign-in link into your private window and press Enter.
52.Paste the sign-in link into the address bar of your private web browser tab again. If it is
not in your clipboard, retrieve it from the text editor where you stored it earlier.
53.Sign-in with:
o IAM user name: user-3
o Password: Lab-Password3
Lab complete
Congratulations! You have completed the lab.
59.Choose End Lab at the top of this page, and then select Yes to confirm that you want to
end the lab.
A panel indicates that You may close this message box now...
Conclusion
Congratulations! You now have successfully:
Explored pre-created IAM users and groups
Inspected IAM policies as applied to the pre-created groups
Followed a real-world scenario, adding users to groups with specific capabilities
enabled
Located and used the IAM sign-in URL
Experimented with the effects of policies on service access
Amazon Virtual Private Cloud (Amazon VPC) enables you to launch Amazon Web Services
(AWS) resources into a virtual network that you defined. This virtual network closely
resembles a traditional network that you would operate in your own data center, with the
benefits of using the scalable infrastructure of AWS. You can create a VPC that spans multiple
Availability Zones.
After completing this lab, you should be able to do the following:
Create a VPC.
Create subnets.
Configure a security group.
Launch an EC2 instance into a VPC.
Duration
This lab takes approximately 30 minutes to complete.
Scenario
In this lab you build the following infrastructure:
1. At the top of these instructions, choose Start Lab to launch your lab.
A Start Lab panel opens displaying the lab status.
2. Wait until you see the message "Lab status: ready", then choose the X to close the Start
Lab panel
3. At the top of these instructions, choose AWS
This will open the AWS Management Console in a new browser tab. The system will
automatically log you in.
Tip: If a new browser tab does not open, there will typically be a banner or icon at the
top of your browser indicating that your browser is preventing the site from opening
pop-up windows. Choose on the banner or icon and choose "Allow pop ups."
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to
make it easier to follow the lab steps.
5. In the search box to the right of Services, search for and choose VPC to open the VPC
console.
6. Begin creating a VPC.
o In the top left of the screen, verify the New VPC Experience is toggled on. If it is
not, toogle it on now.
o Choose the VPC dashboard link which is also towards the top left of the console.
o Next, choose Create VPC.
Note: If you do not see a button with that name, choose the Launch VPC Wizard
button instead.
7. Configure the VPC details in the VPC settings panel on the left:
o Choose VPC and more.
o Under Name tag auto-generation, keep Auto-generate selected, however change
the value from project to lab .
o Keep the IPv4 CIDR block set to 10.0.0.0/16
o For Number of Availability Zones, choose 1.
o For Number of public subnets, keep the 1 setting.
o For Number of private subnets, keep the 1 setting.
o Expand the Customize subnets CIDR blocks section
Change Public subnet CIDR block in us-east-1a to 10.0.0.0/24
8. In the Preview panel on the right, confirm the settings you have configured.
o VPC: lab-vpc
o Subnets:
us-east-1a
Public subnet name: lab-subnet-public1-us-east-1a
Private subnet name: lab-subnet-private1-us-east-1a
o Route tables
lab-rtb-public
lab-rtb-private1-us-east-1a
o Network connections
lab-igw
lab-nat-public1-us-east-1a
23.Select the lab-rtb-public route table (and deselect any other subnets).
33.Scroll to the bottom of the page and choose Create security group
You will use this security group in the next task when launching an Amazon EC2
instance.
34.In the search box to the right of Services, search for and choose EC2 to open the EC2
console.
#!/bin/bash
# Install Apache Web Server and PHP
yum install -y httpd mysql php
# Download Lab files
wget https://aws-tc-largeobjects.s3.us-west-2.amazonaws.com/CUR-TF-100-ACCLFO-2/2-lab2-
vpc/s3/lab-app.zip
unzip lab-app.zip -d /var/www/html/
# Turn on web server
chkconfig httpd on
service httpd start
This script will run with root user permissions on the guest OS of the instance. It
will run automatically when the instance launches for the first time. The script
installs a web server, a database, and PHP libraries, and then it downloads and
installs a PHP web application on the web server.
43.At the bottom of the Summary panel on the right side of the screen choose Launch
instance
You will see a Success message.
45.Wait until Web Server 1 shows 2/2 checks passed in the Status check column.
This may take a few minutes. Choose the refresh icon at the top of the page every 30
seconds or so to more quickly become aware of the latest status of the instance.
You will now connect to the web server running on the EC2 instance.
47.Copy the Public IPv4 DNS value shown in the Details tab at the bottom of the page.
48.Open a new web browser tab, paste the Public DNS value and press Enter.
You should see a web page displaying the AWS logo and instance meta-data values.
The complete architecture you deployed is:
Lab Complete
49.Choose End Lab at the top of this page and then choose Yes to confirm that you want to
end the lab.
A panel will appear, indicating that "DELETE has been initiated... You may close this
message box now."
This lab provides you with a basic overview of launching, resizing, managing, and monitoring
an Amazon EC2 instance.
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable
compute capacity in the cloud. It is designed to make web-scale cloud computing easier for
developers.
Amazon EC2's simple web service interface allows you to obtain and configure capacity with
minimal friction. It provides you with complete control of your computing resources and lets
you run on Amazon's proven computing environment. Amazon EC2 reduces the time
required to obtain and boot new server instances to minutes, allowing you to quickly scale
capacity, both up and down, as your computing requirements change.
Amazon EC2 changes the economics of computing by allowing you to pay only for capacity
that you actually use. Amazon EC2 provides developers the tools to build failure resilient
applications and isolate themselves from common failure scenarios.
Duration
This lab takes approximately 35 minutes to complete.
2. Wait until you see the message "Lab status: ready", then choose the X to close the Start
Lab panel.
3. At the top of these instructions, choose AWS
This will open the AWS Management Console in a new browser tab. The system will
automatically log you in.
Tip: If a new browser tab does not open, there will typically be a banner or icon at the
top of your browser indicating that your browser is preventing the site from opening
pop-up windows. Choose on the banner or icon and choose "Allow pop ups."
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to
make it easier to follow the lab steps.
5. In the AWS Management Console in the search box to the right of Services, choose
Compute and then choose EC2.
Note: Verify that your EC2 console is currently managing resources in the N. Virginia
(us-east-1) region. You can verify this by looking at the drop down menu at the top of
the screen, to the left of your username. If it does not already indicate N. Virginia,
choose the N. Virginia region from the region menu before proceeding to the next step.
Amazon EC2 then installs the key on the guest OS when the instance is launched. That
way, when you attempt to login to the instance and you provide the private key, you
will be authorized to connect to the instance.
Note: In this lab you will not actually use the key pair you have specified to log into
your instance.
14.Under Firewall (security groups), choose Create security group and configure:
o Security group name: Web Server security group
o Description: Security group for my web server
A security group acts as a virtual firewall that controls the traffic for one or more
instances. When you launch an instance, you associate one or more security
groups with the instance. You add rules to each security group that allow traffic
to or from its associated instances. You can modify the rules for a security group
at any time; the new rules are automatically applied to all instances that are
associated with the security group.
o Under Inbound security group rules, notice that one rule exists. Remove this rule.
termination protection for the instance, which prevents it from being terminated as
long as this setting remains enabled.
18. Scroll to the bottom of the page and then copy and paste the code shown below into
the User data box:
When you launch an instance, you can pass user data to the instance that can be used
to perform automated installation and configuration tasks after the instance starts.
Your instance is running Amazon Linux 2. The shell script you have specified will run as
the root guest OS user when the instance starts. The script will:
o Install an Apache web server (httpd)
o Configure the web server to automatically start on boot
o Run the Web server once it has finished installing
o Create a simple web page
26.Choose Cancel.
27.Ensure Web Server is still selected. Then, in the Actions menu, select Monitor and
troubleshoot Get instance screenshot.
This shows you what your Amazon EC2 instance console would look like if a screen
were attached to
it.
If you are unable to reach your instance via SSH or RDP, you can capture a screenshot
of your instance and view it as an image. This provides visibility as to the status of the
instance, and allows for quicker troubleshooting.
28.Choose Cancel.
Congratulations! You have explored several ways to monitor your instance.
Task 3: Update Your Security Group and Access the Web Server
When you launched the EC2 instance, you provided a script that installed a web server and
created a simple web page. In this task, you will access content from the web server.
31.Open a new tab in your web browser, paste the IP address you just copied, then press
Enter.
Question: Are you able to access your web server? Why not?
You are not currently able to access your web server because the security group is not
permitting inbound traffic on port 80, which is used for HTTP web requests. This is a
demonstration of using a security group as a firewall to restrict the network traffic that
is allowed in and out of an instance.
To correct this, you will now update the security group to permit web traffic on port 80.
32.Keep the browser tab open, but return to the EC2 Console tab.
36.Choose Edit inbound rules , select Add rule and then configure:
o Type: HTTP
o Source: Anywhere-IPv4
o Choose Save rules
37.Return to the web server tab that you previously opened and refresh the page.
You should see the message Hello From Your Web Server!
Congratulations! You have successfully modified your security group to permit HTTP
traffic into your Amazon EC2 Instance.
40.Choose Stop
Your instance will perform a normal shutdown and then will stop running.
45.Change the size to: 10 NOTE: You may be restricted from creating large Amazon EBS
volumes in this lab.
46.Choose Modify
47.Choose Modify again to confirm and increase the size of the volume.
53.From the All limits drop down list, choose Running instances.
Notice that there are limits on the number and types of instances that can run in a
region. For example, there is a limit on the number of Running On-Demand Standard...
instances that you can launch in this region. When launching instances, the request
must not cause your usage to exceed the instance limits currently defined in that
region.
You can request an increase for many of these limits.
55.Select the Web Server instance and in the Instance state menu, select Terminate
instance.
Note that there is a message that says: Failed to terminate the instance i-1234567xxx.
The instance 'i-1234567xxx' may not be terminated. Modify its 'disableApiTermination'
instance attribute and try again.
This is a safeguard to prevent the accidental termination of an instance. If you really
want to terminate the instance, you will need to disable the termination protection.
57.In the Actions menu, select Instance settings Change termination protection.
59.Choose Save
You can now terminate the instance.
60.Select the Web Server instance again and in the Instance state menu, select Terminate
instance.
61.Choose Terminate
Congratulations! You have successfully tested termination protection and terminated
your instance.
Lab Complete
Congratulations! You have completed the lab.
62.Choose End Lab at the top of this page and then choose Yes to confirm that you want to
end the lab.
A panel will appear, indicating that "DELETE has been initiated... You may close this
message box now."
This lab focuses on Amazon Elastic Block Store (Amazon EBS), a key underlying storage
mechanism for Amazon EC2 instances. In this lab, you will learn how to create an Amazon
EBS volume, attach it to an instance, apply a file system to the volume, and then take a
snapshot backup.
Topics covered
By the end of this lab, you will be able to:
Create an Amazon EBS volume
Attach and mount your volume to an EC2 instance
Create a snapshot of your volume
Create a new volume from your snapshot
Attach and mount the new volume to your EC2 instance
Lab Pre-requisites
To successfully complete this lab, you should be familiar with basic Amazon EC2 usage and
with basic Linux server administration. You should feel comfortable using the Linux
command-line tools.
Duration
This lab will require approximately 30 minutes to complete.
Amazon Elastic Block Store (Amazon EBS) offers persistent storage for Amazon EC2 instances.
Amazon EBS volumes are network-attached and persist independently from the life of an
instance. Amazon EBS volumes are highly available, highly reliable volumes that can be
leveraged as an Amazon EC2 instances boot partition or attached to a running Amazon EC2
instance as a standard block device.
When used as a boot partition, Amazon EC2 instances can be stopped and subsequently
restarted, enabling you to pay only for the storage resources used while maintaining your
instance's state. Amazon EBS volumes offer greatly improved durability over local Amazon
EC2 instance stores because Amazon EBS volumes are automatically replicated on the
backend (in a single Availability Zone).
For those wanting even more durability, Amazon EBS provides the ability to create point-in-
time consistent snapshots of your volumes that are then stored in Amazon Simple Storage
Service (Amazon S3) and automatically replicated across multiple Availability Zones. These
snapshots can be used as the starting point for new Amazon EBS volumes and can protect
your data for long-term durability. You can also easily share these snapshots with co-workers
and other AWS developers.
This lab guide explains basic concepts of Amazon EBS in a step-by-step fashion. However, it
can only give a brief overview of Amazon EBS concepts. For further information, see
the Amazon EBS documentation.
2. Wait until you see the message "Lab status: ready", then click the X to close the Start
Lab panel.
3. At the top of these instructions, click AWS
This will open the AWS Management Console in a new browser tab. The system will
automatically log you in.
Tip: If a new browser tab does not open, there will typically be a banner or icon at the
top of your browser indicating that your browser is preventing the site from opening
pop-up windows. Choose the banner or icon and choose "Allow pop ups."
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to
make it easier to follow the lab steps.
7. Note the Availability Zone of the instance. It will look similar to us-east-1a.
8. In the left navigation pane, choose Volumes.
You will see an existing volume that is being used by the Amazon EC2 instance. This
volume has a size of 8 GiB, which makes it easy to distinguish from the volume you will
create next, which will be 1 GiB in size.
11.Select My Volume.
13.Choose the Instance field, then select the instance that appears (Lab).
Note that the Device field is set to /dev/sdf. You will use this device identifier in a later
task.
17.Open putty.exe
23.Read through all the instructions in this one step before you start to complete the
actions, because you will not be able see these instructions when the Details panel is
open.
o Choose the Details drop down menu above these instructions you are currently
reading, and then choose Show . A Credentials window will open.
o Choose the Download button and save the labsuser.pem file.
o Then exit the Details panel by choosing the X.
24.Open a terminal window, and change directory cd to the directory where the
labsuser.pem file was downloaded.
For example, run this command, if it was saved to your Downloads directory:
cd ~/Downloads
25.Change the permissions on the key to be read only, by running this command:
chmod 400 labsuser.pem
26.Return to the AWS Management Console, and in the EC2 service, choose Instances.
The Lab instance should be selected.
27.In the Details tab, copy the Public IPv4 address value.
28.Return to the terminal window and run this command (replace <public-ip> with the
actual public IP address you copied):
Raghu Educational Society Roll No:
Exp No:
29.Type yes when prompted to allow a first connection to this remote SSH server.
Because you are using a key pair for authentication, you will not be prompted for a
password.
To configure the Linux instance to mount this volume whenever the instance is started,
you will need to add a line to /etc/fstab.
echo "/dev/sdf /mnt/data-store ext
34.View the configuration file to see the setting on the last line:
cat /etc/fstab
36.On your mounted volume, create a file and add some text to it.
sudo sh -c "echo some text has been
38.In the AWS Management Console, choose Volumes and select My Volume.
42.In your remote SSH session, delete the file that you created on your volume.
sudo rm /mnt/data-store/file.txt
sudo rm /mnt/data-store/file.txt
46.For Availability Zone Select the same availability zone that you used earlier.
51.Choose the Instance field, then select the (Lab) instance that appears.
Note that the Device field is set to /dev/sdg. You will use this device identifier in a later
task.
55.Verify that volume you mounted has the file that you created earlier.
ls /mnt/data-store2/
Conclusion
Congratulations! You now have successfully:
Created an Amazon EBS volume
Attached the volume to an EC2 instance
Created a file system on the volume
Added a file to volume
Created a snapshot of your volume
Created a new volume from the snapshot
Attached and mounted the new volume to your EC2 instance
Verified that the file you created earlier was on the newly created volume
Lab Complete
Congratulations! You have completed the lab.
56.Choose End Lab at the top of this page and then click Yes to confirm that you want to
end the lab.
A panel will appear, indicating that "DELETE has been initiated... You may close this
message box now."
Objectives
After completing this lab, you can:
Launch an Amazon RDS DB instance with high availability.
Configure the DB instance to permit connections from your web server.
Open a web application and interact with your database.
Duration
This lab takes approximately 30 minutes.
Scenario
You start with the following infrastructure:
The data is being persisted to the database and is automatically replicating to the
second Availability Zone.
Lab Complete
Congratulations! You have completed the lab.
37.Choose End Lab at the top of this page and then choose Yes to confirm that you want
to end the lab.
A panel will appear, indicating that "DELETE has been initiated... You may close this
message box now."
38.Choose the X in the top right corner to close the panel.
Elastic Load Balancing automatically distributes incoming application traffic across multiple
Amazon EC2 instances. It enables you to achieve fault tolerance in your applications by
seamlessly providing the required amount of load balancing capacity needed to route
application traffic.
Auto Scaling helps you maintain application availability and allows you to scale your Amazon
EC2 capacity out or in automatically according to conditions you define. You can use Auto
Scaling to help ensure that you are running your desired number of Amazon EC2 instances.
Auto Scaling can also automatically increase the number of Amazon EC2 instances during
demand spikes to maintain performance and decrease capacity during lulls to reduce costs.
Auto Scaling is well suited to applications that have stable demand patterns or that
experience hourly, daily, or weekly variability in usage.
Objectives
After completing this lab, you can:
Create an Amazon Machine Image (AMI) from a running instance.
Create a load balancer.
Create a launch configuration and an Auto Scaling group.
Automatically scale new instances within a private subnet
Create Amazon CloudWatch alarms and monitor performance of your infrastructure.
Duration
This lab takes approximately 30 minutes.
Scenario
You start with the following infrastructure:
This will open the AWS Management Console in a new browser tab. The system will
automatically log you in.
Tip: If a new browser tab does not open, there will typically be a banner or icon at the
top of your browser indicating that your browser is preventing the site from opening
pop-up windows. Click on the banner or icon and choose "Allow pop ups."
4. Arrange the AWS Management Console tab so that it displays along side these
instructions. Ideally, you will be able to see both browser tabs at the same time, to
make it easier to follow the lab steps.
43.Review the details of your Auto Scaling group, then click Create Auto Scaling group. If you
encounter an error Failed to create Auto Scaling group, then click Retry Failed Tasks.
Your Auto Scaling group will initially show an instance count of zero, but new instances
will be launched to reach the Desired count of 2 instances.
Lab Complete
65.Click End Lab at the top of this page and then click Yes to confirm that you want to end
the lab.
A panel will appear, indicating that "DELETE has been initiated... You may close this
message box now."
66.Click the X in the top right corner to close the panel.