create_security_group¶
Operation¶
create_security_group
async
¶
create_security_group(input: CreateSecurityGroupInput, plugins: list[Plugin] | None = None) -> CreateSecurityGroupOutput
Creates a security group.
A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. For more information, see Amazon EC2 security groups in the Amazon EC2 User Guide and Security groups for your VPC in the Amazon VPC User Guide.
When you create a security group, you specify a friendly name of your choice. You can't have two security groups for the same VPC with the same name.
You have a default security group for use in your VPC. If you don't specify a security group when you launch an instance, the instance is launched into the appropriate default security group. A default security group includes a default rule that grants instances unrestricted network access to each other.
You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.
For more information about VPC security group limits, see Amazon VPC Limits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
CreateSecurityGroupInput
|
An instance of |
required |
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
Returns:
| Type | Description |
|---|---|
CreateSecurityGroupOutput
|
An instance of |
Input¶
CreateSecurityGroupInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateSecurityGroupInput structure.
Attributes¶
description
class-attribute
instance-attribute
¶
description: str | None = ...
A description for the security group.
Constraints: Up to 255 characters in length
Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
dry_run
class-attribute
instance-attribute
¶
dry_run: bool | None = ...
Checks whether you have the required permissions for the action, without
actually making the request, and provides an error response. If you have
the required permissions, the error response is DryRunOperation.
Otherwise, it is UnauthorizedOperation.
group_name
class-attribute
instance-attribute
¶
group_name: str | None = ...
The name of the security group. Names are case-insensitive and must be unique within the VPC.
Constraints: Up to 255 characters in length. Can't start with sg-.
Valid characters: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
Output¶
CreateSecurityGroupOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateSecurityGroupOutput structure.
Attributes¶
group_id
class-attribute
instance-attribute
¶
group_id: str | None = ...
The ID of the security group.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.