@ndlib/ndlib-cdk2 1.0.1 → 1.0.4
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/.DS_Store +0 -0
- package/lib/dashboards/.DS_Store +0 -0
- package/lib/dashboards/index.js +5 -1
- package/lib/dashboards/summary-dashboard.js +1 -1
- package/lib/dashboards/widgets/index.js +5 -1
- package/lib/edge-lambdas/.DS_Store +0 -0
- package/lib/edge-lambdas/index.js +5 -1
- package/lib/index.js +5 -1
- package/lib/internal-lambdas/.DS_Store +0 -0
- package/lib/internal-lambdas/sourceWatcherLambda/.DS_Store +0 -0
- package/lib/internal-lambdas/sourceWatcherLambda/src/.DS_Store +0 -0
- package/lib/internal-lambdas/sourceWatcherLambda/src/node_modules/.DS_Store +0 -0
- package/lib/internal-lambdas/sourceWatcherLambda/src/node_modules/@aws-sdk/.DS_Store +0 -0
- package/lib/internal-lambdas/sourceWatcherLambda/src/node_modules/@aws-sdk/client-ssm/.DS_Store +0 -0
- package/lib/metrics/.DS_Store +0 -0
- package/lib/metrics/api-gateway/index.js +5 -1
- package/lib/metrics/cloudfront/index.js +5 -1
- package/lib/metrics/elasticsearch/index.js +5 -1
- package/lib/metrics/graphql/index.js +5 -1
- package/lib/metrics/index.js +5 -1
- package/lib/metrics/lambda-search/index.js +5 -1
- package/lib/static-host/index.js +5 -1
- package/lib/static-host/static-host.d.ts +3 -2
- package/lib/static-host/static-host.js +26 -14
- package/package.json +24 -21
package/lib/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
package/lib/dashboards/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -116,7 +116,7 @@ class SummaryDashboard extends aws_cdk_lib_1.aws_cloudwatch.Dashboard {
|
|
|
116
116
|
}
|
|
117
117
|
static visit(node, services, lambdaNames, includeLambdas, serviceLabels) {
|
|
118
118
|
const customLabel = serviceLabels[node.node.addr];
|
|
119
|
-
if (node instanceof aws_cdk_lib_1.
|
|
119
|
+
if (node instanceof aws_cdk_lib_1.aws_opensearchservice.CfnDomain) {
|
|
120
120
|
if (node.domainName != undefined) {
|
|
121
121
|
services.push({
|
|
122
122
|
typeName: 'ElasticSearchApi',
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
Binary file
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/internal-lambdas/sourceWatcherLambda/src/node_modules/@aws-sdk/client-ssm/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/metrics/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/static-host/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -20,9 +20,10 @@ export interface IStaticHostProps {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly createDns?: boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Hosted zone
|
|
23
|
+
* Hosted zone ids for the route53 record. Is required if createDns is true.
|
|
24
|
+
* This is now an array to accommodate both a public hosted zone id and a private hosted zone id
|
|
24
25
|
*/
|
|
25
|
-
readonly
|
|
26
|
+
readonly hostedZoneIds?: string[];
|
|
26
27
|
/**
|
|
27
28
|
* Root page to be served.
|
|
28
29
|
*/
|
|
@@ -9,9 +9,19 @@ class StaticHost extends constructs_1.Construct {
|
|
|
9
9
|
super(scope, id);
|
|
10
10
|
this.inProps = props;
|
|
11
11
|
// removed .validate() and replaced with this error to enforce hostedZondId when createDNS is true
|
|
12
|
-
if (this.inProps.createDns && !this.inProps.
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// if (this.inProps.createDns && !this.inProps.hostedZoneIds) {
|
|
13
|
+
// Annotations.of(this).addError('hostedZoneIds is required when createDns is true')
|
|
14
|
+
// throw new Error('hostedZoneIds is required when createDns is true')
|
|
15
|
+
// }
|
|
16
|
+
if (this.inProps.createDns) {
|
|
17
|
+
if (!this.inProps.hostedZoneIds) {
|
|
18
|
+
aws_cdk_lib_1.Annotations.of(this).addError('hostedZoneIds is required when createDns is true');
|
|
19
|
+
throw new Error('hostedZoneIds is required when createDns is true');
|
|
20
|
+
}
|
|
21
|
+
if (this.inProps.hostedZoneIds.length == 0) {
|
|
22
|
+
aws_cdk_lib_1.Annotations.of(this).addError('hostedZoneIds is required when createDns is true, and must contain at least one hostedZoneId');
|
|
23
|
+
throw new Error('hostedZoneIds is required when createDns is true, and must contain at least one hostedZoneId');
|
|
24
|
+
}
|
|
15
25
|
}
|
|
16
26
|
const stack = aws_cdk_lib_1.Stack.of(this);
|
|
17
27
|
this.hostname = `${props.hostnamePrefix}.${props.domainName}`;
|
|
@@ -104,17 +114,19 @@ class StaticHost extends constructs_1.Construct {
|
|
|
104
114
|
viewerProtocolPolicy: aws_cdk_lib_1.aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
105
115
|
});
|
|
106
116
|
// Create DNS record (conditionally)
|
|
107
|
-
if (props.createDns) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
if (props.createDns && props.hostedZoneIds && props.hostedZoneIds.length > 0) {
|
|
118
|
+
for (const hostedZoneId of props.hostedZoneIds) {
|
|
119
|
+
new aws_cdk_lib_1.aws_route53.CnameRecord(this, `ServiceCNAME${hostedZoneId}`, {
|
|
120
|
+
recordName: this.hostname,
|
|
121
|
+
comment: this.hostname,
|
|
122
|
+
domainName: this.cloudfront.distributionDomainName,
|
|
123
|
+
zone: aws_cdk_lib_1.aws_route53.HostedZone.fromHostedZoneAttributes(this, `ImportedHostedZone${hostedZoneId}`, {
|
|
124
|
+
hostedZoneId: hostedZoneId,
|
|
125
|
+
zoneName: props.domainName,
|
|
126
|
+
}),
|
|
127
|
+
ttl: aws_cdk_lib_1.Duration.minutes(15),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
118
130
|
}
|
|
119
131
|
this.bucketNameParam = new aws_cdk_lib_1.aws_ssm.StringParameter(this, 'BucketParameter', {
|
|
120
132
|
parameterName: `/all/stacks/${stack.stackName}/site-bucket-name`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndlib/ndlib-cdk2",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Reusable CDK2 modules used within Hesburgh Libraries of Notre Dame",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -37,38 +37,41 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/ndlib/ndlib-cdk2#readme",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"aws-cdk-lib": "^2.
|
|
41
|
-
"constructs": "^10.
|
|
40
|
+
"aws-cdk-lib": "^2.24.1",
|
|
41
|
+
"constructs": "^10.1.12"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/jest": "^27.
|
|
45
|
-
"@types/node": "^17.0.
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
47
|
-
"@typescript-eslint/parser": "^5.
|
|
48
|
-
"aws-sdk": "^2.
|
|
49
|
-
"aws-sdk-client-mock": "^0.
|
|
50
|
-
"eslint": "^8.
|
|
51
|
-
"eslint-config-standard": "^
|
|
52
|
-
"eslint-plugin-import": "^2.
|
|
53
|
-
"eslint-plugin-jest": "^26.
|
|
44
|
+
"@types/jest": "^27.5.1",
|
|
45
|
+
"@types/node": "^17.0.35",
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^5.25.0",
|
|
47
|
+
"@typescript-eslint/parser": "^5.25.0",
|
|
48
|
+
"aws-sdk": "^2.1140.0",
|
|
49
|
+
"aws-sdk-client-mock": "^0.6.2",
|
|
50
|
+
"eslint": "^8.15.0",
|
|
51
|
+
"eslint-config-standard": "^17.0.0",
|
|
52
|
+
"eslint-plugin-import": "^2.26.0",
|
|
53
|
+
"eslint-plugin-jest": "^26.2.2",
|
|
54
|
+
"eslint-plugin-n": "^15.2.0",
|
|
54
55
|
"eslint-plugin-node": "^11.1.0",
|
|
55
56
|
"eslint-plugin-promise": "^6.0.0",
|
|
56
57
|
"eslint-plugin-standard": "^5.0.0",
|
|
57
58
|
"github-changes": "^2.0.3",
|
|
58
|
-
"jest": "^
|
|
59
|
-
"prettier": "^2.
|
|
59
|
+
"jest": "^28.1.0",
|
|
60
|
+
"prettier": "^2.6.2",
|
|
60
61
|
"subpackage": "^1.1.0",
|
|
61
|
-
"ts-jest": "^
|
|
62
|
-
"tsc-watch": "^
|
|
63
|
-
"typescript": "^4.
|
|
62
|
+
"ts-jest": "^28.0.2",
|
|
63
|
+
"tsc-watch": "^5.0.3",
|
|
64
|
+
"typescript": "^4.6.4"
|
|
64
65
|
},
|
|
65
66
|
"files": [
|
|
66
67
|
"lib/**/*"
|
|
67
68
|
],
|
|
68
69
|
"dependencies": {
|
|
69
|
-
"@aws-cdk/aws-appsync-alpha": "^2.
|
|
70
|
-
"aws-cdk-lib": "^2.
|
|
71
|
-
"constructs": "^10.
|
|
70
|
+
"@aws-cdk/aws-appsync-alpha": "^2.24.1-alpha.0",
|
|
71
|
+
"aws-cdk-lib": "^2.24.1",
|
|
72
|
+
"constructs": "^10.1.12",
|
|
73
|
+
"jest-mock": "^28.1.0",
|
|
74
|
+
"node-fetch": "^3.2.4"
|
|
72
75
|
},
|
|
73
76
|
"subPackages": [
|
|
74
77
|
"src/internal-lambdas/sourceWatcherLambda/src"
|