aws-ip-ranges-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

EXPERIMENTAL: AWS IP Ranges Context Provider Plugin

An experimental plugin to dynamically fetch and filter the published IP ranges for AWS services within a CDK app.

It is based off the example specified in the comments of the plugins API

Installation

  1. Install the plugin
npm i aws-ip-ranges-construct aws-ip-ranges-plugin
  1. Register the plugin in cdk.json
{
  "app": "npx ts-node --prefer-ts-exts bin/app.ts",
  "plugin": ["aws-ip-ranges-plugin"]
}

Usage

import { ContextProvider } from 'aws-cdk-lib'
import { query } from 'aws-ip-ranges-plugin'
import type { AwsIpRangesResult } from 'aws-ip-ranges-plugin/lib/types'

const filters = {
  regions: ['us-east-1'],
  services: ['EC2_INSTANCE_CONNECT'],
}

const ranges = ContextProvider.getValue(this, query(filters))
  .value as AwsIpRangesResult

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i aws-ip-ranges-plugin

Weekly Downloads

1

Version

1.2.2

License

Apache-2.0

Unpacked Size

21.5 kB

Total Files

16

Last publish

Collaborators

  • gillisandrew