

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::Lambda::Url
<a name="aws-resource-lambda-url"></a>

The `AWS::Lambda::Url` resource creates a function URL with the specified configuration parameters. A [function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) is a dedicated HTTP(S) endpoint that you can use to invoke your function.

## Syntax
<a name="aws-resource-lambda-url-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-lambda-url-syntax.json"></a>

```
{
  "Type" : "AWS::Lambda::Url",
  "Properties" : {
      "[AuthType](#cfn-lambda-url-authtype)" : String,
      "[Cors](#cfn-lambda-url-cors)" : Cors,
      "[InvokeMode](#cfn-lambda-url-invokemode)" : String,
      "[Qualifier](#cfn-lambda-url-qualifier)" : String,
      "[TargetFunctionArn](#cfn-lambda-url-targetfunctionarn)" : String
    }
}
```

### YAML
<a name="aws-resource-lambda-url-syntax.yaml"></a>

```
Type: AWS::Lambda::Url
Properties:
  [AuthType](#cfn-lambda-url-authtype): String
  [Cors](#cfn-lambda-url-cors): 
    Cors
  [InvokeMode](#cfn-lambda-url-invokemode): String
  [Qualifier](#cfn-lambda-url-qualifier): String
  [TargetFunctionArn](#cfn-lambda-url-targetfunctionarn): String
```

## Properties
<a name="aws-resource-lambda-url-properties"></a>

`AuthType`  <a name="cfn-lambda-url-authtype"></a>
The type of authentication that your function URL uses. Set to `AWS_IAM` if you want to restrict access to authenticated users only. Set to `NONE` if you want to bypass IAM authentication to create a public endpoint. For more information, see [Security and auth model for Lambda function URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html).  
*Required*: Yes  
*Type*: String  
*Allowed values*: `AWS_IAM | NONE`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Cors`  <a name="cfn-lambda-url-cors"></a>
The [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL.  
*Required*: No  
*Type*: [Cors](aws-properties-lambda-url-cors.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InvokeMode`  <a name="cfn-lambda-url-invokemode"></a>
Use one of the following options:  
+ `BUFFERED` – This is the default option. Lambda invokes your function using the `Invoke` API operation. Invocation results are available when the payload is complete. The maximum payload size is 6 MB.
+ `RESPONSE_STREAM` – Your function streams payload results as they become available. Lambda invokes your function using the `InvokeWithResponseStream` API operation. The maximum response payload size is 200 MB.
*Required*: No  
*Type*: String  
*Allowed values*: `BUFFERED | RESPONSE_STREAM`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Qualifier`  <a name="cfn-lambda-url-qualifier"></a>
The alias name.  
*Required*: No  
*Type*: String  
*Pattern*: `((?!^[0-9]+$)([a-zA-Z0-9-_]+))`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`TargetFunctionArn`  <a name="cfn-lambda-url-targetfunctionarn"></a>
The name of the Lambda function.  

**Name formats**
+ **Function name** - `my-function`.
+ **Function ARN** - `arn:aws:lambda:us-east-2:123456789012:function:my-function`.
+ **Partial ARN** - `123456789012:function:my-function`.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.  
*Required*: Yes  
*Type*: String  
*Pattern*: `^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\d{1}:)?(\d{12}:)?(function:)?([a-zA-Z0-9-_]+)(:((?!\d+)[0-9a-zA-Z-_]+))?$`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-lambda-url-return-values"></a>

### Ref
<a name="aws-resource-lambda-url-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the resource name.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-lambda-url-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-lambda-url-return-values-fn--getatt-fn--getatt"></a>

`FunctionArn`  <a name="FunctionArn-fn::getatt"></a>
The Amazon Resource Name (ARN) of the function.

`FunctionUrl`  <a name="FunctionUrl-fn::getatt"></a>
The HTTP URL endpoint for your function.

# AWS::Lambda::Url Cors
<a name="aws-properties-lambda-url-cors"></a>

The [Cross-Origin Resource Sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings for your function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.

## Syntax
<a name="aws-properties-lambda-url-cors-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-lambda-url-cors-syntax.json"></a>

```
{
  "[AllowCredentials](#cfn-lambda-url-cors-allowcredentials)" : Boolean,
  "[AllowHeaders](#cfn-lambda-url-cors-allowheaders)" : [ String, ... ],
  "[AllowMethods](#cfn-lambda-url-cors-allowmethods)" : [ String, ... ],
  "[AllowOrigins](#cfn-lambda-url-cors-alloworigins)" : [ String, ... ],
  "[ExposeHeaders](#cfn-lambda-url-cors-exposeheaders)" : [ String, ... ],
  "[MaxAge](#cfn-lambda-url-cors-maxage)" : Integer
}
```

### YAML
<a name="aws-properties-lambda-url-cors-syntax.yaml"></a>

```
  [AllowCredentials](#cfn-lambda-url-cors-allowcredentials): Boolean
  [AllowHeaders](#cfn-lambda-url-cors-allowheaders): 
    - String
  [AllowMethods](#cfn-lambda-url-cors-allowmethods): 
    - String
  [AllowOrigins](#cfn-lambda-url-cors-alloworigins): 
    - String
  [ExposeHeaders](#cfn-lambda-url-cors-exposeheaders): 
    - String
  [MaxAge](#cfn-lambda-url-cors-maxage): Integer
```

## Properties
<a name="aws-properties-lambda-url-cors-properties"></a>

`AllowCredentials`  <a name="cfn-lambda-url-cors-allowcredentials"></a>
Whether you want to allow cookies or other credentials in requests to your function URL. The default is `false`.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AllowHeaders`  <a name="cfn-lambda-url-cors-allowheaders"></a>
The HTTP headers that origins can include in requests to your function URL. For example: `Date`, `Keep-Alive`, `X-Custom-Header`.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1 | 1`  
*Maximum*: `1024 | 100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AllowMethods`  <a name="cfn-lambda-url-cors-allowmethods"></a>
The HTTP methods that are allowed when calling your function URL. For example: `GET`, `POST`, `DELETE`, or the wildcard character (`*`).  
*Required*: No  
*Type*: Array of String  
*Allowed values*: `GET | PUT | HEAD | POST | PATCH | DELETE | *`  
*Minimum*: `1`  
*Maximum*: `6`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AllowOrigins`  <a name="cfn-lambda-url-cors-alloworigins"></a>
The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example: `https://www.example.com`, `http://localhost:60905`.  
Alternatively, you can grant access to all origins with the wildcard character (`*`).   
*Required*: No  
*Type*: Array of String  
*Minimum*: `1 | 1`  
*Maximum*: `253 | 100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ExposeHeaders`  <a name="cfn-lambda-url-cors-exposeheaders"></a>
The HTTP headers in your function response that you want to expose to origins that call your function URL. For example: `Date`, `Keep-Alive`, `X-Custom-Header`.  
*Required*: No  
*Type*: Array of String  
*Minimum*: `1 | 1`  
*Maximum*: `1024 | 100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxAge`  <a name="cfn-lambda-url-cors-maxage"></a>
The maximum amount of time, in seconds, that browsers can cache results of a preflight request. By default, this is set to `0`, which means the browser will not cache results.  
*Required*: No  
*Type*: Integer  
*Minimum*: `0`  
*Maximum*: `86400`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)