Code Commands and Reference Links PDF
Code Commands and Reference Links PDF
Code Commands and Reference Links PDF
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 1
Section 3
#!/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html
echo "This is a test page" > index.html
Additional information
AWS links:
https://aws.amazon.com/ec2/features/
https://aws.amazon.com/ec2/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 2
Section 3
curl http://169.254.169.254/latest/meta-data/
wget https://s3.amazonaws.com/ec2metadata/ec2-metadata
chmod u+x ec2-metadata
ec2-metadata -help
Additional information
AWS links:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 3
Section 3
#!/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html
echo "This is a test page running on Apache on EC2 in the AWS Cloud" > index.html
curl http://169.254.169.254/latest/user-data
Additional information
AWS links:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 4
Section 3
stress -c 8
Additional information
AWS links:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 5
Section 3
ssh -A ec2-user@private-IP-address
Additional information
AWS links:
https://aws.amazon.com/blogs/security/securely-connect-to-linux-instances-running-in-a-private-amazon-
vpc/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 6
Section 4
INSTANCE 2
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 7
Section 4
LESSON: Application Load Balancer – Path Based LESSON: Auto Scaling and ALB
Routing
#!/bin/bash #!/bin/bash
yum update -y yum update -y
yum install httpd -y yum install httpd -y
systemctl start httpd systemctl start httpd
systemctl enable httpd systemctl enable httpd
cd /var/www/html cd /var/www/html
aws s3 cp s3://dctlabs/names.csv ./ aws s3 cp s3://dctlabs/names.csv ./
aws s3 cp s3://dctlabs/index.txt ./ aws s3 cp s3://dctlabs/index.txt ./
EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs` EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs`
sed "s/INSTANCE/$EC2NAME/" index.txt > index.html sed "s/INSTANCE/$EC2NAME/" index.txt > index.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 8
Section 4
LESSON: ASG Scaling Policies LESSON: Cross-Zone Load Balancing Overview and Setting up
the Labs
sudo amazon-linux-extras install epel -y
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 9
Section 4
LESSON: CLB - Cross-Zone Load Balancing LESSON: CLB - Cross-Zone Load Balancing
#!/bin/bash #!/bin/bash
yum update -y yum update -y
yum install httpd -y yum install httpd -y
systemctl start httpd systemctl start httpd
systemctl enable httpd systemctl enable httpd
cd /var/www/html cd /var/www/html
aws s3 cp s3://dctlabs/names.csv ./ aws s3 cp s3://dctlabs/names.csv ./
aws s3 cp s3://dctlabs/index.txt ./ aws s3 cp s3://dctlabs/index.txt ./
EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs` EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs`
sed "s/INSTANCE/$EC2NAME/" index.txt > index.html sed "s/INSTANCE/$EC2NAME/" index.txt > index.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 10
Section 4
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 11
Section 4
LESSON: ALB Listeners and SSL TLS LESSON: Public ALB with Private Instances and Security Groups
#!/bin/bash #!/bin/bash
yum update -y yum update -y
yum install httpd -y yum install httpd -y
systemctl start httpd systemctl start httpd
systemctl enable httpd systemctl enable httpd
cd /var/www/html cd /var/www/html
aws s3 cp s3://dctlabs/names.csv ./ aws s3 cp s3://dctlabs/names.csv ./
aws s3 cp s3://dctlabs/index.txt ./ aws s3 cp s3://dctlabs/index.txt ./
EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs` EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs`
sed "s/INSTANCE/$EC2NAME/" index.txt > index.html sed "s/INSTANCE/$EC2NAME/" index.txt > index.html
Additional information
AWS links:
https://aws.amazon.com/premiumsupport/knowledge-center/public-load-balancer-private-ec2/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 12
Section 4
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/enable-proxy-protocol.html
https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-elb-listenerconfig-quickref.html
Additional information
AWS links:
https://aws.amazon.com/elasticloadbalancing/features/
https://aws.amazon.com/elasticloadbalancing/faqs/
https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html
https://aws.amazon.com/ec2/autoscaling/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 13
Section 5
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 14
Section 5
Additional information
AWS links:
https://aws.amazon.com/vpc/
https://aws.amazon.com/about-aws/global-infrastructure/
https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html
https://aws.amazon.com/transit-gateway/
https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html
https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html
https://aws.amazon.com/directconnect/features/
https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-gateways-intro.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 15
Section 6
https://digitalcloud.training/certification-training/aws-solutions-architect-associate/networking-and-content-delivery/amazon-route-53/
#!/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html
aws s3 cp s3://dctlabs/index.txt ./
EC2AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)
sed "s/INSTANCE/the EC2 instance in $EC2AZ/" index.txt > index.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 16
Section 6
Additional information
AWS links:
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 17
Section 7
https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 18
Section 7
https://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-alternatives-guidelines.html#when-to-use-acl
https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
https://aws.amazon.com/premiumsupport/knowledge-center/s3-multipart-upload-cli/
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html
https://docs.aws.amazon.com/AmazonS3/latest/user-guide/enable-transfer-acceleration.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 19
Section 7
https://dctstaticwebsite.s3-website-ap-southeast-2.amazonaws.com
http://dctstaticwebsite.s3-website-ap-southeast-2.amazonaws.com
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html
https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-expire-general-considerations.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 20
Section 7
LESSON: S3 Encryption
https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
#!/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html
aws s3 cp s3://dctlabs/names.csv ./
aws s3 cp s3://dctlabs/index.txt ./
EC2NAME=`cat ./names.csv|sort -R|head -n 1|xargs`
sed "s/INSTANCE/$EC2NAME/" index.txt > index.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 21
Section 7
Additional information
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 22
Section 8
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html#ebs-optimization-support
https://docs.aws.amazon.com/efs/latest/ug/accessing-fs-nfs-permissions-per-user-subdirs.html
Additional information
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 23
Section 9
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.html
https://docs.aws.amazon.com/AmazonECS/latest/userguide/docker-basics.html#install_docker
Additional information
AWS links:
https://aws.amazon.com/ecs/features/
https://aws.amazon.com/ecs/faqs/
https://aws.amazon.com/eks/features/
https://aws.amazon.com/eks/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 24
Section 10
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 25
Section 10
https://docs.aws.amazon.com/lambda/latest/dg/with-on-demand-https-example-configure-event-source_1.html
Additional information
AWS links:
https://aws.amazon.com/lambda/features/
https://aws.amazon.com/lambda/faqs/
https://aws.amazon.com/api-gateway/features/
https://aws.amazon.com/api-gateway/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 26
Section 11
WordPress:
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 27
Section 11
Edit config:
nano config.sample.inc.php
cp config.sample.inc.php config.inc.php
service httpd restart
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 28
Section 11
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 29
Section 11
Additional information
AWS links:
https://aws.amazon.com/rds/features/
https://aws.amazon.com/rds/faqs/
https://aws.amazon.com/dynamodb/features/
https://aws.amazon.com/dynamodb/faqs/
https://aws.amazon.com/elasticache/redis/
https://aws.amazon.com/elasticache/memcached/
https://aws.amazon.com/elasticache/faqs/
https://aws.amazon.com/redshift/features/
https://aws.amazon.com/redshift/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 30
Section 12
Additional information
AWS links:
https://aws.amazon.com/emr/features/
https://aws.amazon.com/emr/faqs/
https://aws.amazon.com/kinesis/
https://aws.amazon.com/kinesis/data-streams/faqs/
https://aws.amazon.com/kinesis/data-firehose/faqs/
https://aws.amazon.com/kinesis/data-analytics/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 31
Section 13
https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-subscribe-queue-sns-topic.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 32
Section 13
Additional information
AWS links:
https://aws.amazon.com/step-functions/features/
https://aws.amazon.com/step-functions/faqs/
https://aws.amazon.com/sns/features/
https://aws.amazon.com/sns/faqs/
https://aws.amazon.com/sqs/features/
https://aws.amazon.com/sqs/faqs/
https://aws.amazon.com/amazon-mq/features/
https://aws.amazon.com/amazon-mq/faqs/
https://aws.amazon.com/swf/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 33
Section 14
Additional information
AWS links:
https://aws.amazon.com/cloudformation/features/
https://aws.amazon.com/cloudformation/faqs/
https://aws.amazon.com/elasticbeanstalk/details/
https://aws.amazon.com/elasticbeanstalk/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 34
Section 15
Additional information
AWS links:
https://aws.amazon.com/cloudwatch/features/
https://aws.amazon.com/cloudwatch/faqs/
https://aws.amazon.com/cloudtrail/features/
https://aws.amazon.com/cloudtrail/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 35
Section 16
LESSON: CloudHSM
https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 36
Section 16
Additional information
AWS links:
https://aws.amazon.com/iam/features/
https://aws.amazon.com/iam/faqs/
https://aws.amazon.com/cognito/details/
https://aws.amazon.com/cognito/faqs/
https://aws.amazon.com/kms/features/
https://aws.amazon.com/kms/faqs/
https://aws.amazon.com/cloudhsm/features/
https://aws.amazon.com/cloudhsm/faqs/
https://aws.amazon.com/waf/features/
https://aws.amazon.com/waf/faqs/
https://aws.amazon.com/shield/features/
https://aws.amazon.com/shield/faqs/
© 2019 Digital Cloud Training - AWS Certified Solutions Architect Associate Hands-on Labs 37