FunctionUrlOriginAccessControlProps Struct
Properties for creating a Lambda Function URL Origin Access Control resource.
Example
ts
import * as lambda from 'aws-cdk-lib/aws-lambda';
declare const fn: lambda.Function;
const fnUrl = fn.addFunctionUrl({
authType: lambda.FunctionUrlAuthType.AWS_IAM,
});
// Define a custom OAC
const oac = new cloudfront.FunctionUrlOriginAccessControl(this, 'MyOAC', {
originAccessControlName: 'CustomLambdaOAC',
signing: cloudfront.Signing.SIGV4_ALWAYS,
});
// Set up Lambda Function URL with OAC in CloudFront Distribution
new cloudfront.Distribution(this, 'MyDistribution', {
defaultBehavior: {
origin: origins.FunctionUrlOrigin.withOriginAccessControl(fnUrl, {
originAccessControl: oac,
}),
},
});
Properties
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= no description#A description of the origin access control.
originAccessControlNamestringorigin_access_control_namestroriginAccessControlNameStringOriginAccessControlNamestringOriginAccessControlName*string= a generated name#A name to identify the origin access control, with a maximum length of 64 characters.