Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Latest commit

 

History

History

lab04-outputs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Lab 4: Outputs

Use outputs to get access to informations about the resources created by a stack.

Overview

  1. Create a CloudFormation template using outputs.
  2. Create a CloudFormation stack based on your template.

Instructions

Create a template

  1. Open stub.yaml with an editor of your choice. The stub file contains a skeleton to start from.
  2. Add InstanceId containing the instance-id of the EC2 instance to the outputs section (see Outputs section and Resource Type: EC2 instance).
  3. Launching the instance into a public subnet? Otherwise skip this step. Add PublicIPAddress containing the public IP address of the EC2 instance to the outputs section: Outputs section and Resource Type: EC2 instance).
  4. Launching the instance into a private subnet? Otherwise skip this step. Add PrivateIPAddress containing the private IP address of the EC2 instance to the outputs section: Outputs section and Resource Type: EC2 instance).

Create a stack based on the template

  1. Open CloudFormation in AWS Management Console.
  2. Click Create Stack button.
  3. Select Upload a template to Amazon S3.
  4. Choose the template file you created for this lab.
  5. Click Next button.
  6. Insert lab4-$usernameas stack name. Replace $usernamewith your username (e.g. lab4-awittig).
  7. Select a random subnet as parameter for Subnet.
  8. Insert t2.micro as parameter for InstanceType.
  9. Insert ami-bff32ccc (eu-west-1) or ami-bc5b48d0(eu-central-1) as parameter for AMI.
  10. Insert http://widdix.net/ or a website you own for URL.
  11. Click Next button.
  12. Skip next step by clicking on Next button.
  13. Review your input and click Create button.
  14. Wait until your stack reaches status CREATE_COMPLETE.
  15. Select your stack by clicking on row of the table.
  16. Change to the Outputs tab.
  17. Find value of InstanceId and note it down.
  18. Select the EC2 service from the main navigation.
  19. Search for an EC2 instance with the instance id from the outputs tab.
  20. Select the EC2 instance by clicking on the row of the table.
  21. Select the action Get System Log from the Actions menu hidden under Instance Settings.
  22. You will find the outputs from the load test in the logs.
  23. Switch back to the CloudFormation service.
  24. Select your stack by clicking on row of the table.
  25. Select Delete Stack from the Actions menu.
  26. Confirm the deletion of your stack.
  27. Congratulations! You are done with the lab!

Documentation

Sample solution

This lab includes a sample solution sample-solution.yaml. Use it if you are stuck during the creation of your template of if you want to review your results.