Skip to main content

This is an AWS CDK Geo Restric Rule on WAF V2

Project description

AWS WAF(v2) GEO Restrict Rule

GitHub npm (scoped) PyPI GitHub Workflow Status (branch) GitHub release (latest SemVer)

View on Construct Hub

This is an AWS CDK WAF Geo Restrict Rule on WAF V2

Install

TypeScript

install by npm

npm install @gammarers/aws-waf-geo-restrict-rule

install by yarn

yarn add @gammarers/aws-waf-geo-restrict-rule

Python

pip install gammarers.aws-waf-geo-restrict-rule

Example

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gammarers_aws_waf_geo_restrict_rule-2.0.56.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file gammarers_aws_waf_geo_restrict_rule-2.0.56.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.56.tar.gz
Algorithm Hash digest
SHA256 cbeb16f65b0ff3edb79ba479c581e9552d28d3aac8dc2578c11dbeffc0c4cfc0
MD5 560e8fbcf422edaea32f4a98d572fb48
BLAKE2b-256 1d639625b3ff769a5a3536d47476fec8d6d597c5ef1f5cbd7867fb2180b78a4d

See more details on using hashes here.

File details

Details for the file gammarers_aws_waf_geo_restrict_rule-2.0.56-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.56-py3-none-any.whl
Algorithm Hash digest
SHA256 cbcb81631b36a7349bbf3f9ffbf51ed9a21e9c1f7d2fe4667c6eeb34e36f1f3a
MD5 6b0ee2b999549659c05a669164cceeae
BLAKE2b-256 7291c38d4bdbf39c958eb57d417f693e1bad23b323be323d7f7cdf3ce9b8b5af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page