Skip to content

Commit 32aaa54

Browse files
committed
bug fix
1 parent 9b6cfee commit 32aaa54

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

lib/index.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ class ServerlessApigatewayServiceProxy {
6565
// SQS getProxy
6666
await this.compileSqsServiceProxy()
6767

68-
if (await this.existsDeployment()) {
69-
await this.compileDeployment()
70-
}
68+
await this.mergeDeployment()
7169
}
7270
},
7371
'after:deploy:deploy': async () => {
@@ -79,20 +77,24 @@ class ServerlessApigatewayServiceProxy {
7977
}
8078
}
8179

82-
async existsDeployment() {
83-
let exists = true
80+
async mergeDeployment() {
81+
let exists = false
8482
Object.keys(this.serverless.service.provider.compiledCloudFormationTemplate.Resources).forEach(
8583
async (resource) => {
8684
if (
8785
this.serverless.service.provider.compiledCloudFormationTemplate.Resources[resource][
8886
'Type'
8987
] == 'AWS::ApiGateway::Deployment'
9088
) {
91-
exists = false
89+
exists = true
90+
this.serverless.service.provider.compiledCloudFormationTemplate.Resources[resource]['DependsOn'] = this.serverless.service.provider.compiledCloudFormationTemplate.Resources[resource]['DependsOn'].concat(this.apiGatewayMethodLogicalIds)
9291
}
9392
}
9493
)
95-
return exists
94+
95+
if (!exists) {
96+
await this.compileDeployment()
97+
}
9698
}
9799

98100
async display() {

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-apigateway-service-proxy",
3-
"version": "0.1.0",
3+
"version": "0.3.0",
44
"description": "The Serverless Framewrok plugin for supporting AWS service proxy integration of API Gateway",
55
"main": "lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)