Class CfnWebACLAssociation
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::WAFv2::WebACLAssociation
.
This is the latest version of AWS WAF , named AWS WAF V2, released in November, 2019. For information, including how to migrate your AWS WAF resources from the prior release, see the AWS WAF Developer Guide .
Use a web ACL association to define an association between a web ACL and a regional application resource, to protect the resource. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AWS AppSync GraphQL API, an Amazon Cognito user pool, or an AWS App Runner service.
For Amazon CloudFront , don't use this resource. Instead, use your CloudFront distribution configuration. To associate a web ACL with a distribution, provide the Amazon Resource Name (ARN) of the WebACL
to your CloudFront distribution configuration. To disassociate a web ACL, provide an empty ARN. For information, see AWS::CloudFront::Distribution .
When you create a web ACL or make changes to a web ACL or web ACL components, like rules and rule groups, AWS WAF propagates the changes everywhere that the web ACL and its components are stored and used. Your changes are applied within seconds, but there might be a brief period of inconsistency when the changes have arrived in some places and not in others. So, for example, if you change a rule action setting, the action might be the old action in one area and the new action in another area. Or if you add an IP address to an IP set used in a blocking rule, the new address might briefly be blocked in one area while still allowed in another. This temporary inconsistency can occur when you first associate a web ACL with an AWS resource and when you change a web ACL that is already associated with a resource. Generally, any inconsistencies of this type last only a few seconds.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.wafv2.*; CfnWebACLAssociation cfnWebACLAssociation = CfnWebACLAssociation.Builder.create(this, "MyCfnWebACLAssociation") .resourceArn("resourceArn") .webAclArn("webAclArn") .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnWebACLAssociation
(Construct scope, String id, CfnWebACLAssociationProps props) Create a newAWS::WAFv2::WebACLAssociation
.protected
CfnWebACLAssociation
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnWebACLAssociation
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the resource to associate with the web ACL.The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setResourceArn
(String value) The Amazon Resource Name (ARN) of the resource to associate with the web ACL.void
setWebAclArn
(String value) The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnWebACLAssociation
protected CfnWebACLAssociation(software.amazon.jsii.JsiiObjectRef objRef) -
CfnWebACLAssociation
protected CfnWebACLAssociation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnWebACLAssociation
@Stability(Stable) public CfnWebACLAssociation(@NotNull Construct scope, @NotNull String id, @NotNull CfnWebACLAssociationProps props) Create a newAWS::WAFv2::WebACLAssociation
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getResourceArn
The Amazon Resource Name (ARN) of the resource to associate with the web ACL.The ARN must be in one of the following formats:
- For an Application Load Balancer:
arn:aws:elasticloadbalancing: *region* : *account-id* :loadbalancer/app/ *load-balancer-name* / *load-balancer-id*
- For an Amazon API Gateway REST API:
arn:aws:apigateway: *region* ::/restapis/ *api-id* /stages/ *stage-name*
- For an AWS AppSync GraphQL API:
arn:aws:appsync: *region* : *account-id* :apis/ *GraphQLApiId*
- For an Amazon Cognito user pool:
arn:aws:cognito-idp: *region* : *account-id* :userpool/ *user-pool-id*
- For an AWS App Runner service:
arn:aws:apprunner: *region* : *account-id* :service/ *apprunner-service-name* / *apprunner-service-id*
- For an Application Load Balancer:
-
setResourceArn
The Amazon Resource Name (ARN) of the resource to associate with the web ACL.The ARN must be in one of the following formats:
- For an Application Load Balancer:
arn:aws:elasticloadbalancing: *region* : *account-id* :loadbalancer/app/ *load-balancer-name* / *load-balancer-id*
- For an Amazon API Gateway REST API:
arn:aws:apigateway: *region* ::/restapis/ *api-id* /stages/ *stage-name*
- For an AWS AppSync GraphQL API:
arn:aws:appsync: *region* : *account-id* :apis/ *GraphQLApiId*
- For an Amazon Cognito user pool:
arn:aws:cognito-idp: *region* : *account-id* :userpool/ *user-pool-id*
- For an AWS App Runner service:
arn:aws:apprunner: *region* : *account-id* :service/ *apprunner-service-name* / *apprunner-service-id*
- For an Application Load Balancer:
-
getWebAclArn
The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource. -
setWebAclArn
The Amazon Resource Name (ARN) of the web ACL that you want to associate with the resource.
-