Skip to content

Instantly share code, notes, and snippets.

View ilyash-b's full-sized avatar
😄
Working on Next Generation Shell

Ilya Sher ilyash-b

😄
Working on Next Generation Shell
View GitHub Profile
@bericp1
bericp1 / VPCLatticePrefixLists.ts
Created February 1, 2025 21:58
As of 2025-02-01 CDK does not provide a way to get the managed prefix lists which VPC Lattice automatically creates in the account after you create your first `CfnServiceNetworkVpcAssociation`. This custom resource looks them up for use in e.g. Peers on security groups in other constructs.
import { Construct } from 'constructs';
import * as customResources from 'aws-cdk-lib/custom-resources';
import * as vpclattice from 'aws-cdk-lib/aws-vpclattice';
export interface VPCLatticePrefixListsProps {
region: string;
serviceNetworkVpcAssociation: vpclattice.CfnServiceNetworkVpcAssociation;
}
export class VPCLatticePrefixLists extends Construct {