github.com/kubernetes-incubator/kube-aws@v0.16.4/e2e/testinfra/stack-template.yaml (about)

     1  AWSTemplateFormatVersion: '2010-09-09'
     2  Description:
     3    kube-aws E2E testing infrastructure
     4  Parameters:
     5    Id:
     6      Description: Id of the infrastructure
     7      Default: kube-aws-e2e-infra
     8      Type: String
     9      AllowedPattern: "[a-zA-Z0-9\\-]*"
    10    AZ1:
    11      Description: Name of the first AZ
    12      Default: us-west-1a
    13      Type: String
    14      AllowedPattern: "[a-z0-9\\-]*"
    15  
    16  Resources:
    17  # Create VPC
    18    VPC:
    19      Type: AWS::EC2::VPC
    20      Properties:
    21        CidrBlock: 10.0.0.0/16
    22        EnableDnsSupport: 'true'
    23        EnableDnsHostnames: 'true'
    24        InstanceTenancy: default
    25        Tags:
    26        - Key: Name
    27          Value: !Join [ "-", [ "Ref":"Id" , "vpc" ] ]
    28  
    29  # Create Public RouteTable
    30    PublicRouteTable:
    31      Type: AWS::EC2::RouteTable
    32      Properties:
    33        VpcId: !Ref VPC
    34        Tags:
    35        - Key: Name
    36          Value: !Join [ "-", [ "Ref":"Id" , "public" ] ]
    37  
    38  # Create Private RouteTable
    39    PrivateRouteTable:
    40      Type: AWS::EC2::RouteTable
    41      Properties:
    42        VpcId: !Ref VPC
    43        Tags:
    44        - Key: Name
    45          Value: !Join [ "-", [ "Ref":"Id" , "private" ] ]
    46  
    47    PublicSubnet1:
    48      Type: AWS::EC2::Subnet
    49      Properties:
    50        VpcId: !Ref VPC
    51        CidrBlock: 10.0.101.0/24
    52        AvailabilityZone: !Ref AZ1
    53        Tags:
    54        - Key: Name
    55          Value: !Join [ "-", [ "Ref":"Id" , "public-1" ] ]
    56    PubSubnetARouteTableAssociation:
    57      Type: AWS::EC2::SubnetRouteTableAssociation
    58      Properties:
    59        SubnetId: !Ref PublicSubnet1
    60        RouteTableId: !Ref PublicRouteTable
    61  
    62    PublicSubnet2:
    63      Type: AWS::EC2::Subnet
    64      Properties:
    65        VpcId: !Ref VPC
    66        CidrBlock: 10.0.102.0/24
    67        AvailabilityZone: !Ref AZ1
    68        Tags:
    69        - Key: Name
    70          Value: !Join [ "-", [ "Ref":"Id" , "public-2" ] ]
    71    PubSubnetARouteTableAssociation:
    72      Type: AWS::EC2::SubnetRouteTableAssociation
    73      Properties:
    74        SubnetId: !Ref PublicSubnet2
    75        RouteTableId: !Ref PublicRouteTable
    76  
    77    PrivateSubnet1:
    78      Type: AWS::EC2::Subnet
    79      Properties:
    80        VpcId: !Ref VPC
    81        CidrBlock: 10.0.201.0/24
    82        AvailabilityZone: !Ref AZ1
    83        Tags:
    84        - Key: Name
    85          Value: !Join [ "-", [ "Ref":"Id" , "private" ] ]
    86    PriSubnetARouteTableAssociation:
    87      Type: AWS::EC2::SubnetRouteTableAssociation
    88      Properties:
    89        SubnetId: !Ref PrivateSubnet1
    90        RouteTableId: !Ref PrivateRouteTable
    91  
    92    InternetGateway:
    93      Type: "AWS::EC2::InternetGateway"
    94      Properties:
    95        Tags:
    96        - Key: Name
    97          Value: !Join [ "-", [ "Ref":"Id" , "igw" ] ]
    98    IgwAttach:
    99      Type: AWS::EC2::VPCGatewayAttachment
   100      Properties:
   101        VpcId: !Ref VPC
   102        InternetGatewayId: !Ref InternetGateway
   103    RouteToIGW:
   104      Type: "AWS::EC2::Route"
   105      DependsOn: InternetGateway
   106      Properties:
   107        RouteTableId: !Ref PublicRouteTable
   108        DestinationCidrBlock: 0.0.0.0/0
   109        GatewayId: !Ref InternetGateway
   110  
   111    NAT:
   112      DependsOn: IgwAttach
   113      Type: "AWS::EC2::NatGateway"
   114      Properties:
   115        AllocationId: !GetAtt EIP.AllocationId
   116        SubnetId: !Ref PublicSubnet1
   117    EIP:
   118      Type: AWS::EC2::EIP
   119      Properties:
   120        Domain: vpc
   121    RouteToNAT:
   122      Type: AWS::EC2::Route
   123      Properties:
   124        RouteTableId: !Ref PrivateRouteTable
   125        DestinationCidrBlock: 0.0.0.0/0
   126        NatGatewayId: !Ref NAT
   127  
   128    PublicELB:
   129      Type: AWS::ElasticLoadBalancing::LoadBalancer
   130      Properties:
   131        Subnets:
   132        - !Ref PublicSubnet1
   133        SecurityGroups:
   134        - !Ref PublicELBSG
   135        Listeners:
   136        - LoadBalancerPort: "443"
   137          InstancePort: "80"
   138          Protocol: HTTP
   139        HealthCheck:
   140          Target:
   141            Fn::Join:
   142            - ""
   143            - - "HTTP:"
   144              - "80"
   145              - "/"
   146          HealthyThreshold: "3"
   147          UnhealthyThreshold: "5"
   148          Interval: "30"
   149          Timeout: "5"
   150        Tags:
   151        - Key: Name
   152          Value: !Join [ "-", [ "Ref":"Id" , "public" ] ]
   153  
   154    PrivateELB:
   155      Type: AWS::ElasticLoadBalancing::LoadBalancer
   156      Properties:
   157        Subnets:
   158        - !Ref PrivateSubnet1
   159        SecurityGroups:
   160        - !Ref PrivateELBSG
   161        Listeners:
   162        - LoadBalancerPort: "80"
   163          InstancePort: "80"
   164          Protocol: HTTP
   165        HealthCheck:
   166          Target:
   167            Fn::Join:
   168            - ""
   169            - - "HTTP:"
   170              - "80"
   171              - "/"
   172          HealthyThreshold: "3"
   173          UnhealthyThreshold: "5"
   174          Interval: "30"
   175          Timeout: "5"
   176        Tags:
   177        - Key: Name
   178          Value: !Join [ "-", [ "Ref":"Id" , "private" ] ]
   179  
   180    TargetGroup:
   181      Type: AWS::ElasticLoadBalancingV2::TargetGroup
   182      Properties:
   183        Name: !Join [ "-", [ "Ref":"Id" , "target-group" ] ]
   184        Port: "80"
   185        Protocol: HTTP
   186        HealthCheckIntervalSeconds: "30"
   187        HealthCheckPort: "80"
   188        HealthCheckProtocol: HTTP
   189        HealthCheckPath: "/"
   190        HealthCheckTimeoutSeconds: "5"
   191        HealthyThresholdCount: "3"
   192        UnhealthyThresholdCount: "5"
   193        VpcId: !Ref VPC
   194  
   195    PrivateELBSG:
   196      Type: AWS::EC2::SecurityGroup
   197      Properties:
   198        GroupDescription: !Join [ "-", [ "Ref":"Id" , "private-lb" ] ]
   199        SecurityGroupIngress:
   200        - IpProtocol: tcp
   201          FromPort: '80'
   202          ToPort: '80'
   203          CidrIp: 0.0.0.0/0
   204        VpcId: !Ref VPC
   205  
   206    PublicELBSG:
   207      Type: AWS::EC2::SecurityGroup
   208      Properties:
   209        GroupDescription: !Join [ "-", [ "Ref":"Id" , "public-lb" ] ]
   210        SecurityGroupIngress:
   211        - IpProtocol: tcp
   212          FromPort: '80'
   213          ToPort: '80'
   214          CidrIp: 0.0.0.0/0
   215        VpcId: !Ref VPC
   216  
   217    PrivateELBBackendSG:
   218      Type: AWS::EC2::SecurityGroup
   219      Properties:
   220        GroupDescription: !Join [ "-", [ "Ref":"Id" , "private-elb-backend" ] ]
   221        SecurityGroupIngress:
   222        - IpProtocol: tcp
   223          FromPort: '80'
   224          ToPort: '80'
   225          SourceSecurityGroupId: !Ref PrivateELBSG
   226        VpcId: !Ref VPC
   227  
   228    PublicALBBackendSG:
   229      Type: AWS::EC2::SecurityGroup
   230      Properties:
   231        GroupDescription: !Join [ "-", [ "Ref":"Id" , "public-alb-backend" ] ]
   232        SecurityGroupIngress:
   233        - IpProtocol: tcp
   234          FromPort: '80'
   235          ToPort: '80'
   236          SourceSecurityGroupId: !Ref PublicELBSG
   237        VpcId: !Ref VPC
   238  
   239    PublicELBBackendSG:
   240      Type: AWS::EC2::SecurityGroup
   241      Properties:
   242        GroupDescription: !Join [ "-", [ "Ref":"Id" , "public-elb-backend" ] ]
   243        SecurityGroupIngress:
   244        - IpProtocol: tcp
   245          FromPort: '80'
   246          ToPort: '80'
   247          SourceSecurityGroupId: !Ref PublicELBSG
   248        VpcId: !Ref VPC
   249  
   250    GlueSG:
   251      Type: AWS::EC2::SecurityGroup
   252      Properties:
   253        GroupDescription: !Join [ "-", [ "Ref":"Id" , "glue" ] ]
   254        SecurityGroupIngress:
   255        - IpProtocol: tcp
   256          FromPort: '80'
   257          ToPort: '80'
   258          SourceSecurityGroupId: !Ref ExistingServiceSG
   259        VpcId: !Ref VPC
   260  
   261    ExistingServiceSG:
   262      Type: AWS::EC2::SecurityGroup
   263      Properties:
   264        GroupDescription: !Join [ "-", [ "Ref":"Id" , "existing-service" ] ]
   265        VpcId: !Ref VPC
   266  
   267  Outputs:
   268    VPC:
   269      Value: !Ref VPC
   270    PublicSubnet1:
   271      Value: !Ref PublicSubnet1
   272    PrivateSubnet1:
   273      Value: !Ref PrivateSubnet1
   274    PublicRouteTable:
   275      Value: !Ref PublicRouteTable
   276    PrivateRouteTable:
   277      Value: !Ref PrivateRouteTable
   278    PublicELBBackendSG:
   279      Value: !Ref PublicELBBackendSG
   280    PublicALBBackendSG:
   281      Value: !Ref PublicALBBackendSG
   282    PrivateELBBackendSG:
   283      Value: !Ref PrivateELBBackendSG
   284    GlueSG:
   285      Value: !Ref GlueSG
   286    PublicELB:
   287      Value: !Ref PublicELB
   288    PrivateELB:
   289      Value: !Ref PrivateELB
   290    TargetGroup:
   291      Value: !Ref TargetGroup
   292    PublicELBDNSName:
   293      Value: !GetAtt PublicELB.DNSName
   294    PrivateELBDNSName:
   295      Value: !GetAtt PrivateELB.DNSName