aws-cdk-lib.aws_lambda.FunctionUrlProps

interface FunctionUrlProps

LanguageType name
.NETAmazon.CDK.AWS.Lambda.FunctionUrlProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#FunctionUrlProps
Javasoftware.amazon.awscdk.services.lambda.FunctionUrlProps
Pythonaws_cdk.aws_lambda.FunctionUrlProps
TypeScript (source)aws-cdk-lib » aws_lambda » FunctionUrlProps

Properties for a FunctionUrl.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const function_: lambda.Function;
const functionUrlProps: lambda.FunctionUrlProps = {
  function: function_,

  // the properties below are optional
  authType: lambda.FunctionUrlAuthType.AWS_IAM,
  cors: {
    allowCredentials: false,
    allowedHeaders: ['allowedHeaders'],
    allowedMethods: [lambda.HttpMethod.GET],
    allowedOrigins: ['allowedOrigins'],
    exposedHeaders: ['exposedHeaders'],
    maxAge: cdk.Duration.minutes(30),
  },
  invokeMode: lambda.InvokeMode.BUFFERED,
};

Properties

NameTypeDescription
functionIFunctionThe function to which this url refers.
authType?FunctionUrlAuthTypeThe type of authentication that your function URL uses.
cors?FunctionUrlCorsOptionsThe cross-origin resource sharing (CORS) settings for your function URL.
invokeMode?InvokeModeThe type of invocation mode that your Lambda function uses.

function

Type: IFunction

The function to which this url refers.

It can also be an Alias but not a Version.


authType?

Type: FunctionUrlAuthType (optional, default: FunctionUrlAuthType.AWS_IAM)

The type of authentication that your function URL uses.


cors?

Type: FunctionUrlCorsOptions (optional, default: No CORS configuration.)

The cross-origin resource sharing (CORS) settings for your function URL.


invokeMode?

Type: InvokeMode (optional, default: InvokeMode.BUFFERED)

The type of invocation mode that your Lambda function uses.