Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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 Elastic Compute Cloud User Guide and Security groups for your VPC in the Amazon Virtual Private Cloud User Guide.
When you create a security group, you specify a friendly name of your choice. You can have a security group for use in EC2-Classic with the same name as a security group for use in a VPC. However, you can't have two security groups for use in EC2-Classic with the same name or two security groups for use in a VPC with the same name.
You have a default security group for use in EC2-Classic and 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.
We are retiring EC2-Classic. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon Elastic Compute Cloud User Guide.
Synopsis
- data CreateSecurityGroup = CreateSecurityGroup' {
- dryRun :: Maybe Bool
- tagSpecifications :: Maybe [TagSpecification]
- vpcId :: Maybe Text
- description :: Text
- groupName :: Text
- newCreateSecurityGroup :: Text -> Text -> CreateSecurityGroup
- createSecurityGroup_dryRun :: Lens' CreateSecurityGroup (Maybe Bool)
- createSecurityGroup_tagSpecifications :: Lens' CreateSecurityGroup (Maybe [TagSpecification])
- createSecurityGroup_vpcId :: Lens' CreateSecurityGroup (Maybe Text)
- createSecurityGroup_description :: Lens' CreateSecurityGroup Text
- createSecurityGroup_groupName :: Lens' CreateSecurityGroup Text
- data CreateSecurityGroupResponse = CreateSecurityGroupResponse' {}
- newCreateSecurityGroupResponse :: Int -> Text -> CreateSecurityGroupResponse
- createSecurityGroupResponse_tags :: Lens' CreateSecurityGroupResponse (Maybe [Tag])
- createSecurityGroupResponse_httpStatus :: Lens' CreateSecurityGroupResponse Int
- createSecurityGroupResponse_groupId :: Lens' CreateSecurityGroupResponse Text
Creating a Request
data CreateSecurityGroup Source #
See: newCreateSecurityGroup
smart constructor.
CreateSecurityGroup' | |
|
Instances
newCreateSecurityGroup Source #
Create a value of CreateSecurityGroup
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:dryRun:CreateSecurityGroup'
, createSecurityGroup_dryRun
- 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
.
CreateSecurityGroup
, createSecurityGroup_tagSpecifications
- The tags to assign to the security group.
CreateSecurityGroup
, createSecurityGroup_vpcId
- [EC2-VPC] The ID of the VPC. Required for EC2-VPC.
CreateSecurityGroup
, createSecurityGroup_description
- A description for the security group. This is informational only.
Constraints: Up to 255 characters in length
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
CreateSecurityGroup
, createSecurityGroup_groupName
- The name of the security group.
Constraints: Up to 255 characters in length. Cannot start with sg-
.
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
Request Lenses
createSecurityGroup_dryRun :: Lens' CreateSecurityGroup (Maybe Bool) Source #
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
.
createSecurityGroup_tagSpecifications :: Lens' CreateSecurityGroup (Maybe [TagSpecification]) Source #
The tags to assign to the security group.
createSecurityGroup_vpcId :: Lens' CreateSecurityGroup (Maybe Text) Source #
- EC2-VPC
- The ID of the VPC. Required for EC2-VPC.
createSecurityGroup_description :: Lens' CreateSecurityGroup Text Source #
A description for the security group. This is informational only.
Constraints: Up to 255 characters in length
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
createSecurityGroup_groupName :: Lens' CreateSecurityGroup Text Source #
The name of the security group.
Constraints: Up to 255 characters in length. Cannot start with sg-
.
Constraints for EC2-Classic: ASCII characters
Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$*
Destructuring the Response
data CreateSecurityGroupResponse Source #
See: newCreateSecurityGroupResponse
smart constructor.
Instances
newCreateSecurityGroupResponse Source #
:: Int | |
-> Text | |
-> CreateSecurityGroupResponse |
Create a value of CreateSecurityGroupResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateSecurityGroupResponse
, createSecurityGroupResponse_tags
- The tags assigned to the security group.
$sel:httpStatus:CreateSecurityGroupResponse'
, createSecurityGroupResponse_httpStatus
- The response's http status code.
CreateSecurityGroupResponse
, createSecurityGroupResponse_groupId
- The ID of the security group.
Response Lenses
createSecurityGroupResponse_tags :: Lens' CreateSecurityGroupResponse (Maybe [Tag]) Source #
The tags assigned to the security group.
createSecurityGroupResponse_httpStatus :: Lens' CreateSecurityGroupResponse Int Source #
The response's http status code.
createSecurityGroupResponse_groupId :: Lens' CreateSecurityGroupResponse Text Source #
The ID of the security group.