Skip to content
v2.273.0

FunctionUrlOptions Struct ​

Options to add a url to a Lambda function.

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,
});

new cloudfront.Distribution(this, 'MyDistribution', {
  defaultBehavior: {
    origin: origins.FunctionUrlOrigin.withOriginAccessControl(fnUrl),
  },
});

Properties ​

authTypeFunctionUrlAuthTypeauth_typeFunctionUrlAuthTypeauthTypeFunctionUrlAuthTypeAuthTypeFunctionUrlAuthTypeAuthTypeFunctionUrlAuthType= FunctionUrlAuthType.AWS_IAM#
The type of authentication that your function URL uses.
The cross-origin resource sharing (CORS) settings for your function URL.
invokeModeInvokeModeinvoke_modeInvokeModeinvokeModeInvokeModeInvokeModeInvokeModeInvokeModeInvokeMode= InvokeMode.BUFFERED#
The type of invocation mode that your Lambda function uses.