作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
代码:
x-amazon-apigateway-integration:
uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:428377611111:function:${stageVariables.target_lambdaName}/invocations"
如果使用如下所示的伪参数,我将面临问题。
更新的代码:
x-amazon-apigateway-integration:
uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:${AWS::AccountId}:function:${stageVariables.target_lambdaName}/invocations"
Errors found during import: Unable to put integration on 'GET' for resource at path '/getMessage': Invalid HTTP endpoint specified for URI (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: 3da76bd8-d714-11e8-8ec4-4b324c6636a4)
提前致谢。
纳雷什
最佳答案
首先,您应该从问题中删除您的 AWS 账户 ID。
如果您使用 SAM 模板 YAML 文件并在管道阶段通过 ParameterOverrides 将变量传递到模板,那么您应该在 SAM 模板 YAML 文件的文件顶部声明参数,并且您的代码应为示例 POST。
paths:
/PATH_NAME:
get:
responses: {}
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${FUNCTION_NAME_HERE.Arn}/invocations
httpMethod: POST
type: aws_proxy
假设这段代码附加到:
Type: AWS::Serverless::Api
没有任何其他信息,我只是假设您想要做什么。
顺便说一句,您可以在 CloudFormation 中访问您的帐户 ID,如下所示:
${AWS::AccountId}
关于amazon-web-services - 如何在 REST API 的 uri 中传递 AWS AccountId(Cloudformation),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52958702/
我是一名优秀的程序员,十分优秀!