用于运动的 aws_api_gateway_integration URI [英] aws_api_gateway_integration URI for kinesis

本文介绍了用于运动的 aws_api_gateway_integration URI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 网关.我正在尝试上面的代码,但出现此错误:

I want to create an API Gateway that sends data to a kinesis stream. I am trying the code above but I get this error:

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 的格式应该是这样的:

I read in another SO answer that the format of the uri is supposed to be like this:

arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}

如何更改它以将其与 kinesis 一起使用?action 或 service_api 是什么?

How can I change it to use it with kinesis? What is the action or service_api?

区域 = eu-central-1"

region = "eu-central-1"

推荐答案

从 Terraform 文档中,URI 应该是格式

From Terraform documentation, the URI should be of the form

arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}

因此,在您的情况下,URI 将是:

So in your case, the URI would be:

arn:aws:apigateway:eu-central-1:kinesis:action/PutRecord

参考:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_integration

这篇关于用于运动的 aws_api_gateway_integration URI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆