awscc_lambda_url (Resource)

Resource Type definition for AWS::Lambda::Url

See the AWS Lambda documentation for more information.

Example Usage

Configure Lambda url with no auth.

resource "awscc_lambda_url" "example_no_auth" {
  target_function_arn = var.function_arn
  auth_type           = "NONE"
}

variable "function_arn" {
  type        = string
  description = "ARN of the lambda function"
}

Configure Lambda url set with AWS_IAM for auth.

resource "awscc_lambda_url" "example_auth_iam" {
  target_function_arn = var.function_arn
  auth_type           = "AWS_IAM"

  cors = {
    allow_credentials = true
    allow_origins     = ["*"]
    allow_methods     = ["*"]
    allow_headers     = ["date", "keep-alive"]
    expose_headers    = ["keep-alive", "date"]
    max_age           = 86400
  }
}

variable "function_arn" {
  type        = string
  description = "ARN of the lambda function"
}

Schema

Required

Optional

Read-Only

Nested Schema for cors

Optional:

Import

Import is supported using the following syntax:

$ terraform import awscc_lambda_url.example <resource ID>