Class FunctionUrl

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.lambda.FunctionUrl
All Implemented Interfaces:
IResource, IFunctionUrl, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.106.0 (build e852934)", date="2025-02-12T12:32:05.145Z") @Stability(Stable) public class FunctionUrl extends Resource implements IFunctionUrl
Defines a Lambda function url.

Example:

 import software.amazon.awscdk.services.lambda.*;
 Function fn;
 FunctionUrl fnUrl = fn.addFunctionUrl(FunctionUrlOptions.builder()
         .authType(FunctionUrlAuthType.AWS_IAM)
         .build());
 Distribution.Builder.create(this, "MyDistribution")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(FunctionUrlOrigin.withOriginAccessControl(fnUrl))
                 .build())
         .build();
 
  • Constructor Details

    • FunctionUrl

      protected FunctionUrl(software.amazon.jsii.JsiiObjectRef objRef)
    • FunctionUrl

      protected FunctionUrl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • FunctionUrl

      @Stability(Stable) public FunctionUrl(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FunctionUrlProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • grantInvokeUrl

      @Stability(Stable) @NotNull public Grant grantInvokeUrl(@NotNull IGrantable grantee)
      Grant the given identity permissions to invoke this Lambda Function URL.

      Specified by:
      grantInvokeUrl in interface IFunctionUrl
      Parameters:
      grantee - This parameter is required.
    • getAuthType

      @Stability(Stable) @NotNull public FunctionUrlAuthType getAuthType()
      The authentication type used for this Function URL.
      Specified by:
      getAuthType in interface IFunctionUrl
    • getFunctionArn

      @Stability(Stable) @NotNull public String getFunctionArn()
      The ARN of the function this URL refers to.
      Specified by:
      getFunctionArn in interface IFunctionUrl
    • getUrl

      @Stability(Stable) @NotNull public String getUrl()
      The url of the Lambda function.
      Specified by:
      getUrl in interface IFunctionUrl