Skip to content

Commit 730477a

Browse files
committed
fix(apigw): add apigw netTypes config campatibility
1 parent cae3695 commit 730477a

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/modules/apigw/index.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Apigw {
4141
const {
4242
serviceId,
4343
protocols,
44-
netTypes = ['OUTER'],
44+
netTypes,
4545
serviceName = 'Serverless_Framework',
4646
serviceDesc = 'Created By Serverless Framework',
4747
} = serviceConf;
@@ -54,6 +54,7 @@ class Apigw {
5454
ServiceId: serviceId,
5555
});
5656
if (detail) {
57+
detail.InnerSubDomain = detail.InternalSubDomain;
5758
exist = true;
5859
if (
5960
!(
@@ -62,25 +63,31 @@ class Apigw {
6263
protocols === detail.protocol
6364
)
6465
) {
65-
await this.request({
66+
const apiInputs = {
6667
Action: 'ModifyService',
6768
serviceId,
6869
serviceDesc: serviceDesc || detail.serviceDesc,
6970
serviceName: serviceName || detail.serviceName,
7071
protocol: protocols,
71-
netTypes: netTypes,
72-
});
72+
};
73+
if (netTypes) {
74+
apiInputs.netTypes = netTypes;
75+
}
76+
await this.request(apiInputs);
7377
}
7478
}
7579
}
7680
if (!exist) {
77-
detail = await this.request({
81+
const apiInputs = {
7882
Action: 'CreateService',
7983
serviceName: serviceName || 'Serverless_Framework',
8084
serviceDesc: serviceDesc || 'Created By Serverless Framework',
8185
protocol: protocols,
82-
netTypes: netTypes,
83-
});
86+
};
87+
if (netTypes) {
88+
apiInputs.netTypes = netTypes;
89+
}
90+
detail = await this.request(apiInputs);
8491
serviceCreated = true;
8592
}
8693

0 commit comments

Comments
 (0)