@geek-fun/serverlessinsight 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -10,6 +10,7 @@ const certUtils_1 = require("../../common/certUtils");
|
|
|
10
10
|
const logger_1 = require("../../common/logger");
|
|
11
11
|
const lang_1 = require("../../lang");
|
|
12
12
|
const domainUtils_1 = require("../../common/domainUtils");
|
|
13
|
+
const hashUtils_1 = require("../../common/hashUtils");
|
|
13
14
|
const getCdnConfig = (event) => {
|
|
14
15
|
const domainCdn = event.domain?.cdn;
|
|
15
16
|
if (domainCdn == null) {
|
|
@@ -589,14 +590,39 @@ const updateApigwResource = async (context, event, serviceName, roleArn, state)
|
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
if (event.domain) {
|
|
593
|
+
const desiredDomainDef = (0, apigwTypes_1.extractEventDomainDefinition)(event.domain);
|
|
594
|
+
const previousDomainDef = existingState?.definition?.domain;
|
|
595
|
+
// Skip domain binding when the domain configuration hasn't changed AND
|
|
596
|
+
// the domain was previously successfully bound (DNS records exist in state).
|
|
597
|
+
// This avoids unnecessary DNS verification (minutes-long) on every deploy.
|
|
598
|
+
// We check DNS sub-resources to avoid skipping after a previously failed binding.
|
|
599
|
+
const hasBoundDomains = (0, stateManager_1.getResource)(state, `${logicalId}.dns_verification`) !== undefined ||
|
|
600
|
+
(0, stateManager_1.getResource)(state, `${logicalId}.dns_txt_verification`) !== undefined;
|
|
601
|
+
if (previousDomainDef &&
|
|
602
|
+
desiredDomainDef &&
|
|
603
|
+
hasBoundDomains &&
|
|
604
|
+
(0, hashUtils_1.attributesEqual)(previousDomainDef, desiredDomainDef)) {
|
|
605
|
+
logger_1.logger.info('Domain configuration unchanged and previously bound, skipping DNS verification');
|
|
606
|
+
// Still include existing domain instances for state consistency
|
|
607
|
+
const existingDomainInstances = existingState?.instances?.filter((i) => i.type === 'ALIYUN_APIGW_GROUP' ||
|
|
608
|
+
i.type === 'ALIYUN_APIGW_API' ||
|
|
609
|
+
i.type === 'ALIYUN_APIGW_DEPLOYMENT') ?? [];
|
|
610
|
+
instances.push(...existingDomainInstances);
|
|
611
|
+
return (0, stateManager_1.setResource)(state, logicalId, {
|
|
612
|
+
mode: 'managed',
|
|
613
|
+
region: context.region,
|
|
614
|
+
definition: { ...(existingState?.definition ?? {}), domain: desiredDomainDef },
|
|
615
|
+
instances: [...instances, ...existingDomainInstances],
|
|
616
|
+
lastUpdated: new Date().toISOString(),
|
|
617
|
+
});
|
|
618
|
+
}
|
|
592
619
|
const primaryDomain = event.domain.domain_name;
|
|
593
620
|
const wwwBindApex = event.domain.www_bind_apex === true;
|
|
594
621
|
const wwwDomain = wwwBindApex ? (0, domainUtils_1.deriveWwwDomain)(primaryDomain) : null;
|
|
595
622
|
const isCdnEnabled = getIsCdnEnabled(event);
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const previousCdnEnabled = existingDomain?.cdnEnabled === true;
|
|
623
|
+
const previousWwwBindApex = previousDomainDef?.wwwBindApex === true;
|
|
624
|
+
const previousDomainName = previousDomainDef?.domainName;
|
|
625
|
+
const previousCdnEnabled = previousDomainDef?.cdnEnabled === true;
|
|
600
626
|
const previousTrackedDomains = getApigwTrackedDomains(previousDomainName, previousWwwBindApex);
|
|
601
627
|
const originDomain = groupInfo.subDomain;
|
|
602
628
|
if (isCdnEnabled && !originDomain) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|