amazonka-ec2-1.4.5: Amazon Elastic Compute Cloud SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.CreateSecurityGroup

Contents

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 .

Synopsis

Creating a Request

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 is DryRunOperation . Otherwise, it is UnauthorizedOperation .
  • 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

Eq CreateSecurityGroup # 
Data CreateSecurityGroup # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateSecurityGroup -> c CreateSecurityGroup #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateSecurityGroup #

toConstr :: CreateSecurityGroup -> Constr #

dataTypeOf :: CreateSecurityGroup -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CreateSecurityGroup) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateSecurityGroup) #

gmapT :: (forall b. Data b => b -> b) -> CreateSecurityGroup -> CreateSecurityGroup #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateSecurityGroup -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateSecurityGroup -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateSecurityGroup -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateSecurityGroup -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateSecurityGroup -> m CreateSecurityGroup #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSecurityGroup -> m CreateSecurityGroup #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSecurityGroup -> m CreateSecurityGroup #

Read CreateSecurityGroup # 
Show CreateSecurityGroup # 
Generic CreateSecurityGroup # 
Hashable CreateSecurityGroup # 
NFData CreateSecurityGroup # 

Methods

rnf :: CreateSecurityGroup -> () #

AWSRequest CreateSecurityGroup # 
ToQuery CreateSecurityGroup # 
ToPath CreateSecurityGroup # 
ToHeaders CreateSecurityGroup # 
type Rep CreateSecurityGroup # 
type Rep CreateSecurityGroup = D1 (MetaData "CreateSecurityGroup" "Network.AWS.EC2.CreateSecurityGroup" "amazonka-ec2-1.4.5-C4CR35JggG2GhWFrIiKGhu" False) (C1 (MetaCons "CreateSecurityGroup'" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "_csgVPCId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_csgDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "_csgGroupName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_csgDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs CreateSecurityGroup # 

Request Lenses

csgVPCId :: Lens' CreateSecurityGroup (Maybe Text) #

EC2-VPC
The ID of the VPC. Required for EC2-VPC.

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

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:

data CreateSecurityGroupResponse #

Contains the output of CreateSecurityGroup.

See: createSecurityGroupResponse smart constructor.

Instances

Eq CreateSecurityGroupResponse # 
Data CreateSecurityGroupResponse # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CreateSecurityGroupResponse -> c CreateSecurityGroupResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CreateSecurityGroupResponse #

toConstr :: CreateSecurityGroupResponse -> Constr #

dataTypeOf :: CreateSecurityGroupResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CreateSecurityGroupResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CreateSecurityGroupResponse) #

gmapT :: (forall b. Data b => b -> b) -> CreateSecurityGroupResponse -> CreateSecurityGroupResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CreateSecurityGroupResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CreateSecurityGroupResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> CreateSecurityGroupResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> CreateSecurityGroupResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> CreateSecurityGroupResponse -> m CreateSecurityGroupResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSecurityGroupResponse -> m CreateSecurityGroupResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CreateSecurityGroupResponse -> m CreateSecurityGroupResponse #

Read CreateSecurityGroupResponse # 
Show CreateSecurityGroupResponse # 
Generic CreateSecurityGroupResponse # 
NFData CreateSecurityGroupResponse # 
type Rep CreateSecurityGroupResponse # 
type Rep CreateSecurityGroupResponse = D1 (MetaData "CreateSecurityGroupResponse" "Network.AWS.EC2.CreateSecurityGroup" "amazonka-ec2-1.4.5-C4CR35JggG2GhWFrIiKGhu" False) (C1 (MetaCons "CreateSecurityGroupResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_csgrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Just Symbol "_csgrsGroupId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))

Response Lenses

csgrsGroupId :: Lens' CreateSecurityGroupResponse Text #

The ID of the security group.