ALIYUN::ECS::SecurityGroupClone类型用于克隆安全组。

语法

{
  "Type": "ALIYUN::ECS::SecurityGroupClone",
  "Properties": {
    "DestinationRegionId": String,
    "VpcId": String,
    "Description": String,
    "SecurityGroupName": String,
    "SourceSecurityGroupId": String,
    "ResourceGroupId": String,
    "NetworkType": String,
    "SecurityGroupType": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
ResourceGroupId String 实例所在的资源组ID。 无。
SourceSecurityGroupId String 用于克隆的原始安全组ID。 根据新安全组的网络类型,克隆合适的安全组规则。
NetworkType String 克隆的新安全组网络类型为经典网络。 取值:Classic。
VpcId String 克隆的新安全组所属的VPC ID。 当同时指定VpcId和NetworkType时,NetworkType的设置无效。
Description String 安全组描述信息。 长度为2~256个字符。不能以http://或https://开头。
SecurityGroupName String 安全组名称。 默认值为空。长度为2~128字符。必须以大小字母或中文开头,可包含字母、汉字、数字、点号(.)、下划线(_)和连字符(-),但不能以http://或https://开头。
DestinationRegionId String 将安全组克隆到指定区域。 默认值:CURRENT。
SecurityGroupType String 安全组的类型。 取值:normal(基本安全组)、enterprise(高级安全组)。

返回值

Fn::GetAtt

SecurityGroupId:安全组ID。

示例

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "SecurityGroupClone": {
      "Type": "ALIYUN::ECS::SecurityGroupClone",
      "Properties": {
        "SourceSecurityGroupId": {
          "Ref": "SourceSecurityGroupId"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "Description": {
          "Ref": "Description"
        },
        "SecurityGroupName": {
          "Ref": "SecurityGroupName"
        },
        "DestinationRegionId": {
          "Ref": "DestinationRegionId"
        },
        "NetworkType": {
          "Ref": "NetworkType"
        }
      }
    }
  },
  "Parameters": {
    "SourceSecurityGroupId": {
      "Type": "String",
      "Description": "Source security group ID is used to copy properties to clone new security group. If the NetworkType and VpcId is not specified, the same security group will be cloned. If NetworkType or VpcId is specified, only proper security group rules will be cloned."
    },
    "VpcId": {
      "Type": "String",
      "Description": "Physical ID of the VPC."
    },
    "Description": {
      "Type": "String",
      "Description": "Description of the security group, [2, 256] characters. Do not fill or empty, the default is empty."
    },
    "SecurityGroupName": {
      "Type": "String",
      "Description": "Display name of the security group, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'"
    },
    "DestinationRegionId": {
      "Default": "CURRENT",
      "Type": "String",
      "Description": "Clone security group to the specified region. Default to current region."
    },
    "NetworkType": {
      "Type": "String",
      "Description": "Clone new security group as classic network type. If the VpcId is specified, the value will be ignored.",
      "AllowedValues": [
        "Classic"
      ]
    }
  },
  "Outputs": {
    "SecurityGroupId": {
      "Description": "Generated security group id of new security group.",
      "Value": {
        "Fn::GetAtt": [
          "SecurityGroupClone",
          "SecurityGroupId"
        ]
      }
    }
  }
}