├── LICENSE ├── README.md ├── demos └── Elastic Beanstalk.txt └── labs ├── creating-a-static-website-using-amazon-s3 ├── error.html └── index.html ├── creating-an-auto-scaling-group-and-app-load-balancer-aws ├── acg.jpg └── index.html ├── creating-and-working-with-an-ec2-instance └── README.md ├── getting_started_with_cfn ├── createstack.json ├── templatestructure.json ├── templatestructure.yaml ├── updatestack1.json └── updatestack2.json └── scaling-ec2-using-sqs ├── README.md ├── receive_messages.py ├── requirements.txt └── send_messages.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 A Cloud Guru 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AWS Certified Solutions Architect - Associate 2 | -------------------------------------------------------------------------------- /demos/Elastic Beanstalk.txt: -------------------------------------------------------------------------------- 1 | # Lesson: Elastic Beanstalk 2 | # URL: https://learn.acloud.guru/course/certified-solutions-architect-associate/learn/21359b7a-a8b4-4d08-8e30-48623869199f/e3662bd5-361e-43a7-9afc-c2c2f5c921e2/watch 3 | 4 | # To create your example application, you'll use the 'Create application' console wizard. It creates an Elastic Beanstalk application and launches an environment within it. An environment is the collection of AWS resources required to run your application code. 5 | 6 | # To create a service role for Elastic Beanstalk: 7 | 8 | 1. Open the Identity and Access Management (IAM) console. 9 | 2. Click 'Roles'. 10 | 3. Click 'Create role'. 11 | 4. Under 'Use cases for other AWS services', choose 'Elastic Beanstalk' and select 'Elastic Beanstalk - Customizable'. 12 | 5. Click 'Next'. 13 | 6. For 'Role name', type 'CustomServiceRoleForElasticBeanstalk'. 14 | 7. Click 'Create role'. 15 | 16 | # To create an EC2 instance profile for Elastic Beanstalk: 17 | 18 | 1. Open the Identity and Access Management (IAM) console. 19 | 2. Click 'Roles'. 20 | 3. Click 'Create role'. 21 | 4. Under 'Common use cases', choose 'EC2'. 22 | 5. Click 'Next'. 23 | 6. Select the 'AWSElasticBeanstalkReadOnly' policy name. 24 | 7. Click 'Next'. 25 | 8. For 'Role name', type 'CustomEC2InstanceProfileForElasticBeanstalk'. 26 | 9. Click 'Create role'. 27 | 28 | # To create an example application: 29 | 30 | 1. Open the Elastic Beanstalk console. 31 | 2. Click 'Create application'. 32 | 3. For Application name enter 'beansarefun'. 33 | 4. For Platform, choose 'Python'. 34 | 5. Click 'Next'. 35 | 6. For 'Use an existing service role', choose 'CustomServiceRoleForElasticBeanstalk'. 36 | 7. For 'EC2 instance profile', choose CustomEC2InstanceProfileForElasticBeanstalk'. 37 | 8. Click 'Next'. 38 | 9. On the 'Set up networking, database, and tags - optional' page, click 'Next'. 39 | 10. On the 'Configure instance traffic and scaling - optional' page, click 'Next'. 40 | 11. On the 'Configure updates, monitoring, and logging - optional' page, under 'System' choose 'Basic', and under 'Managed platform updates' > 'Managed updates', uncheck the 'Activated' box. Click 'Next'. 41 | 12. The Review page displays a summary of all your choices. Choose 'Submit' at the bottom of the page. 42 | 13. Wait for the 'Successfully launched environment: Beansarefun-env' event and check the URL available under 'Environment overview' > 'Domain'. 43 | -------------------------------------------------------------------------------- /labs/creating-a-static-website-using-amazon-s3/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Creating a Static Website Using Amazon S3 8 | 9 | 11 | 12 | 38 | 39 | 40 | 41 | 75 | 76 |
77 | 78 |
79 |

Error

80 |

Did you mean to go to index.html?

81 |

82 |
83 | 84 | 87 | 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /labs/creating-a-static-website-using-amazon-s3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Creating a Static Website Using Amazon S3 8 | 9 | 11 | 12 | 37 | 38 | 39 | 40 | 74 | 75 |
76 | 77 |
78 |

Creating a Static Website Using Amazon S3

79 |

In this live AWS hands-on lab, we will create and configure a simple static website. We will go 80 | through configuring that static website with a custom error page. This will demonstrate how to create very 81 | cost-efficient website hosting for sites that consist of files like HTML, CSS, JavaScript, fonts, and images. 82 |

83 |
84 | 85 | 88 | 89 |
90 | 91 | 94 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /labs/creating-an-auto-scaling-group-and-app-load-balancer-aws/acg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ACloudGuru-Resources/Course-Certified-Solutions-Architect-Associate/c1a280473f4404de3744c36366199c0d5eef13b7/labs/creating-an-auto-scaling-group-and-app-load-balancer-aws/acg.jpg -------------------------------------------------------------------------------- /labs/creating-an-auto-scaling-group-and-app-load-balancer-aws/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | A Cloud Guru 4 | 5 | 6 | pinehead 7 | 8 | -------------------------------------------------------------------------------- /labs/creating-and-working-with-an-ec2-instance/README.md: -------------------------------------------------------------------------------- 1 | # Lab: Creating and Working with an EC2 Instance 2 | -------------------------------------------------------------------------------- /labs/getting_started_with_cfn/createstack.json: -------------------------------------------------------------------------------- 1 | { 2 | "Resources": { 3 | "catpics": { 4 | "Type": "AWS::S3::Bucket" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /labs/getting_started_with_cfn/templatestructure.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion" : "2010-09-09", 3 | 4 | "Description" : "this template does XXXX", 5 | 6 | "Metadata" : { 7 | 8 | }, 9 | 10 | "Parameters" : { 11 | 12 | }, 13 | 14 | "Mappings" : { 15 | 16 | }, 17 | 18 | "Conditions" : { 19 | 20 | }, 21 | 22 | "Transform" : { 23 | 24 | }, 25 | 26 | "Resources" : { 27 | 28 | }, 29 | 30 | "Outputs" : { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /labs/getting_started_with_cfn/templatestructure.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: "2010-09-09" 3 | 4 | Description: 5 | this template does XXXX 6 | 7 | Metadata: 8 | template metadata 9 | 10 | Parameters: 11 | set of parameters 12 | 13 | Mappings: 14 | set of mappings 15 | 16 | Conditions: 17 | set of conditions 18 | 19 | Transform: 20 | set of transforms 21 | 22 | Resources: 23 | set of resources 24 | 25 | Outputs: 26 | set of outputs 27 | -------------------------------------------------------------------------------- /labs/getting_started_with_cfn/updatestack1.json: -------------------------------------------------------------------------------- 1 | { 2 | "Resources": { 3 | "catpics": { 4 | "Type": "AWS::S3::Bucket" 5 | }, 6 | "dogpics": { 7 | "Type": "AWS::S3::Bucket" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /labs/getting_started_with_cfn/updatestack2.json: -------------------------------------------------------------------------------- 1 | { 2 | "Resources": { 3 | "catpics": { 4 | "Type": "AWS::S3::Bucket", 5 | "Properties": { 6 | "BucketName": "catsareawesome123" 7 | } 8 | }, 9 | "dogpics": { 10 | "Type": "AWS::S3::Bucket" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /labs/scaling-ec2-using-sqs/README.md: -------------------------------------------------------------------------------- 1 | # Lab: Scaling EC2 Using SQS 2 | -------------------------------------------------------------------------------- /labs/scaling-ec2-using-sqs/receive_messages.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import logging 4 | import time 5 | 6 | import boto3 7 | from botocore.exceptions import ClientError 8 | 9 | QUEUE_NAME = "Messages" 10 | 11 | logging.basicConfig(format="[%(levelname)s] %(message)s", level="INFO") 12 | sqs = boto3.client("sqs") 13 | 14 | try: 15 | logging.info(f"Getting queue URL for queue: {QUEUE_NAME}") 16 | response = sqs.get_queue_url(QueueName=QUEUE_NAME) 17 | except ClientError as e: 18 | logging.error(e) 19 | exit(1) 20 | 21 | queue_url = response["QueueUrl"] 22 | logging.info(f"Queue URL: {queue_url}") 23 | 24 | logging.info("Receiving messages from queue...") 25 | 26 | while True: 27 | messages = sqs.receive_message(QueueUrl=queue_url, MaxNumberOfMessages=10) 28 | if "Messages" in messages: 29 | for message in messages["Messages"]: 30 | logging.info(f"Message body: {message['Body']}") 31 | time.sleep(1) # simulate work 32 | sqs.delete_message( 33 | QueueUrl=queue_url, ReceiptHandle=message["ReceiptHandle"] 34 | ) 35 | else: 36 | logging.info("Queue is now empty") 37 | -------------------------------------------------------------------------------- /labs/scaling-ec2-using-sqs/requirements.txt: -------------------------------------------------------------------------------- 1 | boto3 -------------------------------------------------------------------------------- /labs/scaling-ec2-using-sqs/send_messages.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import logging 5 | import sys 6 | import uuid 7 | from time import sleep 8 | 9 | import boto3 10 | from botocore.exceptions import ClientError 11 | 12 | parser = argparse.ArgumentParser() 13 | parser.add_argument("--queue-name", "-q", default="Messages", help="SQS queue name") 14 | parser.add_argument("--interval", "-i", default=0.1, help="timer interval", type=float) 15 | parser.add_argument("--message", "-m", help="message to send") 16 | parser.add_argument("--log", "-l", default="INFO", help="logging level") 17 | args = parser.parse_args() 18 | 19 | if args.log: 20 | logging.basicConfig(format="[%(levelname)s] %(message)s", level=args.log) 21 | else: 22 | parser.print_help(sys.stderr) 23 | 24 | sqs = boto3.client("sqs") 25 | 26 | try: 27 | logging.info(f"Getting queue URL for queue: {args.queue_name}") 28 | response = sqs.get_queue_url(QueueName=args.queue_name) 29 | except ClientError as e: 30 | logging.error(e) 31 | exit(1) 32 | 33 | queue_url = response["QueueUrl"] 34 | 35 | logging.info(f"Queue URL: {queue_url}") 36 | 37 | while True: 38 | try: 39 | message = str(uuid.uuid4()) 40 | logging.info("Sending message: " + message) 41 | response = sqs.send_message(QueueUrl=queue_url, MessageBody=message) 42 | logging.info("MessageId: " + response["MessageId"]) 43 | sleep(args.interval) 44 | except ClientError as e: 45 | logging.error(e) 46 | exit(1) 47 | --------------------------------------------------------------------------------