首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Terraform不会将step函数部署到API网关

Terraform不会将step函数部署到API网关
EN

Stack Overflow用户
提问于 2021-11-12 16:17:04
回答 1查看 560关注 0票数 2

我试图在post方法执行中使用step函数集成来部署API。

我所收到的错误是;

错误:创建API集成错误: BadRequestException: AWS用于集成必须包含路径或动作

集成如下;

代码语言:javascript
复制
resource "aws_api_gateway_integration" "approve_get_integration_POST" {
  rest_api_id                 = aws_api_gateway_rest_api.ccc_api.id
  resource_id                 = aws_api_gateway_resource.QuestionnaireResponseID.id
  http_method                 = aws_api_gateway_method.approve_get_integration_POST.http_method
  integration_http_method     = "POST"
  type                        = "AWS"
  passthrough_behavior        = "NEVER"
  uri                         = "arn:aws:states:us-west-2:1431651122:StartExecution/ccc-step-function-POST"

  request_templates = {
    "application/json" = <<EOF
{
  "Comment": "Test express state machine",
  "StartAt": "Validate",
  "States": {
    "Validate": {
      "Type": "Task",
      "Resource": "arn:aws:states:::lambda:invoke",
      "OutputPath": "$.Payload",
      "Parameters": {
        "Payload.$": "$",
        "FunctionName": "arn:aws:lambda:us-west-2:65163961147:function:sb-ccc-validate-submission:$LATEST"
      },
      "Retry": [
        {
          "ErrorEquals": [
            "Lambda.ServiceException",
            "Lambda.AWSLambdaException",
            "Lambda.SdkClientException"
          ],
          "IntervalSeconds": 2,
          "MaxAttempts": 6,
          "BackoffRate": 2
        }
      ],
      "Next": "CheckForValidateError"
    },
    "CheckForValidateError": {
      "Type": "Choice",
      "Choices": [
        {
          "Not": {
            "Variable": "$.statusCode",
            "NumericEquals": 200
          },
          "Next": "ValidateFailError"
        }
      ],
      "Default": "Create"
    },
    "ValidateFailError": {
      "Type": "Succeed"
    },
EOF
  }
}```

from what I have read that URI is correct and should be deploying ok.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-11-16 09:51:23

对于AWS集成,URI应该是形式的

代码语言:javascript
复制
arn:aws:apigateway:{region}:{subdomain.service|service}:{path|action}/{service_api}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69945951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档