Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data CreateWebACL = CreateWebACL' {
- captchaConfig :: Maybe CaptchaConfig
- challengeConfig :: Maybe ChallengeConfig
- customResponseBodies :: Maybe (HashMap Text CustomResponseBody)
- description :: Maybe Text
- rules :: Maybe [Rule]
- tags :: Maybe (NonEmpty Tag)
- tokenDomains :: Maybe (NonEmpty Text)
- name :: Text
- scope :: Scope
- defaultAction :: DefaultAction
- visibilityConfig :: VisibilityConfig
- newCreateWebACL :: Text -> Scope -> DefaultAction -> VisibilityConfig -> CreateWebACL
- createWebACL_captchaConfig :: Lens' CreateWebACL (Maybe CaptchaConfig)
- createWebACL_challengeConfig :: Lens' CreateWebACL (Maybe ChallengeConfig)
- createWebACL_customResponseBodies :: Lens' CreateWebACL (Maybe (HashMap Text CustomResponseBody))
- createWebACL_description :: Lens' CreateWebACL (Maybe Text)
- createWebACL_rules :: Lens' CreateWebACL (Maybe [Rule])
- createWebACL_tags :: Lens' CreateWebACL (Maybe (NonEmpty Tag))
- createWebACL_tokenDomains :: Lens' CreateWebACL (Maybe (NonEmpty Text))
- createWebACL_name :: Lens' CreateWebACL Text
- createWebACL_scope :: Lens' CreateWebACL Scope
- createWebACL_defaultAction :: Lens' CreateWebACL DefaultAction
- createWebACL_visibilityConfig :: Lens' CreateWebACL VisibilityConfig
- data CreateWebACLResponse = CreateWebACLResponse' {}
- newCreateWebACLResponse :: Int -> CreateWebACLResponse
- createWebACLResponse_summary :: Lens' CreateWebACLResponse (Maybe WebACLSummary)
- createWebACLResponse_httpStatus :: Lens' CreateWebACLResponse Int
Creating a Request
data CreateWebACL Source #
See: newCreateWebACL
smart constructor.
CreateWebACL' | |
|
Instances
:: Text | |
-> Scope | |
-> DefaultAction | |
-> VisibilityConfig | |
-> CreateWebACL |
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.
CreateWebACLResponse' | |
|
Instances
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.
createWebACLResponse_httpStatus :: Lens' CreateWebACLResponse Int Source #
The response's http status code.