AWS 190-[JAWS]-Lab - Automating Deployments with AWS CloudFormation

Описание к видео AWS 190-[JAWS]-Lab - Automating Deployments with AWS CloudFormation

#AWS 190-[JAWS]-Lab - Automating Deployments with AWS CloudFormation

Check out my GitHub Repository - https://github.com/MFMKURIA/More-AWS-...
Portfolio
1. http://markfrancismk.sciawareness.com...
2. https://d2taxcp5hluc5o.cloudfront.net/
Let's break down the CloudFormation lab assignment step-by-step, explaining each part in detail as if preparing for an AWS Cloud Computing Certification exam. I'll cover the tasks, explain the relevant AWS services, and provide potential exam questions with detailed answers.

Lab: Automation with CloudFormation

Objective
Learn to deploy and manage infrastructure using AWS CloudFormation by creating and modifying stacks with various AWS resources such as VPCs, Security Groups, S3 buckets, and EC2 instances.

---

Accessing the AWS Management Console

1. Start the Lab:
- Click "Start Lab" to begin. This will open the lab environment.
- Wait until you see "Lab status: ready" and close the panel.

2. Open the AWS Management Console:
- Click "AWS" to open the AWS Management Console in a new browser tab.
- If a pop-up blocker prevents the tab from opening, allow pop-ups from your browser.

Explanation: The AWS Management Console is a web-based user interface for managing AWS services. For this lab, you will use it to interact with AWS CloudFormation.

3. Arrange Tabs:
- Position the AWS Management Console tab next to these instructions for easier navigation.

Explanation: Having both tabs visible helps you follow along with the steps and check your work as you go.

---

Task 1: Deploy a CloudFormation Stack

1. Download the Template:
- Download `task1.yaml` by right-clicking the link.

Explanation: CloudFormation templates define the resources and configurations you want to deploy. YAML is a common format for these templates due to its readability.

2. Review the Template:
- Open `task1.yaml` in a text editor.

Template Structure:
- Parameters Section: Defines input values for the template. For example, IP address ranges for the VPC.
- Resources Section: Defines the AWS resources to create, such as a VPC and Security Group.
- Outputs Section: Provides information about the resources created, like the Security Group ID.

Explanation: Each section has a specific role in the template:
- Parameters: User-defined inputs.
- Resources: Actual AWS resources to be created.
- Outputs: Useful information about the created resources.

3. Deploy the Stack:
- Go to the CloudFormation service in the AWS Management Console.
- Click "Create stack" \ "Upload a template file."
- Upload `task1.yaml` and click "Next."
- Configure the stack with a name like "Lab" and use default parameter values.
- Click "Next" through the Options and Review pages.
- Click "Create stack."

Explanation: This process initiates the creation of resources defined in the template. The stack will enter the `CREATE_IN_PROGRESS` state and eventually transition to `CREATE_COMPLETE` when done.

4. Monitor the Stack:
- Check the "Events" tab for progress and errors.
- View the "Resources" tab to see created resources.
- Optionally, check the VPC in the VPC console.

Explanation: Monitoring helps you ensure resources are created correctly and troubleshoot if needed.

---

Task 2: Add an Amazon S3 Bucket to the Stack

1. Edit the Template:
- Modify `task1.yaml` to add an S3 bucket under the `Resources:` section.

Example Addition:
```yaml
Resources:
S3Bucket:
Type: AWS::S3::Bucket
```

Explanation: This YAML snippet defines an S3 bucket resource. The `Type` specifies the type of AWS resource being created. In this case, `AWS::S3::Bucket`.

2. Update the Stack:
- Go to the CloudFormation console, select the stack, and click "Update."
- Choose "Replace current template," upload the modified `task1.yaml`, and click "Next."
- Review the changes and click "Update stack."

Explanation: Updating the stack with a revised template adds new resources without affecting existing ones.

3. Verify the Bucket:
- Check the "Resources" tab for the new S3 bucket.
- Optionally, view the bucket in the S3 console.

Explanation: Verification ensures the new resource was created correctly.

---

Task 3: Add an Amazon EC2 Instance to the Stack

1. Update the Template:
- Add parameters and resource definitions for an EC2 instance.

Example Parameter Addition:
```yaml
Parameters:
AmazonLinuxAMIID:
Type: AWS::SSM::Parameter::Value/AWS::EC2::Image::Id\
Default: /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2
```

Example Resource Addition:
```yaml
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
ImageId: !Ref AmazonLinuxAMIID
InstanceType: t3.micro
SecurityGroupIds:
- !Ref AppSecurityGroup
SubnetId: !Ref PublicSubnet
Tags:
- Key: Name
Value: App Server
```

Комментарии

Информация по комментариям в разработке