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
Java Maven com.proxylity:cdk-udp-gateway (package com.proxylity.cdk.udpgateway)
Go go get github.com/proxylity/cdk-udp-gateway

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.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 proxylity-cdk-udp-gateway 0.2.0
File Size Uploaded
proxylity_cdk_udp_gateway-0.2.0.tar.gz 196.0 kB Details

Built distribution (wheel)

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

Total release size: 391.3 kB

Release files / proxylity_cdk_udp_gateway-0.2.0.tar.gz

Download URL proxylity_cdk_udp_gateway-0.2.0.tar.gz
Size 196.0 kB
Tags Source
SHA-256 checksum
How to use checksums
762c7d8dca032d0407a8f9b4529fedb16a85c8775aa74480639956385aae914a
BLAKE2b-256 checksum
How to use checksums
183f6decd07bfcc5ae24d6105338bb47df2d113b11bcde48b13cd7928f7625c6
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 Oct 18, 2026.

Transparency log

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

Download URL proxylity_cdk_udp_gateway-0.2.0-py3-none-any.whl
Size 195.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff085e8e4faf8201f3dd91b6aa2f047e2a0beb0730c2a1f5059acae17d29bfdf
BLAKE2b-256 checksum
How to use checksums
29c0a6525363e0c05d9043eb4067bbae8e6e20c4e1988b399b2ce67deaf031c2
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 Oct 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

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