FunctionUrl does not exist

FunctionUrl does not exist

·

1 min read

I recently came across the "FunctionUrl does not exist" error while getting started with Lambda Function URL's and CloudFormation.

Requested attribute FunctionUrl does not exist in schema for AWS::Lambda::Function

The Lambda function was configured correctly to setup the function URL.

MyLambdaFunction:
  Type: AWS::Serverless::Function
  Properties:
    FunctionUrlConfig:
      AuthType: NONE

The CloudFormation output appeared to be configured correctly based on the CloudFormation documentation.

MyLambdaFunctionEndpoint:
  Description: My Lambda Function Endpoint
  Value:
    Fn::GetAtt: MyLambdaFunction.FunctionUrl

After staring at the CloudFormation template and documentation for way too long I finally realised that the documentation was adding the Url suffix to the original resource name. Changing the resource the GetAtt was referencing from MyLambdaFunction to MyLambdaFunctionUrl worked and everything deployed correctly.

MyLambdaFunctionEndpoint:
  Description: My Lambda Function Endpoint
  Value:
    Fn::GetAtt: MyLambdaFunctionUrl.FunctionUrl