All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.676Z") @Stability(Stable) public class CfnUrl extends CfnResource implements IInspectable
A CloudFormation AWS::Lambda::Url.

The AWS::Lambda::Url resource creates a function URL with the specified configuration parameters. A function URL is a dedicated HTTP(S) endpoint that you can use to invoke your function.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.lambda.*;
 CfnUrl cfnUrl = CfnUrl.Builder.create(this, "MyCfnUrl")
         .authType("authType")
         .targetFunctionArn("targetFunctionArn")
         // the properties below are optional
         .cors(CorsProperty.builder()
                 .allowCredentials(false)
                 .allowHeaders(List.of("allowHeaders"))
                 .allowMethods(List.of("allowMethods"))
                 .allowOrigins(List.of("allowOrigins"))
                 .exposeHeaders(List.of("exposeHeaders"))
                 .maxAge(123)
                 .build())
         .invokeMode("invokeMode")
         .qualifier("qualifier")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnUrl

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

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

      @Stability(Stable) public CfnUrl(@NotNull Construct scope, @NotNull String id, @NotNull CfnUrlProps props)
      Create a new AWS::Lambda::Url.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrFunctionArn

      @Stability(Stable) @NotNull public String getAttrFunctionArn()
      The Amazon Resource Name (ARN) of the function.
    • getAttrFunctionUrl

      @Stability(Stable) @NotNull public String getAttrFunctionUrl()
      The HTTP URL endpoint for your function.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAuthType

      @Stability(Stable) @NotNull public String getAuthType()
      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 .

    • setAuthType

      @Stability(Stable) public void setAuthType(@NotNull String value)
      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 .

    • getTargetFunctionArn

      @Stability(Stable) @NotNull public String getTargetFunctionArn()
      The name of the Lambda function.

      Name formats - Function name - my-function .

      • Function ARN - arn:aws:lambda:us-west-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.

    • setTargetFunctionArn

      @Stability(Stable) public void setTargetFunctionArn(@NotNull String value)
      The name of the Lambda function.

      Name formats - Function name - my-function .

      • Function ARN - arn:aws:lambda:us-west-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.

    • getCors

      @Stability(Stable) @Nullable public Object getCors()
      The Cross-Origin Resource Sharing (CORS) settings for your function URL.
    • setCors

      @Stability(Stable) public void setCors(@Nullable IResolvable value)
      The Cross-Origin Resource Sharing (CORS) settings for your function URL.
    • setCors

      @Stability(Stable) public void setCors(@Nullable CfnUrl.CorsProperty value)
      The Cross-Origin Resource Sharing (CORS) settings for your function URL.
    • getInvokeMode

      @Stability(Stable) @Nullable public String getInvokeMode()
      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 20 MB, however, you can request a quota increase .
    • setInvokeMode

      @Stability(Stable) public void setInvokeMode(@Nullable String value)
      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 20 MB, however, you can request a quota increase .
    • getQualifier

      @Stability(Stable) @Nullable public String getQualifier()
      The alias name.
    • setQualifier

      @Stability(Stable) public void setQualifier(@Nullable String value)
      The alias name.