Skip to main content

This is an AWS CDK Construct for IP Restriction Rule on WAF V2

Project description

AWS WAF(V2) IP Restrict Rule

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

View on Construct Hub

This is an AWS CDK Construct for IP Restrict Rule on WAF V2

Install

TypeScript

install by npm

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

install by yarn

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

Python

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

Example

import { WAFIPRestrictRule } from '@gammarers/aws-waf-ip-restrict-rule';

const ipRestrictRule = new WAFIPRestrictRule(stack, 'WAFIPRestrictRule', {
  allowIpAddresses: [
    '192.0.2.0/24',
    '198.51.100.0/24',
    '203.0.113.0/24',
  ],
  scope: WAFIPRestrictRuleScope.GLOBAL,
  priority: 1,
});

new wafv2.CfnWebACL(stack, 'WebACL', {
  defaultAction: { allow: {} },
  scope: 'CLOUD_FRONT',
  name: 'WebAclWithCustomRules',
  visibilityConfig: {
    cloudWatchMetricsEnabled: true,
    metricName: 'WebAclMetric',
    sampledRequestsEnabled: true,
  },
  rules: [ipRestrictRule.rule],
});

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_ip_restrict_rule-2.0.3.tar.gz (29.3 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_ip_restrict_rule-2.0.3.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_waf_ip_restrict_rule-2.0.3.tar.gz
Algorithm Hash digest
SHA256 a1c718fa2c9cdaf9e0135180df6941be1c37f6e70840bc991f4d00c28107db51
MD5 16f713d5bfb7a51fb2332751dfdf44a4
BLAKE2b-256 b2d57e7e417f19ce47a15e2851ba8683a8febd7f6e2df1009d4355a5e8e7acf6

See more details on using hashes here.

File details

Details for the file gammarers.aws_waf_ip_restrict_rule-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers.aws_waf_ip_restrict_rule-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6f0302625e387a32e6ef89e93eab7104fa68e3fe1b524c67d0890ecab484f0a0
MD5 79d2663d8b41cc62bc52d3492b5f37aa
BLAKE2b-256 2bbb884e0cbed345f89c75d05902b7bc799b64e9fb870449cab8f5aeed2c715b

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