# FunctionUrlOptions

Options to add a url to a Lambda function.

- Source: [`aws-lambda/lib/function-url.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-lambda/lib/function-url.ts#L168)
- Type last changed: v2.82.0 · 2 Jun 2023

## 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

- `authType`: [FunctionUrlAuthType](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionUrlAuthType.html) = FunctionUrlAuthType.AWS_IAM — The type of authentication that your function URL uses.

- `cors`: [FunctionUrlCorsOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionUrlCorsOptions.html) = No CORS configuration. — The cross-origin resource sharing (CORS) settings for your function URL.

- `invokeMode`: [InvokeMode](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.InvokeMode.html) = InvokeMode.BUFFERED — The type of invocation mode that your Lambda function uses.
