All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::SecurityGroups

最終更新日:Oct 29, 2024

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

PropertyTypeRequiredEditableDescriptionConstraint
VpcIdStringNoYesThe ID of the virtual private cloud (VPC) to which the security group belongs. None.
SecurityGroupNameStringNoYesThe name of the security group. None.
ResourceGroupIdStringNoYesThe 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.
NetworkTypeStringNoYesThe network type of the security group. Valid values:
  • vpc: VPC
  • classic: classic network
SecurityGroupIdStringNoYesThe ID of the security group. None.
SecurityGroupTypeStringNoYesThe 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.
SecurityGroupIdsListNoYesThe IDs of the security groups. You can specify up to 100 security group IDs. Separate multiple IDs with commas (,).
TagsListNoYesThe 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

PropertyTypeRequiredEditableDescriptionConstraint
ValueStringNoNoThe value of the tag. None.
KeyStringYesNoThe key of the tag. None.

Return values (Fn::GetAtt)

  • SecurityGroupIds: the IDs of the security groups.
  • SecurityGroups: details of the security groups.
PropertyTypeDescriptionConstraint
SecurityGroupIdsListThe IDs of the security groups. None.
SecurityGroupsListDetails of the security groups. None.
ServiceManagedBooleanIndicates whether the user of the security group is an Alibaba Cloud service or a distributor. Valid values:
  • true
  • false
DescriptionStringThe description of the security group. None.
SecurityGroupIdStringThe ID of the security group. None.
ResourceGroupIdStringThe ID of the resource group to which the security group belongs. None.
SecurityGroupNameStringThe name of the security group. None.
SecurityGroupTypeStringThe type of the security group. Valid values:
  • normal: basic security group
  • enterprise: advanced security group
TagsListThe 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"
        ]
      }
    }
  }
}