Skip to content

Level 200: Automated Deployment of VPC

Authors

  • Ben Potter, Security Lead, Well-Architected

Table of Contents

  1. Overview
  2. Create VPC Stack
  3. Knowledge Check
  4. Tear Down

1. Overview

architecture

2. Create VPC Stack

This step will create the VPC and all components using the example CloudFormation template.

  1. Download the latest version of the vpc-alb-app-db.yaml CloudFormation template from file from GitHub raw, or by cloning this repository.
  2. Sign in to the AWS Management Console, select your preferred region, and open the CloudFormation console at https://console.aws.amazon.com/cloudformation/. Note if your CloudFormation console does not look the same, you can enable the redesigned console by clicking New Console in the CloudFormation menu.
  3. Click Create Stack.

cloudformation-createstack-1

  1. Click Upload a template file and then click Choose file.

cloudformation-createstack-2

  1. Choose the CloudFormation template you downloaded in step 1, return to the CloudFormation console page and click Next.
  2. Enter the following details:
  3. Stack name: The name of this stack. For this lab, use WebApp1-VPC and match the case. The parameters may be left as defaults, you can find out more in the description for each. If you change the default name take note as you will need to use it for other labs including "Automated Deployment of EC2 Web Application".

cloudformation-vpc-params

  1. At the bottom of the page click Next.
  2. In this lab, we won't add any tags or other options. Click Next. Tags, which are key-value pairs, can help you identify your stacks. For more information, see Adding Tags to Your AWS CloudFormation Stack.
  3. Review the information for the stack. When you're satisfied with the configuration, check I acknowledge that AWS CloudFormation might create IAM resources with custom names then click Create stack.

cloudformation-vpc-createstack-final

  1. After a few minutes the final stack status should change from CREATE_IN_PROGRESS to CREATE_COMPLETE. You have now created the VPC stack (well actually CloudFormation did it for you).

3. Knowledge Check

The security best practices followed in this lab are:


4. Tear down this lab

The following instructions will remove the resources that you have created in this lab.

Note: If you are planning on completing the lab 200_Automated_Deployment_of_EC2_Web_Application we recommend you only tear down this lab after completing both, as there is a dependency on this VPC.

Delete the VPC CloudFormation stack:

  1. Sign in to the AWS Management Console, select your preferred region, and open the CloudFormation console at https://console.aws.amazon.com/cloudformation/.
  2. Click the radio button on the left of the WebApp1-VPC stack.
  3. Click the Actions button then click Delete stack.
  4. Confirm the stack and then click Delete button.

Delete the CloudWatch Logs:

  1. Sign in to the AWS Management Console, select your preferred region, and open the CloudFormation console at https://console.aws.amazon.com/cloudwatch/.
  2. Click Logs in the left navigation.
  3. Click the radio button on the left of the WebApp1-VPCFlowLog.
  4. Click the Actions Button then click Delete Log Group.
  5. Verify the log group name then click Yes, Delete.

References & useful resources

AWS CloudFormation User Guide Amazon VPC User Guide


License

Licensed under the Apache 2.0 and MITnoAttr License.

Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at

https://aws.amazon.com/apache2.0/

or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.