阿里云资源编排服务ROS在指定可用区同时创建多个交换机

阿里云资源编排服务ROS(Resource Orchestration Service)是一种简单易用的云计算资源自动化部署服务,本示例实现在指定可用区同时创建多个交换机。

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Required: true
    Type: String
    Description:
      zh-cn: 交换机所属专有网络
    Label:
      zh-cn: 专有网络ID
  VSwitchNamePublic1:
    Default: vsw-public-1
    Type: String
    Description:
      zh-cn: 公网交换机名称,长度为2~128
    Label:
      zh-cn: 公网交换机名称
  VSwitchNamePrivate1:
    Default: vsw-private-1
    Type: String
    Description:
      zh-cn: 内网交换机名称,长度为2~128
    Label:
      zh-cn: 内网交换机名称
  ZoneId1:
    AssociationProperty: ZoneId
    Required: true
    Type: String
    Description:
      zh-cn: 可用区1
    Label:
      zh-cn: 可用区ID
  CidrBlockPublic1:
    AssociationPropertyMetadata:
      RecommendDescription:
        zh-cn: 您可以选择以下值进行快速设置。
      RecommendValues:
        - 10.0.0.0/24
        - 172.16.0.0/24
        - 192.168.0.0/24
    Description:
      zh-cn: 建议交换机的网段:10.0.0.0/24,172.16.0.0/24,192.168.0.0/24。必须是所属专有网络的子网段,并且没有被其他交换机占用。
    Default: 172.17.0.0/24
    Required: true
    Label:
      zh-cn: 公网交换机网段
    AssociationProperty: RecommendInput
    Type: String
  CidrBlockPrivate1:
    AssociationPropertyMetadata:
      RecommendDescription:
        zh-cn: 您可以选择以下值进行快速设置。
      RecommendValues:
        - 10.0.0.0/24
        - 172.16.0.0/24
        - 192.168.0.0/24
    Description:
      zh-cn: 建议交换机的网段:10.0.0.0/24,172.16.0.0/24,192.168.0.0/24。必须是所属专有网络的子网段,并且没有被其他交换机占用。
    Default: 172.17.1.0/24
    Required: true
    Label:
      zh-cn: 内网交换机网段
    AssociationProperty: RecommendInput
    Type: String
Outputs: 
Resources:
  VSwitch1:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Ref: VSwitchNamePublic1
      VpcId:
        Ref: VpcId
      ZoneId:
        Ref: ZoneId1
      CidrBlock:
        Ref: CidrBlockPublic1
  VSwitch2:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Ref: VSwitchNamePrivate1
      VpcId:
        Ref: VpcId
      ZoneId:
        Ref: ZoneId1
      CidrBlock:
        Ref: CidrBlockPrivate1
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - ZoneId1
          - CidrBlockPublic1
          - VSwitchNamePublic1
          - CidrBlockPrivate1
          - VSwitchNamePrivate1
        Label:
          default:
            zh-cn: 创建交换机(可用区1)

原创文章禁止转载:技术学堂 » 阿里云资源编排服务ROS在指定可用区同时创建多个交换机

精彩评论

9+3=

感谢您的支持与鼓励

支付宝扫一扫打赏

微信扫一扫打赏