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,
"RefreshOptions": String
}
}
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. | If you use this property to filter resources, up to 1,000 resources that belong to the specified resource group can be returned. |
NetworkType | String | No | Yes | The network type of the security group. | Valid values:
|
SecurityGroupId | String | No | Yes | The ID of the security group. | None. |
SecurityGroupType | String | No | Yes | The type of the security group. | Valid values:
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. |
RefreshOptions | String | No | Yes | The refresh policy for data source resources when the stack is updated. | Valid values:
|
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Value | String | No | No | The tag value of the security group. | None. |
Key | String | Yes | No | The tag key of the security group. | 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:
|
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:
|
Tags | List | The tags of the security group. | 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"
]
}
}
}
}