免费
aws亚马逊CloudFormation(vpc+elb+autoscaling) 暂无演示

aws亚马逊CloudFormation(vpc+elb+autoscaling)

售价:
¥ 免费
  • 普通用户购买价格 : 0钻石
  • 免费售后咨询

升级尊贵会员
享受全站VIP待遇

9+
会员已经加入
  • 文章介绍
  • 评价建议
  • new-designer (1).png

    Resources:
    VPC:

    Type: 'AWS::EC2::VPC'
    Properties:
      CidrBlock: !Ref vpccidr
      EnableDnsHostnames: 'true'
      EnableDnsSupport: 'true'
      Tags:
        - Key: Name
          Value: VPC
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 13d5763b-4774-4d7b-86e1-ee84ceffcb31

    Pubnet1:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Pubnet1cidr
      AvailabilityZone: !Select 
        - '0'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Pubnet1
    Metadata:
      'AWS::CloudFormation::Designer':
        id: ddd011d9-f70b-46e8-83db-5ed149d3a50f

    Webnet1:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Webnet1cidr
      AvailabilityZone: !Select 
        - '0'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Webnet1
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 861a1f7b-faef-4b24-b308-f21db38e2f52

    Dbnet1:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Dbnet1cidr
      AvailabilityZone: !Select 
        - '0'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Dbnet1
    Metadata:
      'AWS::CloudFormation::Designer':
        id: dfb44350-fd20-4f2c-a0d9-2b1bf51beb02

    Pubnet2:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Pubnet2cidr
      AvailabilityZone: !Select 
        - '1'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Pubnet2
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 24614df4-f229-4a83-b6df-555eeeb2ad3d

    Webnet2:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Webnet2cidr
      AvailabilityZone: !Select 
        - '1'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Webnet2
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 833ec8eb-ed8a-4511-b261-2b1be3f48669

    Dbnet2:

    Type: 'AWS::EC2::Subnet'
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Ref Dbnet2cidr
      AvailabilityZone: !Select 
        - '1'
        - !GetAZs ''
      Tags:
        - Key: Name
          Value: Dbnet2
    Metadata:
      'AWS::CloudFormation::Designer':
        id: ec8a8dd5-0f95-43cf-9641-f74ce1c2f312

    PublicRouteTable:

    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: PubnetRouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 508d3d47-ee20-4a42-bfe3-0e56ed2e48a2

    Private1RouteTable:

    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: Private1RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 9b993b01-250e-4d00-bf96-003604de440c

    Private2RouteTable:

    Type: 'AWS::EC2::RouteTable'
    Properties:
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: Private2RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 1864a601-a49e-45a0-ab7c-e8d3a6758db8

    IGW:

    Type: 'AWS::EC2::InternetGateway'
    Properties:
      Tags:
        - Key: Name
          Value: IGW
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 45f71e45-a943-41b1-b8dd-e0daebb054b8

    VpcGatewayAttachment:

    Type: 'AWS::EC2::VPCGatewayAttachment'
    Properties:
      VpcId: !Ref VPC
      InternetGatewayId: !Ref IGW
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 221ff7e4-7bec-42c5-b632-c7e064b68b86

    NetGateway1:

    Type: 'AWS::EC2::NatGateway'
    Properties:
      SubnetId: !Ref Pubnet1
      AllocationId: !GetAtt 
        - eip1
        - AllocationId
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 6a3a39ac-4ab9-4506-aa1e-a81f2ae7847f

    NatGateway2:

    Type: 'AWS::EC2::NatGateway'
    Properties:
      SubnetId: !Ref Pubnet2
      AllocationId: !GetAtt 
        - eip2
        - AllocationId
    Metadata:
      'AWS::CloudFormation::Designer':
        id: d07787d7-8bfb-4ff5-a390-279c5db6a821

    eip1:

    Type: 'AWS::EC2::EIP'
    Properties: {}
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 04577b56-b29d-4161-b32b-65c5c1b14f44

    eip2:

    Type: 'AWS::EC2::EIP'
    Properties: {}
    Metadata:
      'AWS::CloudFormation::Designer':
        id: e6d5eca2-4f14-4f8a-b436-fa4b32dc8c61

    pubnet1association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Pubnet1
      RouteTableId: !Ref PublicRouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 0dc3cae5-13bc-4e5a-867b-f202c9ad735f

    pubnet2association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Pubnet2
      RouteTableId: !Ref PublicRouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 8445982f-1589-4c16-bb5c-0f709e2ac81f

    webnet1association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Webnet1
      RouteTableId: !Ref Private1RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 3a3f9915-6c6a-45e7-8ba7-b575863e3e27

    dbnet1association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Dbnet1
      RouteTableId: !Ref Private1RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: f495e78c-9144-4506-955a-b2c9f62e6eae

    webnet2association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Webnet2
      RouteTableId: !Ref Private2RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 4362517e-e24f-4399-af23-5f95c4ab2524

    dbnet2association:

    Type: 'AWS::EC2::SubnetRouteTableAssociation'
    Properties:
      SubnetId: !Ref Dbnet2
      RouteTableId: !Ref Private2RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 81cfc53c-49d8-4d70-932c-07484711f5ca

    PubnetRoute:

    Type: 'AWS::EC2::Route'
    Properties:
      DestinationCidrBlock: 0.0.0.0/0
      GatewayId: !Ref IGW
      RouteTableId: !Ref PublicRouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 130e4dab-f964-42f8-b4c9-cf9fa0ada438

    Private1Route:

    Type: 'AWS::EC2::Route'
    Properties:
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId: !Ref NetGateway1
      RouteTableId: !Ref Private1RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: debd70f7-c9cb-48a9-8f2e-d343da2d7570

    Private2Route:

    Type: 'AWS::EC2::Route'
    Properties:
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId: !Ref NatGateway2
      RouteTableId: !Ref Private2RouteTable
    Metadata:
      'AWS::CloudFormation::Designer':
        id: a08a1d94-44a9-4df8-9f9e-5abfe0c60a47

    Config:

    Type: 'AWS::AutoScaling::LaunchConfiguration'
    Properties:
      ImageId: !Ref ConfigAMI
      InstanceType: !Ref ConfigInstanceType
      SecurityGroups:
        - Ref: SGForConfig
      LaunchConfigurationName: !Ref LaunchConfigurationName
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 53a8f39e-fcb5-4a85-92e5-81b3b6e5e676

    SGForConfig:

    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: sg for config
      GroupName: SGForConfig
      SecurityGroupIngress:
        - CidrIp: 0.0.0.0/0
          FromPort: !Ref SGConfigPort
          ToPort: !Ref SGConfigPort
          IpProtocol: tcp
      VpcId: !Ref VPC
    Metadata:
      'AWS::CloudFormation::Designer':
        id: de2750a7-1dc8-47b3-b862-b2b164587a7b

    Group:

    Type: 'AWS::AutoScaling::AutoScalingGroup'
    Properties:
      AutoScalingGroupName: !Ref AutoScalingGroupName
      VPCZoneIdentifier:
        - !Ref Webnet1
        - !Ref Webnet2
      MaxSize: 20
      MinSize: 2
      HealthCheckGracePeriod: 200
      DesiredCapacity: 2
      HealthCheckType: ELB
      LaunchConfigurationName: !Ref Config
      TargetGroupARNs:
        - !Ref TargetGroup
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 5ef89904-e32c-4080-a3a8-f1634e48177a

    SG2ForELB:

    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: for elb
      GroupName: SG2forelb
      SecurityGroupIngress:
        - CidrIp: 0.0.0.0/0
          FromPort: !Ref SGELBPort
          ToPort: !Ref SGELBPort
          IpProtocol: tcp
      VpcId: !Ref VPC
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 98f8ab86-85e0-4426-bc03-f84582a2c23b

    TargetGroup:

    Type: 'AWS::ElasticLoadBalancingV2::TargetGroup'
    Properties:
      HealthCheckPort: !Ref TargetHealthCheckPort
      HealthCheckPath: /
      HealthCheckProtocol: HTTP
      HealthyThresholdCount: 5
      UnhealthyThresholdCount: 2
      HealthCheckTimeoutSeconds: 5
      HealthCheckIntervalSeconds: 6
      HealthCheckEnabled: true
      Port: !Ref TargetPort
      Protocol: HTTP
      Name: MyTarget
      VpcId: !Ref VPC
    Metadata:
      'AWS::CloudFormation::Designer':
        id: afa56e7d-9bdc-4293-8d63-0509dc8548e5

    Listener:

    Type: 'AWS::ElasticLoadBalancingV2::Listener'
    Properties:
      DefaultActions:
        - Type: forward
          TargetGroupArn: !Ref TargetGroup
      LoadBalancerArn: !Ref ALB
      Port: !Ref ListenerPort
      Protocol: HTTP
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 20001e1e-de18-4652-bd11-f922e9a72c3c

    ALB:

    Type: 'AWS::ElasticLoadBalancingV2::LoadBalancer'
    Properties:
      SecurityGroups:
        - Ref: SG2ForELB
      Name: alb
      Subnets:
        - !Ref Pubnet1
        - !Ref Pubnet2
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 0fd4838c-a06f-4d66-998a-6eb1b9327d86

    Parameters:
    vpccidr:

    Type: String
    Default: 10.0.0.0/16

    Pubnet1cidr:

    Type: String
    Default: 10.0.1.0/24

    Webnet1cidr:

    Type: String
    Default: 10.0.2.0/24

    Dbnet1cidr:

    Type: String
    Default: 10.0.3.0/24

    Pubnet2cidr:

    Type: String
    Default: 10.0.4.0/24

    Webnet2cidr:

    Type: String
    Default: 10.0.5.0/24

    Dbnet2cidr:

    Type: String
    Default: 10.0.6.0/24

    ConfigAMI:

    Type: String
    Default: ami-0f62e91915e16cfc2

    ConfigInstanceType:

    Type: String
    Default: t3.micro

    ListenerPort:

    Type: String
    Default: 7777

    TargetHealthCheckPort:

    Type: String
    Default: 7777

    TargetPort:

    Type: String
    Default: 7777

    SGELBPort:

    Type: String
    Default: 7777

    SGConfigPort:

    Type: String
    Default: 7777

    AutoScalingGroupName:

    Type: String
    Default: mygroup

    LaunchConfigurationName:

    Type: String
    Default: myconfig
    

    常见问题FAQ

    免费下载或者VIP会员专享资源能否直接商用?
    本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
    本站所有资源转载请申明来源!如有链接无法下载、失效或广告,请联系管理员处理!侵权请邮件联系站长!
    Adnico » aws亚马逊CloudFormation(vpc+elb+autoscaling)

    发表评论

    91+

    本站勉强运行

    9+

    用户总数

    18+

    资源总数

    0+

    今日更新

    2020-10-30

    最后更新时间