To begin this workshop, you will need to deploy two CloudFormation templates to build the necessary environments. The first will create a new VPC and network environment; the second will build your AWS Batch environment within the VPC.
In this section, you will build the required VPC and network architecture.
Both templates can be found in the repository of the monitoring solution or directly here for the VPC stack and here the AWS Batch stack.
We are going to go through how to deploy the VPC CloudFormation template both through the console and by using the AWS CLI. To learn more about Amazon VPC see here
Download the VPC CloudFormation Template.
Open the AWS Cloudformation console (link).
For Create Stack, choose With new resources.
In the Create stack section, do the following:
a. Choose Template is ready.
b. Choose Upload a template file.
c. Choose the VPC CloudFormation template you downloaded in step 1.
d. Choose Next.
In the Specify stack details section, do the following:
a. For Stack Name, enter LargeScaleVPC
.
b. For the Name of your VPC, enter LargeScaleVPC
.
c. Choose the Availability Zones (AZs) where you would like to deploy the VPC. Best practice is to select all Availability Zones within your Region of choice to tap into all available instances pools.
d. For the Number of Availability Zones, enter the number of Availability Zones you selected in the previous step. In this example we are using the us-east-1 Region.
d. In the Network and Endpoint Configuration section, leave the default values.
e. Choose the Availability Zone where the public subnet will be deployed.
f. Choose Next.
In the Configure stack options section, leave the default values. Choose Next.
In the Review section, do the following:
a. Review the stack details.
b. Select to acknowledge that the AWS CloudFormation might create IAM resources.
c. Choose Create stack.
The stack will now be created and all the resources in the template will be deployed. Wait until you see CREATE_COMPLETE
before you deploy the stack in the next step. The deployment should only take a few minutes.
We have now deployed the VPC CloudFormation template using the Amazon Console. Below are the instructions if you would like to deploy using the AWS Cli.
#!/bin/bash
aws cloudformation create-stack --stack-name LargeScaleVPC \
--template-body file://0.VPC-Large-Scale.yaml \
--capabilities CAPABILITY_NAMED_IAM \
--parameters \
ParameterKey=AvailabilityZones,ParameterValue=us-east-1a\\,us-east-1b\\,us-east-1c\\,us-east-1d\\,us-east-1e\\,us-east-1f \
ParameterKey=NumberOfAZs,ParameterValue=6
The stack will now be created and all the resources in the template will be deployed. Wait until you see CREATE_COMPLETE
before you deploy the stack in the next step. The deployment should only take a few minutes.
At this point you have successfully deployed your Large Scale VPC stack. This template sets up the VPC accross all the selected AZs with both public and private subnets. This stack also deploys an Amazon S3 endpoint and Amazon DynamoDB endpoint.
In the next section you will deploy the Batch Template.