How to do it...

  1. Open up your text editor and create a new CloudFormation template. We're going to require a VPC ID and some subnet IDs as Parameters. Add them to your template like this:
      AWSTemplateFormatVersion: '2010-09-09'       Parameters:         VPCID:           Type: AWS::EC2::VPC::Id           Description: VPC where load balancer and instance will launch         SubnetIDs:           Type: List<AWS::EC2::Subnet::Id>           Description: Subnets where load balancer and instance will launch           (pick at least 2)
  1. Next we need to add some Mappings of ELB account IDs. These will make it easier for us to give the load balancer permission to write logs to an S3 bucket. Your mappings should look like this:

Get Implementing AWS: Design, Build, and Manage your Infrastructure now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.