Skip to main content

@proxylity/cdk-udp-gateway

L1 (CloudFormation-faithful) AWS CDK construct library for the Proxylity UDP Gateway custom resources. Build event-driven UDP/WireGuard/DTLS/WebRTC datagram services on AWS without operating listener servers.

This is the L1 layer: thin, un-opinionated, 1:1 wrappers of the Proxylity UDP Gateway CloudFormation custom resources. Each construct emits exactly one Custom::ProxylityUdpGateway* resource with the property keys the service reads, in the PascalCase shape it expects on the wire. L1 adds no derived IAM, no invented enums, and no defaults beyond what the resource itself applies.

You must be subscribed to Proxylity UDP Gateway in AWS Marketplace to deploy stacks that use these constructs.

Install

Language Package
TypeScript / JavaScript npm install @proxylity/cdk-udp-gateway
Python pip install proxylity-cdk-udp-gateway (module proxylity_cdk_udp_gateway)
.NET dotnet add package Proxylity.CDK.UdpGateway

Peer dependencies: aws-cdk-lib@^2.160.0 and constructs@^10.0.0.

Resources

Construct CloudFormation type Notes
CfnListener Custom::ProxylityUdpGatewayListener The main resource. Inline destinations live in destinations.
CfnDestinationArn Custom::ProxylityUdpGatewayDestinationArn Registers one ARN for one destination in one ingress region.
CfnPacketSource Custom::ProxylityUdpGatewayPacketSource Subscribes a listener to an SNS topic for server-initiated push.
ProxylityConfig (helper, not a resource) Injects the account/region config mapping and resolves ServiceToken/ServiceRole/ApiKey.

A standalone top-level destination resource is not shipped: destinations are created inline via CfnListener.destinations.

Usage

Every Proxylity stack begins by materializing the account/region configuration mapping with ProxylityConfig, then uses its accessors to resolve the ServiceToken and ApiKey for each resource. ProxylityConfig.forStack is idempotent — the Mappings.ProxylityConfig block is emitted exactly once per stack.

The example below reproduces the packet-counter example stack: a udp listener restricted to a caller-supplied CIDR, with one inline Lambda destination.

import { App, CfnParameter, CfnOutput, Fn, Stack, StackProps } from 'aws-cdk-lib';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as iam from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';
import { ProxylityConfig, CfnListener } from '@proxylity/cdk-udp-gateway';

class PacketCounterStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const clientCidr = new CfnParameter(this, 'ClientCidrToAllow', {
      type: 'String',
      default: '0.0.0.0/0',
    });

    const config = ProxylityConfig.forStack(this);

    const fn = new lambda.Function(this, 'PacketCounterLambda', {
      runtime: lambda.Runtime.NODEJS_22_X,
      handler: 'index.handler',
      code: lambda.Code.fromInline('exports.handler = async (e) => ({ Replies: [] });'),
    });

    // The destination role trusts the Proxylity ServiceRole (not lambda.amazonaws.com).
    const role = new iam.Role(this, 'DestinationRole', {
      assumedBy: new iam.ArnPrincipal(config.serviceRole()),
    });
    fn.grantInvoke(role);

    const listener = new CfnListener(this, 'UdpListener', {
      serviceToken: config.serviceToken(),
      apiKey: config.apiKey(),
      protocols: ['udp'],
      clientRestrictions: { networks: [clientCidr.valueAsString] },
      destinations: [
        {
          description: 'Delivers to the packet counter lambda.',
          role: { arn: role.roleArn },
          batching: { count: 1000, timeoutInSeconds: 1 },
          metricsEnabled: true,
          destinationArn: fn.functionArn,
        },
      ],
    });

    new CfnOutput(this, 'Endpoint', {
      value: Fn.sub('${Domain}.proxylity.com:${Port}', {
        Domain: listener.attrDomain,
        Port: listener.attrPort,
      }),
    });
  }
}

const app = new App();
new PacketCounterStack(app, 'PacketCounter');

Outputs

CfnListener exposes listener outputs as Fn::GetAtt tokens: attrId, attrPort, attrDomain, and the string-list attrDestinationNames, plus protocol-specific getters (attrWireGuardPublicKey; attrDtlsServerCertificate; attrWebRtcFingerprint, attrWebRtcSctpPort, attrWebRtcChannelId, attrWebRtcSignalingMode, attrWebRtcSignalingToken, attrWebRtcSignalingUrl). Numeric values (attrPort, attrWebRtcSctpPort, attrWebRtcChannelId) are returned as string tokens; wrap with Token.asNumber(...) if you need a number.

Protocols

protocols must contain exactly one of udp, wg, dtls, or webrtc. Protocol-specific properties are optional members on CfnListenerProps; the service rejects invalid cross-protocol combinations. See the JSDoc on each property for its behavior.

Fidelity

L1 is faithful to the service: if the resource accepts an input, L1 emits it; if the resource rejects it, the stack event explains why. L1 performs only one client-side check — an inline destination may not set both destinationArn and destinationArnMap (both map to the single DestinationArn wire key). Everything else (CIDR/ARN/base64 formats, name regex, enum membership, numeric ranges, cross-field requirements) is left to the resource.

Metadata

Release files for proxylity-cdk-udp-gateway 0.2.3

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

Source distribution (sdist)

Source distribution for proxylity-cdk-udp-gateway 0.2.3
File Size Uploaded Provenance Actions
proxylity_cdk_udp_gateway-0.2.3.tar.gz 198.6 kB With provenance Details for proxylity_cdk_udp_gateway-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for proxylity-cdk-udp-gateway 0.2.3
File Interpreter ABI Platform Actions
proxylity_cdk_udp_gateway-0.2.3-py3-none-any.whl Python 3 none any Details for proxylity_cdk_udp_gateway-0.2.3-py3-none-any.whl

Total release size: 396.4 kB

Release files / proxylity_cdk_udp_gateway-0.2.3.tar.gz

Download URL proxylity_cdk_udp_gateway-0.2.3.tar.gz
Size 198.6 kB
Tags Source
SHA-256 checksum
How to use checksums
11dfce2f9709cf41f1d44c6eeb068ffa43a63d871274102e2ea784826462d0f5
BLAKE2b-256 checksum
How to use checksums
6831d645f42cfce7adca8d1f9c0a3222dbb5adfc8b4801957710e59bd4ad89dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Release files / proxylity_cdk_udp_gateway-0.2.3-py3-none-any.whl

Download URL proxylity_cdk_udp_gateway-0.2.3-py3-none-any.whl
Size 197.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
375d9809b05dc7108f0e62ffebdd2528a71cb80e60aad3a237af96c66d788942
BLAKE2b-256 checksum
How to use checksums
32b2d7af04031b007adc70f38fd4c713d9633df1e01a0b99d22ea513f39a4f5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

Security for proxylity-cdk-udp-gateway 0.2.3

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for proxylity_cdk_udp_gateway-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.

Transparency log

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.

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