quidproquo-deploy-awscdk 0.0.53 → 0.0.55
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/lib/constructs/QpqWebserverDomainConstruct.js +3 -3
- package/lib/constructs/QpqWebserverSubdomainRedirectConstruct.js +1 -1
- package/lib/constructs/core/QPQServiceStack.js +1 -1
- package/lib/qpqDeployAwsCdkUtils.js +3 -3
- package/lib/utils.js +7 -5
- package/package.json +1 -1
- package/src/constructs/QpqWebserverDomainConstruct.ts +3 -3
- package/src/constructs/QpqWebserverSubdomainRedirectConstruct.ts +1 -1
- package/src/constructs/core/QPQServiceStack.ts +1 -1
- package/src/qpqDeployAwsCdkUtils.ts +3 -3
- package/src/utils.ts +8 -5
|
@@ -30,7 +30,7 @@ const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
|
30
30
|
const qpqDeployAwsCdkUtils = __importStar(require("../qpqDeployAwsCdkUtils"));
|
|
31
31
|
const QpqConstruct_1 = require("./core/QpqConstruct");
|
|
32
32
|
const getEnvironmentDomainName = (qpqConfig, domain) => {
|
|
33
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
33
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
34
34
|
if (environment === 'production') {
|
|
35
35
|
return domain;
|
|
36
36
|
}
|
|
@@ -42,7 +42,7 @@ class QpqWebserverDomainConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
42
42
|
super(scope, id, props);
|
|
43
43
|
// example.com
|
|
44
44
|
// dev.example.com
|
|
45
|
-
const feature = quidproquo_core_1.qpqCoreUtils.
|
|
45
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);
|
|
46
46
|
const environmentDomain = (0, exports.getEnvironmentDomainName)(props.qpqConfig, props.setting.dnsBase);
|
|
47
47
|
const featureDomainName = quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
48
48
|
// The hosted zone already setup
|
|
@@ -52,7 +52,7 @@ class QpqWebserverDomainConstruct extends QpqConstruct_1.QpqConstruct {
|
|
|
52
52
|
let apexHostedZone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'hosted-zone', {
|
|
53
53
|
domainName: feature ? featureDomainName : environmentDomain,
|
|
54
54
|
});
|
|
55
|
-
// const feature = qpqCoreUtils.
|
|
55
|
+
// const feature = qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);
|
|
56
56
|
// if (feature) {
|
|
57
57
|
// const featureDomainName = qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
58
58
|
// console.log('featureDomainName', featureDomainName);
|
|
@@ -37,7 +37,7 @@ class QpqWebserverSubdomainRedirectConstruct extends QpqConstruct_1.QpqConstruct
|
|
|
37
37
|
constructor(scope, id, props) {
|
|
38
38
|
super(scope, id, props);
|
|
39
39
|
const buildPath = quidproquo_core_1.qpqCoreUtils.getBuildPath(props.qpqConfig);
|
|
40
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
40
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig);
|
|
41
41
|
const redirectLambda = new aws_cdk_lib_1.aws_lambda.Function(this, 'lambda', {
|
|
42
42
|
functionName: this.resourceName(`redirect-${props.setting.subdomain}`),
|
|
43
43
|
timeout: cdk.Duration.seconds(25),
|
|
@@ -9,7 +9,7 @@ class QpqServiceStack extends aws_cdk_lib_1.Stack {
|
|
|
9
9
|
super(scope, id, {
|
|
10
10
|
env: {
|
|
11
11
|
account: account,
|
|
12
|
-
region: quidproquo_core_1.qpqCoreUtils.
|
|
12
|
+
region: quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig),
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
this.id = id;
|
|
@@ -7,8 +7,8 @@ const QpqCoreParameterConstruct_1 = require("./constructs/QpqCoreParameterConstr
|
|
|
7
7
|
const QpqCoreSecretConstruct_1 = require("./constructs/QpqCoreSecretConstruct");
|
|
8
8
|
const QpqCoreStorageDriveConstruct_1 = require("./constructs/QpqCoreStorageDriveConstruct");
|
|
9
9
|
const getResourceName = (name, qpqConfig) => {
|
|
10
|
-
const service = quidproquo_core_1.qpqCoreUtils.
|
|
11
|
-
const environment = quidproquo_core_1.qpqCoreUtils.
|
|
10
|
+
const service = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
11
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
12
12
|
return `${name}-${service}-${environment}`;
|
|
13
13
|
};
|
|
14
14
|
exports.getResourceName = getResourceName;
|
|
@@ -48,7 +48,7 @@ const serviceNeedsServiceHostedZone = (qpqConfig) => {
|
|
|
48
48
|
.getConfigSettings(qpqConfig, quidproquo_webserver_1.QPQWebServerConfigSettingType.Api)
|
|
49
49
|
.filter((config) => !config.onRootDomain);
|
|
50
50
|
// // Or if we are deploying to a feature env ~ like joecoady
|
|
51
|
-
// const hasFeatureName = !!qpqCoreUtils.
|
|
51
|
+
// const hasFeatureName = !!qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
52
52
|
return apiConfigs.length > 0; // || hasFeatureName;
|
|
53
53
|
};
|
|
54
54
|
exports.serviceNeedsServiceHostedZone = serviceNeedsServiceHostedZone;
|
package/lib/utils.js
CHANGED
|
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createConstructs = exports.getApiStackName = exports.getWebStackName = exports.getInfrastructureStackName = exports.getBaseStackName = void 0;
|
|
4
4
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
5
|
const getBaseStackName = (qpqConfig) => {
|
|
6
|
-
const appName = quidproquo_core_1.qpqCoreUtils.
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const appName = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
7
|
+
const moduleName = quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
8
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
9
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
10
|
+
const baseName = `${appName}-${moduleName}-${environment}`;
|
|
9
11
|
if (feature) {
|
|
10
|
-
return `${
|
|
12
|
+
return `${baseName}-${feature}`;
|
|
11
13
|
}
|
|
12
|
-
return
|
|
14
|
+
return baseName;
|
|
13
15
|
};
|
|
14
16
|
exports.getBaseStackName = getBaseStackName;
|
|
15
17
|
const getInfrastructureStackName = (qpqConfig) => {
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export interface QpqWebserverDomainConstructProps
|
|
|
13
13
|
extends QpqConstructProps<DnsQPQWebServerConfigSetting> {}
|
|
14
14
|
|
|
15
15
|
export const getEnvironmentDomainName = (qpqConfig: QPQConfig, domain: string): string => {
|
|
16
|
-
const environment = qpqCoreUtils.
|
|
16
|
+
const environment = qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
17
17
|
|
|
18
18
|
if (environment === 'production') {
|
|
19
19
|
return domain;
|
|
@@ -28,7 +28,7 @@ export class QpqWebserverDomainConstruct extends QpqConstruct<DnsQPQWebServerCon
|
|
|
28
28
|
|
|
29
29
|
// example.com
|
|
30
30
|
// dev.example.com
|
|
31
|
-
const feature = qpqCoreUtils.
|
|
31
|
+
const feature = qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);
|
|
32
32
|
const environmentDomain = getEnvironmentDomainName(props.qpqConfig, props.setting.dnsBase);
|
|
33
33
|
const featureDomainName = qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ export class QpqWebserverDomainConstruct extends QpqConstruct<DnsQPQWebServerCon
|
|
|
40
40
|
domainName: feature ? featureDomainName : environmentDomain,
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
// const feature = qpqCoreUtils.
|
|
43
|
+
// const feature = qpqCoreUtils.getApplicationModuleFeature(props.qpqConfig);
|
|
44
44
|
// if (feature) {
|
|
45
45
|
// const featureDomainName = qpqWebServerUtils.getBaseDomainName(props.qpqConfig);
|
|
46
46
|
|
|
@@ -16,7 +16,7 @@ export class QpqWebserverSubdomainRedirectConstruct extends QpqConstruct<Subdoma
|
|
|
16
16
|
super(scope, id, props);
|
|
17
17
|
|
|
18
18
|
const buildPath = qpqCoreUtils.getBuildPath(props.qpqConfig);
|
|
19
|
-
const environment = qpqCoreUtils.
|
|
19
|
+
const environment = qpqCoreUtils.getApplicationModuleEnvironment(props.qpqConfig);
|
|
20
20
|
|
|
21
21
|
const redirectLambda = new aws_lambda.Function(this, 'lambda', {
|
|
22
22
|
functionName: this.resourceName(`redirect-${props.setting.subdomain}`),
|
|
@@ -17,8 +17,8 @@ import { QpqCoreSecretConstruct } from './constructs/QpqCoreSecretConstruct';
|
|
|
17
17
|
import { QpqCoreStorageDriveConstruct } from './constructs/QpqCoreStorageDriveConstruct';
|
|
18
18
|
|
|
19
19
|
export const getResourceName = (name: string, qpqConfig: QPQConfig) => {
|
|
20
|
-
const service = qpqCoreUtils.
|
|
21
|
-
const environment = qpqCoreUtils.
|
|
20
|
+
const service = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
21
|
+
const environment = qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
22
22
|
|
|
23
23
|
return `${name}-${service}-${environment}`;
|
|
24
24
|
};
|
|
@@ -102,7 +102,7 @@ export const serviceNeedsServiceHostedZone = (qpqConfig: QPQConfig) => {
|
|
|
102
102
|
.filter((config) => !config.onRootDomain);
|
|
103
103
|
|
|
104
104
|
// // Or if we are deploying to a feature env ~ like joecoady
|
|
105
|
-
// const hasFeatureName = !!qpqCoreUtils.
|
|
105
|
+
// const hasFeatureName = !!qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
106
106
|
|
|
107
107
|
return apiConfigs.length > 0; // || hasFeatureName;
|
|
108
108
|
};
|
package/src/utils.ts
CHANGED
|
@@ -4,15 +4,18 @@ import { QpqSettingConstructMap } from './QpqSettingConstructMap';
|
|
|
4
4
|
import { QpqServiceStack } from './constructs/core/QPQServiceStack';
|
|
5
5
|
|
|
6
6
|
export const getBaseStackName = (qpqConfig: QPQConfig) => {
|
|
7
|
-
const appName = qpqCoreUtils.
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const appName = qpqCoreUtils.getApplicationName(qpqConfig);
|
|
8
|
+
const moduleName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
9
|
+
const environment = qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
10
|
+
const feature = qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
11
|
+
|
|
12
|
+
const baseName = `${appName}-${moduleName}-${environment}`;
|
|
10
13
|
|
|
11
14
|
if (feature) {
|
|
12
|
-
return `${
|
|
15
|
+
return `${baseName}-${feature}`;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
return
|
|
18
|
+
return baseName;
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
export const getInfrastructureStackName = (qpqConfig: QPQConfig) => {
|