CreateSecurityGroup
In this article:
CreateSecurityGroup#
Description#
Creates a security group.
Attention
You can create maximum 500 security groups per VPC
Request Parameters#
Required parameters#
GroupDescription — The description of the security group.
Type: String
Required: Yes
GroupName — The name of the security group.
Type: String
Required: Yes
VpcId — The ID of the VPC.
Type: String
Required: Yes
Optional parameters#
TagSpecification.N — The tags assigned to the resource when it is created.
Type: List of TagSpecification objects
Required: No
Response Elements#
groupId — The ID of the new security group.
Type: String
requestId — The request ID
Type: String
return —
True
is returned if the request succeeds, and an error otherwiseType: Boolean
tagSet — Any tags assigned to the security group.
Type: List of Tag objects
Examples#
c2-ec2 CreateSecurityGroup GroupName <name> GroupDescription <description> VpcId <vpc_id>
c2-ec2 CreateSecurityGroup GroupName <name> GroupDescription <description> VpcId <vpc_id> \
TagSpecification.0.ResourceType security-group \
TagSpecification.0.Tag.0.Key "tag_key" TagSpecification.0.Tag.0.Value "tag_value"