resource "aws_api_gateway_integration" "kinesis_integration" {
rest_api_id = aws_api_gateway_rest_api.shippeo_api_kinesis.id
resource_id = aws_api_gateway_resource.shippeo_api_resource_kinesis.id
http_method = aws_api_gateway_method.post_json_files_kinesis.http_method
type = "AWS_PROXY"
uri = aws_kinesis_stream.shippeo-kinesis-stream.arn
integration_http_method = "POST"
depends_on = [
aws_api_gateway_resource.shippeo_api_resource_kinesis
]
}
我想创建一个API网关,将数据发送到驱动蛋白流。我正在尝试上面的代码,但我得到了这个错误:
Error creating API Gateway Integration: BadRequestException: AWS ARN for integration must contain path or action
│
│ with module.shippeo-api.aws_api_gateway_integration.kinesis_integration,
│ on ../../modules/shippeo/kinesis-api.tf line 62, in resource "aws_api_gateway_integration" "kinesis_integration":
│ 62: resource "aws_api_gateway_integration" "kinesis_integration" {
我在另一个SO答案中读到,uri的格式应该是这样的:
arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
如何将其更改为与驱动器一起使用?什么是action或service_api?
区域=";eu-central-1";
从Terraform文档中,URI的形式应该是
arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
因此,在您的情况下,URI将是:
arn:aws:apigateway:eu-central-1:kinesis:action/PutRecord
参考:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_integration