AWSTemplateFormatVersion: "2010-09-09" Description: 'Cloudformation template to create VPC for workshop (Optimize Serverless Application on AWS)' Resources: VPC: Type: AWS::EC2::VPC Properties: CidrBlock: 10.0.0.0/16 EnableDnsSupport: true EnableDnsHostnames: true Tags: - Key: Name Value: serverless-app InternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name Value: serverless-app-igw InternetGatewayAttachment: Type: AWS::EC2::VPCGatewayAttachment Properties: InternetGatewayId: !Ref InternetGateway VpcId: !Ref VPC PrivateSubnet1: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2a CidrBlock: 10.0.1.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: lambda-subnet-a PrivateSubnet2: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2c CidrBlock: 10.0.2.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: lambda-subnet-c PrivateSubnet3: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2a CidrBlock: 10.0.10.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: rds-subnet-a PrivateSubnet4: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2c CidrBlock: 10.0.20.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: rds-subnet-c PrivateSubnet5: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2a CidrBlock: 10.0.100.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: secret-subnet-a PrivateSubnet6: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2c CidrBlock: 10.0.200.0/24 MapPublicIpOnLaunch: false Tags: - Key: Name Value: secret-subnet-c PublicSubnet1: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC AvailabilityZone: ap-northeast-2a CidrBlock: 10.0.0.0/24 MapPublicIpOnLaunch: true Tags: - Key: Name Value: cloud9-subnet-a PublicRouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref VPC Tags: - Key: Name Value: serverless-app-routes DefaultPublicRoute: Type: AWS::EC2::Route DependsOn: InternetGatewayAttachment Properties: RouteTableId: !Ref PublicRouteTable DestinationCidrBlock: 0.0.0.0/0 GatewayId: !Ref InternetGateway PublicSubnet1RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref PublicRouteTable SubnetId: !Ref PublicSubnet1 Outputs: VPC: Description: serverless-app-vpc Value: !Ref VPC