Clones a security group.
Syntax
{
"Type": "ALIYUN::ECS::SecurityGroupClone",
"Properties": {
"DestinationRegionId": String,
"VpcId": String,
"Description": String,
"SecurityGroupName": String,
"SourceSecurityGroupId": String,
"ResourceGroupId": String,
"NetworkType": String,
"SecurityGroupType": String
}
}
Properties
| Property name | Type | Required | Update allowed | Description | Constraints |
| ResourceGroupId | String | No | Yes | The resource group ID. | None. |
| SourceSecurityGroupId | String | Yes | No | The ID of the source security group to clone. | Only rules compatible with the network type of the new security group are cloned. |
| NetworkType | String | No | No | The network type of the cloned security group. | Valid value: Classic. |
| VpcId | String | No | No | The ID of the VPC to which the new security group belongs. | If you specify both VpcId and NetworkType, the NetworkType setting is ignored. |
| Description | String | No | No | The security group description. | 2 to 256 characters. Cannot start with http:// or https://. |
| SecurityGroupName | String | No | No | The security group name. | Defaults to empty. 2 to 128 characters, starting with a letter. Can contain letters, digits, periods (.), underscores (_), and hyphens (-). Cannot start with http:// or https://. |
| DestinationRegionId | String | No | No | The destination region for the cloned security group. | Default: CURRENT. |
| SecurityGroupType | String | No | No | The type of the security group. | Valid values:
|
Return values
Fn::GetAtt
SecurityGroupId: The ID of the security group.
Examples
-
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Description": "Test ECS SecurityGroupClone", "Parameters": { "SourceSecurityGroupId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId", "Label": "Security Group ID", "AssociationPropertyMetadata": { "VpcId": "${VpcId}" } }, "VpcId": { "AssociationProperty": "ALIYUN::ECS::VPC::VPCId", "Type": "String", "Label": "Existing VPC Instance ID" }, "SecurityGroupName": { "Type": "String" } }, "Resources": { "SecurityGroupClone": { "Type": "ALIYUN::ECS::SecurityGroupClone", "Properties": { "VpcId": { "Ref": "VpcId" }, "SecurityGroupName": { "Ref": "SecurityGroupName" }, "SourceSecurityGroupId": { "Ref": "SourceSecurityGroupId" } } } }, "Outputs": { "SecurityGroupId": { "Value": { "Fn::GetAtt": [ "SecurityGroupClone", "SecurityGroupId" ] } } } }