aws-cdk-lib.aws_cloudfront.PublicKeyProps

interface PublicKeyProps

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.PublicKeyProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#PublicKeyProps
Javasoftware.amazon.awscdk.services.cloudfront.PublicKeyProps
Pythonaws_cdk.aws_cloudfront.PublicKeyProps
TypeScript (source)aws-cdk-lib » aws_cloudfront » PublicKeyProps

Properties for creating a Public Key.

Example

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
declare const publicKey: string;
const pubKey = new cloudfront.PublicKey(this, 'MyPubKey', {
  encodedKey: publicKey,
});

const keyGroup = new cloudfront.KeyGroup(this, 'MyKeyGroup', {
  items: [
    pubKey,
  ],
});

new cloudfront.Distribution(this, 'Dist', {
  defaultBehavior: {
    origin: new origins.HttpOrigin('www.example.com'),
    trustedKeyGroups: [
      keyGroup,
    ],
  },
});

Properties

NameTypeDescription
encodedKeystringThe public key that you can use with signed URLs and signed cookies, or with field-level encryption.
comment?stringA comment to describe the public key.
publicKeyName?stringA name to identify the public key.

encodedKey

Type: string

The public key that you can use with signed URLs and signed cookies, or with field-level encryption.

The encodedKey parameter must include -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines.

See also: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html


comment?

Type: string (optional, default: no comment)

A comment to describe the public key.


publicKeyName?

Type: string (optional, default: generated from the id)

A name to identify the public key.