Labs For Sys Ops 2 Class
Lab 1- Bootstrap An Instance/ Create Web Server
- Create a Amazon linux 2, free tier instance and pass the following in user data field:
#!/bin/bash
yum update -y
amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
yum install -y httpd mariadb-server
systemctl start httpd
systemctl enable httpd
usermod -a -G apache ec2-user
chown -R ec2-user:apache /var/www
chmod 2775 /var/www
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
2. Add an inbound security group rule for http traffic over port 80 when creating the instance
3. Test the link modify the url with your public dns information for your instance http://my.public.dns.amazonaws.com/phpinfo.php
Lab 2- CloudFormation
Part 1 create a stack with cloud formation- Template default is Oregon region
- create a stack with cloud formation using the cloud formation template for DynamoDB table
- Enter your settings for your Primary Key- Set Primary key id to ProductID
- Review your settings and create your stack
Part 2 Initiate a change set for your stack
- Initiate a change set and Update template in the console - change the Primary Key ID
- Execute the change set relaunch
CloudFormation URL To Template
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/sample-templates-services-us-west-2.html#w2ab1c27c58c13c15
Lab 3- Elastic Bean Lab
1. Deploy an application package to elastic beanstalk
Elastic Beanstalk Sample Deployment File
Deploying a New Application Elasticbeanstalk
Lab 4- CodeCommit Lab
- Login to the AWS Console and go to CodeCommit under developer tools
- Step 1: Create an AWS CodeCommit Repository
- Step 2: Add Files to Your Repository
- Step 3: Browse the Contents of Your Repository
- Step 4: Create and Collaborate on a Pull Request
- We will stop this lab at step 4 and clean up at the end of the day
To Delete Your Repository:
To delete the AWS CodeCommit repository
-
Open the AWS CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.
-
In Repositories, choose the repository you want to delete. If you followed the naming convention in the lab, it is named MyDemoRepo.
-
In the navigation pane, choose Settings.
-
On the Settings page, in Delete repository, choose Delete repository.
-
Type
delete
, and then choose Delete. The repository is permanently deleted.
Lab 5- CodePipeline Lab- Use S3 as the source
Lab 6- Part 1 Autoscaling Lab
- Make an AMI in the console of your bootstrapped web server from lab 1
From the EC2 menu go to Instances, select your instance, and then choose
Actions,Image, Create Image.
2. Create a classic load balancer
3. Setup Autoscaling with our created AMI and Load Balancer, add a security group rule for http and https traffic.
- Navigate to the EC2 menu and select AutoScaling Groups towards the end of the page
- Click the blue “create auto scaling group” button from the top of the autoscaling group page
- After going through the wizard to create a launch template Create an autoscaling group with these instructions
- Verify your autoscaling group
- At the end of class Delete your autoscaling infrastructure
Part 2 Vertical scaling demo
- EC2 Instances
- EBS Volumes
Lab 7 - ECS Elastic Container Service Lab
Lab 8 Kinesis Lab
*Kinesis Lab must be completed in northern va region
S3 Url for lab: https://s3.amazonaws.com/kinesis-demo-bucket/amazon-kinesis-data-visualization-sample/kinesis-data-vis-sample-app.template
- Create The Kinesis Streams Data Visualization Sample Application In CloudFormation
- View The Kinesis Stream Details
- View The Created DynamoDB Tables
Alternate Kinesis lab:
Lab 9- Lambda Lab
1. Run a Serverless “Hello, World!
We will clean up at the end of class
PDF of class book
Exam prep guide