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

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@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 Source #

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 .
  • 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 ._-:/()#,@[]+=&;{}!$*
  • csgGroupName - 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 ._-:/()#,@[]+=&;{}!$*

data CreateSecurityGroup Source #

Contains the parameters for CreateSecurityGroup.

See: createSecurityGroup smart constructor.

Instances
Eq CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Data CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.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 Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Show CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Generic CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Associated Types

type Rep CreateSecurityGroup :: Type -> Type #

Hashable CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

AWSRequest CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Associated Types

type Rs CreateSecurityGroup :: Type #

ToHeaders CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

ToPath CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

ToQuery CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

NFData CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Methods

rnf :: CreateSecurityGroup -> () #

type Rep CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

type Rep CreateSecurityGroup = D1 (MetaData "CreateSecurityGroup" "Network.AWS.EC2.CreateSecurityGroup" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "CreateSecurityGroup'" PrefixI True) ((S1 (MetaSel (Just "_csgVPCId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_csgDryRun") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 (MetaSel (Just "_csgDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_csgGroupName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))))
type Rs CreateSecurityGroup Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Request Lenses

csgVPCId :: Lens' CreateSecurityGroup (Maybe Text) Source #

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

csgDryRun :: 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 .

csgDescription :: 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 ._-:/()#,@[]+=&;{}!$*

csgGroupName :: 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

createSecurityGroupResponse Source #

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 Source #

Contains the output of CreateSecurityGroup.

See: createSecurityGroupResponse smart constructor.

Instances
Eq CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Data CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

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 Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Show CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Generic CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

Associated Types

type Rep CreateSecurityGroupResponse :: Type -> Type #

NFData CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

type Rep CreateSecurityGroupResponse Source # 
Instance details

Defined in Network.AWS.EC2.CreateSecurityGroup

type Rep CreateSecurityGroupResponse = D1 (MetaData "CreateSecurityGroupResponse" "Network.AWS.EC2.CreateSecurityGroup" "amazonka-ec2-1.6.1-GgG1M0FWcBrE5I5IM2QktE" False) (C1 (MetaCons "CreateSecurityGroupResponse'" PrefixI True) (S1 (MetaSel (Just "_csgrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "_csgrsGroupId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))

Response Lenses

csgrsGroupId :: Lens' CreateSecurityGroupResponse Text Source #

The ID of the security group.