【发布时间】:2018-12-25 09:07:36
【问题描述】:
我正在尝试部署一个 API Gateway REST API,该 API 使用 terraform 的自定义授权方。
自定义授权方使用现有的 lambda 函数。
resource "aws_api_gateway_authorizer" "accountprofileauth" {
name = "auth"
rest_api_id = "${aws_api_gateway_rest_api.accountprofileapi.id}"
authorizer_uri = "arn:aws:lambda:us-east-2:XXXX:function:dev-authorizer"
identity_source = "method.request.header.Authorization"
type = "REQUEST"
}
当我应用 terraform 时,出现以下错误
* aws_api_gateway_authorizer.accountprofileauth: Error creating API Gateway Authorizer: BadRequestException: Invalid Authorizer URI: arn:aws:lambda:us-east-2:XXXX:function:dev-authorizer. Authorizer URI should be a valid API Gateway ARN that represents a Lambda function invocation.
status code: 400, request id: XXXX
lambda 函数存在并且工作正常。当我使用无服务器部署时,相同的 arn 工作正常。
你知道有效arn的格式/提供一个例子吗?
谢谢。
【问题讨论】:
标签: lambda aws-lambda aws-api-gateway terraform