ec2-add-group
Description
Creates a new security group. Group names must be unique per account.
Every instance is launched in a security group. If no security group is specified during launch, the instances are launched in the default security group. Instances within the same security group have unrestricted network access to each other. Instances will reject network access attempts from other instances in a different security group. As the owner of instances you can grant or revoke specific permissions using the AuthorizeSecurityGroupIngress
and RevokeSecurityGroupIngress
operations.
Syntax
ec2-add-group
group
-d description
Options
Name | Description | Required |
---|---|---|
|
Name of the security group. Type: String Default: None Constraints: Accepts alphanumeric characters, spaces, dashes, and underscores. Example: websrv |
Yes |
|
Description of the group. This is informational only. If the description contains spaces, you must enclose it in single quotes (') or URL-encode it. Type: String Default: None Constraints: Accepts alphanumeric characters, spaces, dashes, and underscores. Example: -d 'Web servers' |
Yes |
Output
The command returns a table that contains the following information:
-
GROUP identifier
-
Group name
-
Group description
Amazon EC2 displays errors on stderr.
Examples
Example Request
This example creates the websrv
security group.
PROMPT>ec2-add-group websrv -d 'Web Servers'
GROUP websrv Web Servers