cdk-vpc-endpoint-with-private-ip
v0.0.4
Published
CDK Construct for a VPC Endpoint with private IPs
Downloads
84
Readme
Interface VPC Endpoint with Private IP
This is a CDK construct that retrieves the private IP address of an Interface VPC Endpoint:
Architecture
Installation
npm install cdk-vpc-endpoint-with-private-ip
Usage
You can create an interface VPC endpoint and retrive its private IP addresses using the VpcEndpointWithPrivateIp
construct.
The ec2.InterfaceVpcEndpointProps
can be passed to the construct to configure the interface VPC endpoint.
import { InterfaceVpcEndpointWithPrivateIp } from 'cdk-vpc-endpoint-with-private-ip';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
declare const vpc: ec2.IVpc;
const endpoint = new InterfaceVpcEndpointWithPrivateIp(this, 'Endpoint', {
vpc,
service: ec2.InterfaceVpcEndpointAwsService.S3,
});
const privateIps = endpoint.privateIps;
Note: privateIps
is an array of CDK Tokens, and the actual IP addresses are not determined until the stack is deployed.
Special Thanks
I am greatly referencing the content of this post.