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

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.59.tar.gz
Algorithm Hash digest
SHA256 bdf346f4a13ae53974953d494481aed5fcdc410bf7952ae560db5b23f51e6eb5
MD5 d138994be2cd87c4280b59eb38fffa8e
BLAKE2b-256 f116350bd2682f6383cf5218ea347ef7013564b3105ec64df04a660da8910853

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_waf_geo_restrict_rule-2.0.59-py3-none-any.whl
Algorithm Hash digest
SHA256 bd22d7c22bc661a0c7bade67e8694565a6c459d475333e32a684a09e7d613246
MD5 d138b03c101d925d9391408d4aa2814d
BLAKE2b-256 83ab2d0ab0b1905ce4f7f820447c0def024a993bea81ab7c05381f684a5e33b1

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