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.49.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.49.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.49.tar.gz
Algorithm Hash digest
SHA256 7fcd1eaa25460719b02e93e5e952b727cc6ab51c1bfb399e46fa5b7361bc1ef4
MD5 1a9fe60306faaaa6237417a83f5546df
BLAKE2b-256 7d32ea1cc8e2b7970585ef46ec1b768860efbdffce4d89ad003f28c2b59e75f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.49-py3-none-any.whl
Algorithm Hash digest
SHA256 b4c32109b6da8137f66e2b6934409fa8a4c20cac670bf80d336e04bc5d0f8997
MD5 ab2e3d40a333f5a82056d4a43e870274
BLAKE2b-256 6b47ea40adfe4ada2bc0b192c451489eb03459f44eaa63b349c53a0e82fb89e7

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