amazonka-waf-1.4.3: Amazon WAF 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.WAF.CreateRule

Contents

Description

Creates a Rule, which contains the IPSet objects, ByteMatchSet objects, and other predicates that identify the requests that you want to block. If you add more than one predicate to a Rule, a request must match all of the specifications to be allowed or blocked. For example, suppose you add the following to a Rule:

  • An IPSet that matches the IP address '192.0.2.44\/32'
  • A ByteMatchSet that matches BadBot in the 'User-Agent' header

You then add the Rule to a WebACL and specify that you want to blocks requests that satisfy the Rule. For a request to be blocked, it must come from the IP address 192.0.2.44 and the 'User-Agent' header in the request must contain the value BadBot.

To create and configure a Rule, perform the following steps:

  1. Create and update the predicates that you want to include in the Rule. For more information, see CreateByteMatchSet, CreateIPSet, and CreateSqlInjectionMatchSet.
  2. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of a CreateRule request.
  3. Submit a CreateRule request.
  4. Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRule request.
  5. Submit an UpdateRule request to specify the predicates that you want to include in the Rule.
  6. Create and update a WebACL that contains the Rule. For more information, see CreateWebACL.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.

Synopsis

Creating a Request

createRule Source #

Creates a value of CreateRule with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data CreateRule Source #

See: createRule smart constructor.

Instances

Eq CreateRule Source # 
Data CreateRule Source # 

Methods

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

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

toConstr :: CreateRule -> Constr #

dataTypeOf :: CreateRule -> DataType #

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

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

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

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

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

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

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

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

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

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

Read CreateRule Source # 
Show CreateRule Source # 
Generic CreateRule Source # 

Associated Types

type Rep CreateRule :: * -> * #

ToJSON CreateRule Source # 
Hashable CreateRule Source # 
NFData CreateRule Source # 

Methods

rnf :: CreateRule -> () #

AWSRequest CreateRule Source # 
ToPath CreateRule Source # 
ToHeaders CreateRule Source # 

Methods

toHeaders :: CreateRule -> [Header] #

ToQuery CreateRule Source # 
type Rep CreateRule Source # 
type Rep CreateRule = D1 (MetaData "CreateRule" "Network.AWS.WAF.CreateRule" "amazonka-waf-1.4.3-HJkEVBX92ZdHK435qw2Wf" False) (C1 (MetaCons "CreateRule'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_crName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "_crMetricName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_crChangeToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)))))
type Rs CreateRule Source # 

Request Lenses

crName :: Lens' CreateRule Text Source #

A friendly name or description of the Rule. You can't change the name of a Rule after you create it.

crMetricName :: Lens' CreateRule Text Source #

A friendly name or description for the metrics for this Rule. The name can contain only alphanumeric characters (A-Z, a-z, 0-9); the name can't contain whitespace. You can't change the name of the metric after you create the Rule.

crChangeToken :: Lens' CreateRule Text Source #

The value returned by the most recent call to GetChangeToken.

Destructuring the Response

createRuleResponse Source #

Creates a value of CreateRuleResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data CreateRuleResponse Source #

See: createRuleResponse smart constructor.

Instances

Eq CreateRuleResponse Source # 
Data CreateRuleResponse Source # 

Methods

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

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

toConstr :: CreateRuleResponse -> Constr #

dataTypeOf :: CreateRuleResponse -> DataType #

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

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

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

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

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

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

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

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

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

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

Read CreateRuleResponse Source # 
Show CreateRuleResponse Source # 
Generic CreateRuleResponse Source # 
NFData CreateRuleResponse Source # 

Methods

rnf :: CreateRuleResponse -> () #

type Rep CreateRuleResponse Source # 
type Rep CreateRuleResponse = D1 (MetaData "CreateRuleResponse" "Network.AWS.WAF.CreateRule" "amazonka-waf-1.4.3-HJkEVBX92ZdHK435qw2Wf" False) (C1 (MetaCons "CreateRuleResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_crrsRule") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Rule))) ((:*:) (S1 (MetaSel (Just Symbol "_crrsChangeToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) (S1 (MetaSel (Just Symbol "_crrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

Response Lenses

crrsRule :: Lens' CreateRuleResponse (Maybe Rule) Source #

The Rule returned in the CreateRule response.

crrsChangeToken :: Lens' CreateRuleResponse (Maybe Text) Source #

The ChangeToken that you used to submit the CreateRule request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus.