@gammarers/aws-waf-geo-restrict-rule
v2.0.59
Published
This is an AWS CDK Geo Restric Rule on WAF V2
Readme
AWS WAF(v2) GEO Restrict Rule
This is an AWS CDK WAF Geo Restrict Rule on WAF V2
Install
TypeScript
install by npm
npm install @gammarers/aws-waf-geo-restrict-ruleinstall by yarn
yarn add @gammarers/aws-waf-geo-restrict-rulePython
pip install gammarers.aws-waf-geo-restrict-ruleExample
import { WAFGeoRestrictRule } from '@gammarers/aws-waf-geo-restrict-rule';
const geoRestrictRule = new WAFGeoRestrictRule({
allowCountries: ['JP'],
});
new wafv2.CfnWebACL(stack, 'WebACL', {
defaultAction: { allow: {} },
scope: 'CLOUD_FRONT',
name: 'WebAclWithCustomRules',
visibilityConfig: {
cloudWatchMetricsEnabled: true,
metricName: 'WebAclMetric',
sampledRequestsEnabled: true,
},
rules: [
geoRestrictRule.allowRule({
priority: 1,
}),
geoRestrictRule.blockRule({
priority: 2,
}),
],
});
License
This project is licensed under the Apache-2.0 License.
