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 Group

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

View on Construct Hub

This is an AWS CDK Construct for IP Restriction Rule Group 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.1.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.1.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_waf_ip_restrict_rule-2.0.1.tar.gz
Algorithm Hash digest
SHA256 5e60070909ca1265c530f490834056db8411df39499605679cd4d25b9058a254
MD5 5b68e008c7a14ffc321f5ddd60ed10bd
BLAKE2b-256 e8cc4f260e6a9c71c85c0ecae21083b11d5d209f8733c652b9ac1b074f899aa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers.aws_waf_ip_restrict_rule-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4c7575852d3cd952a16a61d7d41a63024a6d103c03d67813406673d623fa5d
MD5 b0deb7e8b5142b642fa9e9cf5db21656
BLAKE2b-256 0fa2d4b60005f5c1c5e20e506dbce861d3590fece080df7a3afac6023c47d2cf

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