Function Url
Provides a Lambda function URL resource. A function URL is a dedicated HTTP(S) endpoint for a Lambda function. See the AWS Lambda documentation for more information.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lambda.FunctionUrl;
import com.pulumi.aws.lambda.FunctionUrlArgs;
import com.pulumi.aws.lambda.inputs.FunctionUrlCorsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testLatest = new FunctionUrl("testLatest", FunctionUrlArgs.builder()
.functionName(aws_lambda_function.test().function_name())
.authorizationType("NONE")
.build());
var testLive = new FunctionUrl("testLive", FunctionUrlArgs.builder()
.functionName(aws_lambda_function.test().function_name())
.qualifier("my_alias")
.authorizationType("AWS_IAM")
.cors(FunctionUrlCorsArgs.builder()
.allowCredentials(true)
.allowOrigins("*")
.allowMethods("*")
.allowHeaders(
"date",
"keep-alive")
.exposeHeaders(
"keep-alive",
"date")
.maxAge(86400)
.build())
.build());
}
}
Import
Lambda function URLs can be imported using the function_name
or function_name/qualifier
, e.g.,
$ pulumi import aws:lambda/functionUrl:FunctionUrl test_lambda_url my_test_lambda_function
Properties
The type of authentication that the function URL uses. Set to "AWS_IAM"
to restrict access to authenticated IAM users only. Set to "NONE"
to bypass IAM authentication and create a public endpoint. See the AWS documentation for more details.
The cross-origin resource sharing (CORS) settings for the function URL. Documented below.
The Amazon Resource Name (ARN) of the function.
The name (or ARN) of the Lambda function.
The HTTP URL endpoint for the function in the format https://<url_id>.lambda-url.<region>.on.aws
.
Determines how the Lambda function responds to an invocation. Valid values are BUFFERED
(default) and RESPONSE_STREAM
. See more in Configuring a Lambda function to stream responses.