--- Description: >- Setup VPC AWSTemplateFormatVersion: 2010-09-09 Resources: VPC: Type: AWS::EC2::VPC Properties: CidrBlock: 172.31.0.0/16 EnableDnsSupport: true EnableDnsHostnames: true InstanceTenancy: default Tags: - Key: Name Value: BatchGenomics InternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name Value: BatchGenomics VPCGatewayAttachment: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: !Ref VPC InternetGatewayId: !Ref InternetGateway SubnetA: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC CidrBlock: 172.31.0.0/20 MapPublicIpOnLaunch: true AvailabilityZone: Fn::Select: - 0 - Fn::GetAZs: "" Tags: - Key: Name Value: BatchGenomics SubnetB: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC CidrBlock: 172.31.16.0/20 MapPublicIpOnLaunch: true AvailabilityZone: Fn::Select: - 1 - Fn::GetAZs: "" Tags: - Key: Name Value: BatchGenomics SubnetC: Type: AWS::EC2::Subnet Properties: VpcId: !Ref VPC CidrBlock: 172.31.32.0/20 MapPublicIpOnLaunch: true AvailabilityZone: Fn::Select: - 2 - Fn::GetAZs: "" Tags: - Key: Name Value: BatchGenomics RouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref VPC Tags: - Key: Name Value: BatchGenomics InternetRoute: Type: AWS::EC2::Route DependsOn: VPCGatewayAttachment Properties: DestinationCidrBlock: 0.0.0.0/0 GatewayId: !Ref InternetGateway RouteTableId: !Ref RouteTable SubnetARouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref RouteTable SubnetId: !Ref SubnetA SubnetBRouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref RouteTable SubnetId: !Ref SubnetB SubnetCRouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: RouteTableId: !Ref RouteTable SubnetId: !Ref SubnetC SecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupName: "Internet Group" GroupDescription: "SSH traffic in, all traffic out." VpcId: !Ref VPC SecurityGroupIngress: - IpProtocol: tcp FromPort: '22' ToPort: '22' CidrIp: 0.0.0.0/0 SecurityGroupEgress: - IpProtocol: -1 CidrIp: 0.0.0.0/0 Tags: - Key: Name Value: BatchGenomics Outputs: SecurityGroup: Description: SecurityGroup Value: !Ref SecurityGroup Export: Name: !Join [ ":", [ !Ref "AWS::StackName", SecurityGroup ] ] SubnetA: Description: SubnetA Value: !Ref SubnetA Export: Name: !Join [ ":", [ !Ref "AWS::StackName", SubnetA ] ] SubnetB: Description: SubnetB Value: !Ref SubnetB Export: Name: !Join [ ":", [ !Ref "AWS::StackName", SubnetB ] ] SubnetC: Description: SubnetC Value: !Ref SubnetC Export: Name: !Join [ ":", [ !Ref "AWS::StackName", SubnetC ] ] StackName: Description: StackName Value: !Ref AWS::StackName