我是AWS SAM部署的新手。我有一个使用SAM自动化部署的用例。有一个Rest和另一个HTTP端点调用。我搜索了更多的文档,但没有找到任何解决方案。你能建议我怎么处理这个案子吗?
提前谢谢。Karthikeyan B
发布于 2020-06-22 04:10:10
示例模板,您可以尝试创建集成-
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS SAM template with a HTTP integration
Resources:
ApiGatewayApi:
Type: AWS::Serverless::Api
Properties:
StageName: prod
DefinitionBody: {
"swagger": "2.0",
"info": {
"version": "1.0"
},
"paths": {
"test": {
"get": {
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "200 response"
}
},
"x-amazon-apigateway-integration": {
"responses": {
"default": {
"statusCode": "200"
}
},
"credentials": "arn:aws:iam::account-id:role/role-name",
"uri": "https://www.example.com",
"passthroughBehavior": "when_no_match",
"httpMethod": "GET",
"type": "http_proxy"
}
}
}
}
}使用CLI部署模板-
$ sam部署--堆栈名称httpProxy -t httpProxy.yaml --功能CAPABILITY_IAM
https://stackoverflow.com/questions/62442922
复制相似问题