Copyright | (c) 2013-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Network.AWS.EC2.CreateSecurityGroup
Description
Creates a security group.
A security group is for use with instances either in the EC2-Classic platform or in a specific VPC. 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 .
Important: EC2-Classic: You can have up to 500 security groups.
EC2-VPC: You can create up to 500 security groups per VPC.
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
.
- createSecurityGroup :: Text -> Text -> CreateSecurityGroup
- data CreateSecurityGroup
- csgVPCId :: Lens' CreateSecurityGroup (Maybe Text)
- csgDryRun :: Lens' CreateSecurityGroup (Maybe Bool)
- csgGroupName :: Lens' CreateSecurityGroup Text
- csgDescription :: Lens' CreateSecurityGroup Text
- createSecurityGroupResponse :: Int -> Text -> CreateSecurityGroupResponse
- data CreateSecurityGroupResponse
- csgrsResponseStatus :: Lens' CreateSecurityGroupResponse Int
- csgrsGroupId :: Lens' CreateSecurityGroupResponse Text
Creating a Request
Arguments
:: Text | |
-> Text | |
-> CreateSecurityGroup |
Creates a value of CreateSecurityGroup
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
csgVPCId
- [EC2-VPC] The ID of the VPC. Required for EC2-VPC.csgDryRun
- 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 isDryRunOperation
. Otherwise, it isUnauthorizedOperation
.csgGroupName
- The name of the security group. 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 ._-:/()#,@[]+=&;{}!$*csgDescription
- 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 ._-:/()#,@[]+=&;{}!$*
data CreateSecurityGroup #
Contains the parameters for CreateSecurityGroup.
See: createSecurityGroup
smart constructor.
Instances
Request Lenses
csgDryRun :: Lens' CreateSecurityGroup (Maybe Bool) #
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
.
csgGroupName :: Lens' CreateSecurityGroup Text #
The name of the security group. 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 ._-:/()#,@[]+=&;{}!$*
csgDescription :: Lens' CreateSecurityGroup Text #
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 ._-:/()#,@[]+=&;{}!$*
Destructuring the Response
Arguments
:: Int | |
-> Text | |
-> CreateSecurityGroupResponse |
Creates a value of CreateSecurityGroupResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
csgrsResponseStatus
- -- | The response status code.csgrsGroupId
- The ID of the security group.
data CreateSecurityGroupResponse #
Contains the output of CreateSecurityGroup.
See: createSecurityGroupResponse
smart constructor.
Response Lenses
csgrsResponseStatus :: Lens' CreateSecurityGroupResponse Int #
- - | The response status code.
csgrsGroupId :: Lens' CreateSecurityGroupResponse Text #
The ID of the security group.