UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

197 lines (196 loc) 6.93 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Lambda function URL. Creates a dedicated HTTP(S) endpoint for a Lambda function to enable direct invocation via HTTP requests. * * ## Example Usage * * ### Basic Function URL with No Authentication * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.FunctionUrl("example", { * functionName: exampleAwsLambdaFunction.functionName, * authorizationType: "NONE", * }); * ``` * * ### Function URL with IAM Authentication and CORS Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.lambda.FunctionUrl("example", { * functionName: exampleAwsLambdaFunction.functionName, * qualifier: "my_alias", * authorizationType: "AWS_IAM", * invokeMode: "RESPONSE_STREAM", * cors: { * allowCredentials: true, * allowOrigins: ["https://example.com"], * allowMethods: [ * "GET", * "POST", * ], * allowHeaders: [ * "date", * "keep-alive", * ], * exposeHeaders: [ * "keep-alive", * "date", * ], * maxAge: 86400, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Lambda function URLs using the `function_name` or `function_name/qualifier`. For example: * * ```sh * $ pulumi import aws:lambda/functionUrl:FunctionUrl example example * ``` */ export declare class FunctionUrl extends pulumi.CustomResource { /** * Get an existing FunctionUrl resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: FunctionUrlState, opts?: pulumi.CustomResourceOptions): FunctionUrl; /** * Returns true if the given object is an instance of FunctionUrl. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is FunctionUrl; /** * Type of authentication that the function URL uses. Valid values are `AWS_IAM` and `NONE`. */ readonly authorizationType: pulumi.Output<string>; /** * Cross-origin resource sharing (CORS) settings for the function URL. See below. */ readonly cors: pulumi.Output<outputs.lambda.FunctionUrlCors | undefined>; /** * ARN of the Lambda function. */ readonly functionArn: pulumi.Output<string>; /** * Name or ARN of the Lambda function. * * The following arguments are optional: */ readonly functionName: pulumi.Output<string>; /** * HTTP URL endpoint for the function in the format `https://<url_id>.lambda-url.<region>.on.aws/`. */ readonly functionUrl: pulumi.Output<string>; /** * How the Lambda function responds to an invocation. Valid values are `BUFFERED` (default) and `RESPONSE_STREAM`. */ readonly invokeMode: pulumi.Output<string | undefined>; /** * Alias name or `$LATEST`. */ readonly qualifier: pulumi.Output<string | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Generated ID for the endpoint. */ readonly urlId: pulumi.Output<string>; /** * Create a FunctionUrl resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: FunctionUrlArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering FunctionUrl resources. */ export interface FunctionUrlState { /** * Type of authentication that the function URL uses. Valid values are `AWS_IAM` and `NONE`. */ authorizationType?: pulumi.Input<string>; /** * Cross-origin resource sharing (CORS) settings for the function URL. See below. */ cors?: pulumi.Input<inputs.lambda.FunctionUrlCors>; /** * ARN of the Lambda function. */ functionArn?: pulumi.Input<string>; /** * Name or ARN of the Lambda function. * * The following arguments are optional: */ functionName?: pulumi.Input<string>; /** * HTTP URL endpoint for the function in the format `https://<url_id>.lambda-url.<region>.on.aws/`. */ functionUrl?: pulumi.Input<string>; /** * How the Lambda function responds to an invocation. Valid values are `BUFFERED` (default) and `RESPONSE_STREAM`. */ invokeMode?: pulumi.Input<string>; /** * Alias name or `$LATEST`. */ qualifier?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * Generated ID for the endpoint. */ urlId?: pulumi.Input<string>; } /** * The set of arguments for constructing a FunctionUrl resource. */ export interface FunctionUrlArgs { /** * Type of authentication that the function URL uses. Valid values are `AWS_IAM` and `NONE`. */ authorizationType: pulumi.Input<string>; /** * Cross-origin resource sharing (CORS) settings for the function URL. See below. */ cors?: pulumi.Input<inputs.lambda.FunctionUrlCors>; /** * Name or ARN of the Lambda function. * * The following arguments are optional: */ functionName: pulumi.Input<string>; /** * How the Lambda function responds to an invocation. Valid values are `BUFFERED` (default) and `RESPONSE_STREAM`. */ invokeMode?: pulumi.Input<string>; /** * Alias name or `$LATEST`. */ qualifier?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }