DATASOURCE::ECS::SecurityGroups is used to query the basic information about security groups.

Syntax

{
  "Type": "DATASOURCE::ECS::SecurityGroups",
  "Properties": {
    "VpcId": String,
    "SecurityGroupName": String,
    "ResourceGroupId": String,
    "NetworkType": String,
    "SecurityGroupId": String,
    "SecurityGroupType": String,
    "SecurityGroupIds": List,
    "Tags": List
  }
}

Properties

Property Type Required Editable Description Constraint
VpcId String No Yes The ID of the virtual private cloud (VPC) to which the security group belongs. None.
SecurityGroupName String No Yes The name of the security group. None.
ResourceGroupId String No Yes The ID of the resource group to which the security group belongs. When you use this property to query resources, the number of resources that are contained in the specified resource group cannot exceed 1,000.
NetworkType String No Yes The network type of the security group. Valid values:
  • vpc: VPC
  • classic: classic network
SecurityGroupId String No Yes The ID of the security group. None.
SecurityGroupType String No Yes The type of the security group. Valid values:
  • normal: basic security group
  • enterprise: advanced security group
Note If you leave this property empty, all types of security groups are queried.
SecurityGroupIds List No Yes The IDs of the security groups. You can specify up to 100 security group IDs. Separate multiple IDs with commas (,).
Tags List No Yes The tags of the security groups. You can add up to 20 tags.

For more information, see Tags properties.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property Type Required Editable Description Constraint
Value String No No The value of the tag. None.
Key String Yes No The key of the tag. None.

Return values (Fn::GetAtt)

  • SecurityGroupIds: the IDs of the security groups.
  • SecurityGroups: details of the security groups.
Property Type Description Constraint
SecurityGroupIds List The IDs of the security groups. None.
SecurityGroups List Details of the security groups. None.
ServiceManaged Boolean Indicates whether the user of the security group is an Alibaba Cloud service or a distributor. Valid values:
  • true
  • false
Description String The description of the security group. None.
SecurityGroupId String The ID of the security group. None.
ResourceGroupId String The ID of the resource group to which the security group belongs. None.
SecurityGroupName String The name of the security group. None.
SecurityGroupType String The type of the security group. Valid values:
  • normal: basic security group
  • enterprise: advanced security group
Tags List The tags of the security groups. None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "SecurityGroups": {
      "Type": "DATASOURCE::ECS::SecurityGroups",
      "Properties": {
        "SecurityGroupId": "sg-bp1ja9p6tw8b6xed****"
      }
    }
  },
  "Outputs": {
    "Images": {
      "Value": {
        "Fn::GetAtt": [
          "SecurityGroups",
          "SecurityGroups"
        ]
      }
    },
    "ImageIds": {
      "Value": {
        "Fn::GetAtt": [
          "SecurityGroups",
          "SecurityGroupIds"
        ]
      }
    }
  }
}