amazonka-waf-1.5.0: Amazon WAF SDK.

Copyright(c) 2013-2017 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.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:

  • Create and update the predicates that you want to include in the Rule . For more information, see CreateByteMatchSet , CreateIPSet , and CreateSqlInjectionMatchSet .
  • Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of a CreateRule request.
  • Submit a CreateRule request.
  • Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateRule request.
  • Submit an UpdateRule request to specify the predicates that you want to include in the Rule .
  • 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:

  • crName - A friendly name or description of the Rule . You can't change the name of a Rule after you create it.
  • crMetricName - 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 - The value returned by the most recent call to GetChangeToken .

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 :: * -> * #

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

Methods

rnf :: CreateRule -> () #

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

Methods

toHeaders :: CreateRule -> [Header] #

type Rep CreateRule Source # 
type Rep CreateRule = D1 (MetaData "CreateRule" "Network.AWS.WAF.CreateRule" "amazonka-waf-1.5.0-7MotG1cKFRJDGEqr7Xc0q6" 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:

  • crrsRule - The Rule returned in the CreateRule response.
  • crrsChangeToken - 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 .
  • crrsResponseStatus - -- | The response status code.

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.5.0-7MotG1cKFRJDGEqr7Xc0q6" 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 .

crrsResponseStatus :: Lens' CreateRuleResponse Int Source #

  • - | The response status code.