Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Laboratorio 5 Laboratorio 6
OBJETIVOS
https://labs.netec.com/pages/lab5.html 1/12
22/7/2021 AWS Labs
DURACIÓN
INICIAR LABORATORIO
Networking
Application
Database
https://labs.netec.com/pages/lab5.html 2/12
22/7/2021 AWS Labs
Note: If you want to see how resources are defined, you can open
the template in a text editor.
Upload a template file: Click Choose file and select the lab-
network.yaml file you downloaded.
Click Next
Click Next
Tags:
Key: application
Value: inventory
Click Next
STEP 4: REVIEW
https://labs.netec.com/pages/lab5.html 3/12
22/7/2021 AWS Labs
Note: Click the refresh icon every 15 seconds to update the display
if necessary.
Note: If the list is empty, click the refresh icon to update the list.
The listing shows (in reverse chronological order) the activities that
AWS CloudFormation performed, such as starting to create a
resource and then completing the resource creation. Any errors
encountered during the creation of the stack will be listed in this
tab.
VPC: The value is the ID of the VPC that was created (for
example, vpc-08e2b7d1272ee9fb4)
The Outputs tab can also provide values that other stacks will use.
The Export name column shows these values. In this case, the
VPC and subnet IDs are given an export name so that other stacks
can retrieve the values and build resources inside the VPC and
subnet. You will use these values in the next task.
This tab shows the template that was used to create the stack. In
this case, it shows the template that you uploaded while creating
the stack. Feel free to examine the template and see the resources
that were created. The Outputs section at the end of the template
defined the values to export.
https://labs.netec.com/pages/lab5.html 4/12
22/7/2021 AWS Labs
The AWS CloudFormation template will import the VPC and subnet
IDs from the outputs of the existing AWS CloudFormation stack.
The template will then use this information to create the security
group in the VPC and the EC2 instance in the subnet.
Note: If you want to see how resources are defined, you can open
the template in a text editor.
Note: You may need to expand the navigation pane by clicking the
menu icon.
10. Click Create stack and then With new resources (standard)
Upload a template file: Click Choose file and select the lab-
application.yaml file you downloaded.
Click Next
Click Next
Tags:
https://labs.netec.com/pages/lab5.html 5/12
22/7/2021 AWS Labs
Key: application
Value: inventory
Click Next
STEP 4: REVIEW
12. Wait for the Status (on the Stack info tab) to change to
CREATE_COMPLETE.
14. Copy the URL that is displayed, open a new web browser tab,
paste the URL, and press ENTER
WebServerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId:
Fn::ImportValue:
!Sub ${NetworkStackName}-VPCID
SubnetId:
Fn::ImportValue:
https://labs.netec.com/pages/lab5.html 6/12
22/7/2021 AWS Labs
!Sub ${NetworkStackName}-SubnetID
The template takes the subnet ID from the lab-network stack and
uses it in the lab-application stack to launch the instance into the
public subnet that the first stack created.
18. On the lower half of the page, click the Inbound rules tab.
The security group currently only has one rule, which permits HTTP
traffic.
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
https://labs.netec.com/pages/lab5.html 7/12
22/7/2021 AWS Labs
Upload a template file: Click Choose file and select the lab-
application2.yaml file you downloaded.
In the Change set preview section at the bottom of the page, AWS
CloudFormation displays the resources that will be updated, as
shown in the following image:
25. Wait for the Status (in the Stack info tab) to change
UPDATE_COMPLETE.
Note: Click the refresh icon every 15 seconds to update the display
if necessary.
26. Return to the EC2 console. In the left navigation pane, click
Security Groups.
The Inbound rules tab displays an additional rule for SSH traffic.
You may need to expand the navigation pane by clicking the menu
icon.
30. Use the file menu in the top left corner to open a Local file
and select the lab-application2.yaml template you
downloaded previously.
https://labs.netec.com/pages/lab5.html 9/12
22/7/2021 AWS Labs
32. When you're done, click close in the upper left corner
You can specify a deletion policy for resources. Such a policy can
preserve or (in some cases) back up a resource when its stack is
deleted. This is useful for retaining databases, disk volumes, or any
resource that might be required after stack deletion.
DiskVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
AvailabilityZone: !GetAtt
WebServerInstance.AvailabilityZone
Tags:
- Key: Name
DeletionPolicy: Snapshot
https://labs.netec.com/pages/lab5.html 10/12
22/7/2021 AWS Labs
You will now delete the lab-application stack and see the results of
this deletion policy.
You can monitor the deletion process in the Events tab and update
the screen by clicking the refresh icon occasionally. You might also
see a reference to the Amazon EBS snapshot being created.
Now, check that a snapshot was created of the EBS volume before it
was deleted.
You should see a snapshot with a Started time in the last few minutes.
CLEAN UP RESOURCES
43. Select the only remaining stack and click Delete at the top right.
CONCLUSION
https://labs.netec.com/pages/lab5.html 11/12
22/7/2021 AWS Labs
END LAB
Click to go up
https://labs.netec.com/pages/lab5.html 12/12