小编iqu*_*ard的帖子

在Terraform中,如何在请求路径中使用变量指定API网关端点?

在AWS API Gateway中,我将端点定义为/users/{userId}/someAction,并且我尝试使用terraform重新创建此端点

我会开始像某样链接的gateway_resource链......

resource "aws_api_gateway_resource" "Users" {
  rest_api_id = "${var.rest_api_id}" 
  parent_id = "${var.parent_id}" 
  path_part = "users"
}

//{userId} here?

resource "aws_api_gateway_resource" "SomeAction" {
  rest_api_id = "${var.rest_api_id}" 
  parent_id = "${aws_api_gateway_resource.UserIdReference.id}"
  path_part = "someAction"
}
Run Code Online (Sandbox Code Playgroud)

然后我在其中定义了aws_api_gateway_method其他所有内容.

如何在terraform中定义此端点?terraform文档和示例不包括此用例.

amazon-web-services terraform aws-api-gateway

25
推荐指数
1
解决办法
8117
查看次数