Skip to content
v2.274.0

Alpn Class ​

The ALPN protocol identifier.

Example ​

ts
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';

declare const myZone: route53.HostedZone;
declare const distribution: cloudfront.CloudFrontWebDistribution;
// Alias to CloudFront target
new route53.HttpsRecord(this, 'HttpsRecord-CloudFrontAlias', {
  zone: myZone,
  target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
});
// ServiceMode (priority >= 1)
new route53.HttpsRecord(this, 'HttpsRecord-ServiceMode', {
  zone: myZone,
  values: [route53.HttpsRecordValue.service({ alpn: [route53.Alpn.H3, route53.Alpn.H2] })],
});
// AliasMode (priority = 0)
new route53.HttpsRecord(this, 'HttpsRecord-AliasMode', {
  zone: myZone,
  values: [route53.HttpsRecordValue.alias('service.example.com')],
});

Properties ​

H2Alpnh2AlpnH2AlpnH2AlpnH2Alpnstatic#
HTTP2.
H3Alpnh3AlpnH3AlpnH3AlpnH3Alpnstatic#
HTTP3 (QUIC).
HTTP1_1Alpnhttp1_1AlpnHTTP1_1AlpnHTTP1_1AlpnHTTP1_1Alpnstatic#
HTTP/1.1.
protocolstringprotocolstrprotocolStringProtocolstringProtocol*string#
The ALPN protocol identifier.

Methods ​

of(protocol: string): Alpn // chainable@staticmethod def of(protocol: str) -> Alpnpublic static Alpn of(String protocol)public static Alpn Of(string protocol)func Of(Protocol *string) Alpnstatic#
A custom ALPN protocol identifier.
1 parameter

Parameters

  • protocolprotocolprotocolprotocolProtocol — The ALPN protocol identifier.