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

File metadata

File hashes

Hashes for gammarers_aws_waf_ip_restrict_rule-2.0.2.tar.gz
Algorithm Hash digest
SHA256 d48843eee03449ef3bb32ca5a53f001d45fc2b7f8ad64ffff96346dfe3a156c6
MD5 7b585b6e65f165ec939e4029b9d0c0e9
BLAKE2b-256 c558f5771c521bf3d9ef0c3889de49b8b7323f94599d8c909ef231667016bf82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers.aws_waf_ip_restrict_rule-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8031bf816d11304c236d4fe05dbe999d3ff0e7115fb6e9c77fa9bbc2cd84d7a7
MD5 ed33f50b15047ccf11cf7db38ad0767c
BLAKE2b-256 e69ecb17b0aaa54df83151c76eeb251db0f0f5cb70c325187d6da285f11ee102

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