Skip to main content

PRs Welcome GitHub npm (scoped) PyPI Nuget Sonatype Nexus (Releases) GitHub Workflow Status (branch) GitHub release (latest SemVer) Gitpod ready-to-code

CDK Vpc

Utility constructs for tagging subnets or creating a cheaper vpc.

Install

TypeScript

npm install @pepperize/cdk-vpc

or

yarn add @pepperize/cdk-vpc

Python

pip install pepperize.cdk-vpc

C# / .Net

dotnet add package Pepperize.CDK.Vpc

Java

<dependency>
  <groupId>com.pepperize</groupId>
  <artifactId>cdk-vpc</artifactId>
  <version>${cdkVpc.version}</version>
</dependency>

Getting Started

  1. Create a new CDK TypeScript App project with projen

    mkdir my-project
    cd my-project
    git init -b main
    npx projen new awscdk-app-ts
    
  2. Add @pepperize/cdk-vpc to your dependencies in .projenrc.js

    const project = new awscdk.AwsCdkTypeScriptApp({
      //...
      deps: ["@pepperize/cdk-vpc"],
    });
    
  3. Install the dependency

    npx projen
    

Usage

Create a cheaper Vpc

Use this as a cheaper drop-in replacement to create a vpc with 2 AvailabilityZones and a t3.nano NatInstance.

import { App, Stack } from "aws-cdk-lib";
import { CheapVpc } from "@pepperize/cdk-vpc";

const app = new App();
const stack = new Stack(app, "MyCheapVpcStack");

new CheapVpc(stack, "MyCheapVpc");

Tag your imported subnets

Subnets imported by Vpc.fromLookup wouldn't be tagged by Tags.of automatically. To tag them (or any other imported vpc resource) use:

import { CheapVpc } from "@pepperize/cdk-vpc";
import * as ec2 from "aws-cdk-lib/aws-ec2";

const app = new App();
const stack = new Stack(app, "VpcStack");
const vpc = ec2.Vpc.fromLookup(stack, "VpcLookup", {
  vpcId: "vpc-1234567890",
  region: env.region,
});

new CreateTags(vpcStack, "TagPrivateSubnets", {
  resourceIds: vpc.privateSubnets.map((subnet) => {
    return subnet.subnetId;
  }),
  tags: [
    {
      key: "kubernetes.io/role/internal-elb",
      value: "1",
    },
  ],
});

Contributing

Contributions of all kinds are welcome 🚀 Check out our contributor's guide.

For a quick start, check out a development environment:

git clone git@github.com:pepperize/cdk-vpc
cd cdk-vpc
 # install dependencies
yarn
# build with projen
yarn build

Metadata

Release files for pepperize.cdk-vpc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pepperize.cdk-vpc 0.1.0
File Size Uploaded Provenance Actions
pepperize_cdk_vpc-0.1.0.tar.gz 48.8 kB Without provenance Details for pepperize_cdk_vpc-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pepperize.cdk-vpc 0.1.0
File Interpreter ABI Platform Actions
pepperize_cdk_vpc-0.1.0-py3-none-any.whl Python 3 none any Details for pepperize_cdk_vpc-0.1.0-py3-none-any.whl

Total release size: 98.0 kB

Release files / pepperize_cdk_vpc-0.1.0.tar.gz

Download URL pepperize_cdk_vpc-0.1.0.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bb10e1d9cdce64385bf303e2e475fab71f6b7bdaec673b2621b6e666ea7ad13e
BLAKE2b-256 checksum
How to use checksums
82d90dcd7fd86b8429ec16eb8f6016b43403428c49ef16cbd59ec24e7d2dc76c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.15.2

Release files / pepperize_cdk_vpc-0.1.0-py3-none-any.whl

Download URL pepperize_cdk_vpc-0.1.0-py3-none-any.whl
Size 49.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe4900147389348a0b14d4ec66a6811fc87d75ef8741e426081a6ea867c1a0f6
BLAKE2b-256 checksum
How to use checksums
09278f2299ac0e14785d16efdcca49570ecd821b75db3ede9cc1bd2321942ae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.15.2

Security for pepperize.cdk-vpc 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page