amazonka-wafv2-2.0: Amazon WAFV2 SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.WAFV2.CreateWebACL

Description

Creates a WebACL per the specifications provided.

A web ACL defines a collection of rules to use to inspect and control web requests. Each rule has an action defined (allow, block, or count) for requests that match the statement of the rule. In the web ACL, you assign a default action to take (allow, block) for any request that does not match any of the rules. The rules in a web ACL can be a combination of the types Rule, RuleGroup, and managed rule group. You can associate a web ACL with one or more Amazon Web Services resources to protect. The resources can be an Amazon CloudFront distribution, an Amazon API Gateway REST API, an Application Load Balancer, an AppSync GraphQL API, or an Amazon Cognito user pool.

Synopsis

Creating a Request

data CreateWebACL Source #

See: newCreateWebACL smart constructor.

Constructors

CreateWebACL' 

Fields

  • captchaConfig :: Maybe CaptchaConfig

    Specifies how WAF should handle CAPTCHA evaluations for rules that don't have their own CaptchaConfig settings. If you don't specify this, WAF uses its default settings for CaptchaConfig.

  • challengeConfig :: Maybe ChallengeConfig

    Specifies how WAF should handle challenge evaluations for rules that don't have their own ChallengeConfig settings. If you don't specify this, WAF uses its default settings for ChallengeConfig.

  • customResponseBodies :: Maybe (HashMap Text CustomResponseBody)

    A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.

    For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

    For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

  • description :: Maybe Text

    A description of the web ACL that helps with identification.

  • rules :: Maybe [Rule]

    The Rule statements used to identify the web requests that you want to allow, block, or count. Each rule includes one top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.

  • tags :: Maybe (NonEmpty Tag)

    An array of key:value pairs to associate with the resource.

  • tokenDomains :: Maybe (NonEmpty Text)

    Specifies the domains that WAF should accept in a web request token. This enables the use of tokens across multiple protected websites. When WAF provides a token, it uses the domain of the Amazon Web Services resource that the web ACL is protecting. If you don't specify a list of token domains, WAF accepts tokens only for the domain of the protected resource. With a token domain list, WAF accepts the resource's host domain plus all domains in the token domain list, including their prefixed subdomains.

    Example JSON: "TokenDomains": { "mywebsite.com", "myotherwebsite.com" }

    Public suffixes aren't allowed. For example, you can't use usa.gov or co.uk as token domains.

  • name :: Text

    The name of the web ACL. You cannot change the name of a web ACL after you create it.

  • scope :: Scope

    Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon Cognito user pool.

    To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:

    • CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1.
    • API and SDKs - For all calls, use the Region endpoint us-east-1.
  • defaultAction :: DefaultAction

    The action to perform if none of the Rules contained in the WebACL match.

  • visibilityConfig :: VisibilityConfig

    Defines and enables Amazon CloudWatch metrics and web request sample collection.

Instances

Instances details
ToJSON CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

ToHeaders CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

ToPath CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

ToQuery CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

AWSRequest CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Associated Types

type AWSResponse CreateWebACL #

Generic CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Associated Types

type Rep CreateWebACL :: Type -> Type #

Read CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Show CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

NFData CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Methods

rnf :: CreateWebACL -> () #

Eq CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Hashable CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

type AWSResponse CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

type Rep CreateWebACL Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

type Rep CreateWebACL = D1 ('MetaData "CreateWebACL" "Amazonka.WAFV2.CreateWebACL" "amazonka-wafv2-2.0-3v3WgpYn7RT5hSd6MsT5dN" 'False) (C1 ('MetaCons "CreateWebACL'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "captchaConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe CaptchaConfig)) :*: S1 ('MetaSel ('Just "challengeConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ChallengeConfig))) :*: (S1 ('MetaSel ('Just "customResponseBodies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text CustomResponseBody))) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "rules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Rule]))))) :*: ((S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty Tag))) :*: (S1 ('MetaSel ('Just "tokenDomains") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty Text))) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "scope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Scope) :*: (S1 ('MetaSel ('Just "defaultAction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 DefaultAction) :*: S1 ('MetaSel ('Just "visibilityConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 VisibilityConfig))))))

newCreateWebACL Source #

Create a value of CreateWebACL with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateWebACL, createWebACL_captchaConfig - Specifies how WAF should handle CAPTCHA evaluations for rules that don't have their own CaptchaConfig settings. If you don't specify this, WAF uses its default settings for CaptchaConfig.

CreateWebACL, createWebACL_challengeConfig - Specifies how WAF should handle challenge evaluations for rules that don't have their own ChallengeConfig settings. If you don't specify this, WAF uses its default settings for ChallengeConfig.

CreateWebACL, createWebACL_customResponseBodies - A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.

For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

CreateWebACL, createWebACL_description - A description of the web ACL that helps with identification.

CreateWebACL, createWebACL_rules - The Rule statements used to identify the web requests that you want to allow, block, or count. Each rule includes one top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.

CreateWebACL, createWebACL_tags - An array of key:value pairs to associate with the resource.

CreateWebACL, createWebACL_tokenDomains - Specifies the domains that WAF should accept in a web request token. This enables the use of tokens across multiple protected websites. When WAF provides a token, it uses the domain of the Amazon Web Services resource that the web ACL is protecting. If you don't specify a list of token domains, WAF accepts tokens only for the domain of the protected resource. With a token domain list, WAF accepts the resource's host domain plus all domains in the token domain list, including their prefixed subdomains.

Example JSON: "TokenDomains": { "mywebsite.com", "myotherwebsite.com" }

Public suffixes aren't allowed. For example, you can't use usa.gov or co.uk as token domains.

CreateWebACL, createWebACL_name - The name of the web ACL. You cannot change the name of a web ACL after you create it.

CreateWebACL, createWebACL_scope - Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon Cognito user pool.

To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:

  • CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1.
  • API and SDKs - For all calls, use the Region endpoint us-east-1.

CreateWebACL, createWebACL_defaultAction - The action to perform if none of the Rules contained in the WebACL match.

CreateWebACL, createWebACL_visibilityConfig - Defines and enables Amazon CloudWatch metrics and web request sample collection.

Request Lenses

createWebACL_captchaConfig :: Lens' CreateWebACL (Maybe CaptchaConfig) Source #

Specifies how WAF should handle CAPTCHA evaluations for rules that don't have their own CaptchaConfig settings. If you don't specify this, WAF uses its default settings for CaptchaConfig.

createWebACL_challengeConfig :: Lens' CreateWebACL (Maybe ChallengeConfig) Source #

Specifies how WAF should handle challenge evaluations for rules that don't have their own ChallengeConfig settings. If you don't specify this, WAF uses its default settings for ChallengeConfig.

createWebACL_customResponseBodies :: Lens' CreateWebACL (Maybe (HashMap Text CustomResponseBody)) Source #

A map of custom response keys and content bodies. When you create a rule with a block action, you can send a custom response to the web request. You define these for the web ACL, and then use them in the rules and default actions that you define in the web ACL.

For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

createWebACL_description :: Lens' CreateWebACL (Maybe Text) Source #

A description of the web ACL that helps with identification.

createWebACL_rules :: Lens' CreateWebACL (Maybe [Rule]) Source #

The Rule statements used to identify the web requests that you want to allow, block, or count. Each rule includes one top-level statement that WAF uses to identify matching web requests, and parameters that govern how WAF handles them.

createWebACL_tags :: Lens' CreateWebACL (Maybe (NonEmpty Tag)) Source #

An array of key:value pairs to associate with the resource.

createWebACL_tokenDomains :: Lens' CreateWebACL (Maybe (NonEmpty Text)) Source #

Specifies the domains that WAF should accept in a web request token. This enables the use of tokens across multiple protected websites. When WAF provides a token, it uses the domain of the Amazon Web Services resource that the web ACL is protecting. If you don't specify a list of token domains, WAF accepts tokens only for the domain of the protected resource. With a token domain list, WAF accepts the resource's host domain plus all domains in the token domain list, including their prefixed subdomains.

Example JSON: "TokenDomains": { "mywebsite.com", "myotherwebsite.com" }

Public suffixes aren't allowed. For example, you can't use usa.gov or co.uk as token domains.

createWebACL_name :: Lens' CreateWebACL Text Source #

The name of the web ACL. You cannot change the name of a web ACL after you create it.

createWebACL_scope :: Lens' CreateWebACL Scope Source #

Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon Cognito user pool.

To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:

  • CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1.
  • API and SDKs - For all calls, use the Region endpoint us-east-1.

createWebACL_defaultAction :: Lens' CreateWebACL DefaultAction Source #

The action to perform if none of the Rules contained in the WebACL match.

createWebACL_visibilityConfig :: Lens' CreateWebACL VisibilityConfig Source #

Defines and enables Amazon CloudWatch metrics and web request sample collection.

Destructuring the Response

data CreateWebACLResponse Source #

See: newCreateWebACLResponse smart constructor.

Constructors

CreateWebACLResponse' 

Fields

  • summary :: Maybe WebACLSummary

    High-level information about a WebACL, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Associated Types

type Rep CreateWebACLResponse :: Type -> Type #

Read CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Show CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

NFData CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

Methods

rnf :: CreateWebACLResponse -> () #

Eq CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

type Rep CreateWebACLResponse Source # 
Instance details

Defined in Amazonka.WAFV2.CreateWebACL

type Rep CreateWebACLResponse = D1 ('MetaData "CreateWebACLResponse" "Amazonka.WAFV2.CreateWebACL" "amazonka-wafv2-2.0-3v3WgpYn7RT5hSd6MsT5dN" 'False) (C1 ('MetaCons "CreateWebACLResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "summary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe WebACLSummary)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreateWebACLResponse Source #

Create a value of CreateWebACLResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:summary:CreateWebACLResponse', createWebACLResponse_summary - High-level information about a WebACL, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL.

$sel:httpStatus:CreateWebACLResponse', createWebACLResponse_httpStatus - The response's http status code.

Response Lenses

createWebACLResponse_summary :: Lens' CreateWebACLResponse (Maybe WebACLSummary) Source #

High-level information about a WebACL, returned by operations like create and list. This provides information like the ID, that you can use to retrieve and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL.