doc2vec 1.0.2 → 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/dist/doc2vec.js +1 -1
- package/doc2vec.ts +1 -1
- package/package.json +1 -1
- package/Dockerfile.old +0 -19
- package/config copy.yaml +0 -182
- package/config-github.yaml +0 -15
- package/config.yaml.new +0 -253
- package/config.yaml.ok +0 -164
- package/config.yaml.solo +0 -251
- package/dist/solo-reference-architectures/Gloo_Edge/ALB_Last_Mile_Encryption/data/acm-waf-cdk/lib/acm-cdk-stack.js +0 -20
- package/dist/solo-reference-architectures/Gloo_Edge/ALB_Last_Mile_Encryption/data/acm-waf-cdk/lib/route53-cdk-stack.js +0 -33
- package/dist/solo-reference-architectures/Gloo_Edge/ALB_Last_Mile_Encryption/data/acm-waf-cdk/lib/waf-cdk-stack.js +0 -66
- package/dist/solo-reference-architectures/Gloo_Edge/ALB_Last_Mile_Encryption/data/acm-waf-cdk/test/s3-cloudfront-cdk.test.js +0 -16
- package/dist/solo-reference-architectures/Gloo_Edge/Cloudfront_NLB/data/s3-cloudfront-cdk/lib/acm-cdk-stack.js +0 -21
- package/dist/solo-reference-architectures/Gloo_Edge/Cloudfront_NLB/data/s3-cloudfront-cdk/lib/s3-cloudfront-cdk-stack.js +0 -95
- package/dist/solo-reference-architectures/Gloo_Edge/Cloudfront_NLB/data/s3-cloudfront-cdk/test/s3-cloudfront-cdk.test.js +0 -16
- package/dist/solo-reference-architectures/Gloo_Gateway/aws-nlb-tls-offloading/data/acm-cdk/bin/acm-cdk.js +0 -55
- package/dist/solo-reference-architectures/Gloo_Gateway/aws-nlb-tls-offloading/data/acm-cdk/lib/acm-cdk-stack.js +0 -20
- package/dist/solo-reference-architectures/Gloo_Gateway/aws-nlb-tls-offloading/data/acm-cdk/lib/route53-cdk-stack.js +0 -33
- package/dist/solo-reference-architectures/Gloo_Gateway/aws-nlb-tls-offloading/data/acm-cdk/test/s3-cloudfront-cdk.test.js +0 -16
- package/doc2vec.js +0 -1805
- package/doc2vec.ts.new +0 -1583
- package/doc2vec.ts.ok +0 -1730
- package/istio-issues.db +0 -0
- package/logger.js +0 -260
- package/tmp/README.md.old +0 -1
- package/tmp.db +0 -0
package/config.yaml.solo
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
# Doc2Vec Configuration
|
|
2
|
-
sources:
|
|
3
|
-
# Local directory Sources
|
|
4
|
-
- type: local_directory
|
|
5
|
-
product_name: 'solo-reference-architectures'
|
|
6
|
-
version: 'latest'
|
|
7
|
-
path: './solo-reference-architectures'
|
|
8
|
-
include_extensions: ['.md']
|
|
9
|
-
exclude_extensions: []
|
|
10
|
-
recursive: true
|
|
11
|
-
url_rewrite_prefix: https://github.com/solo-io/solo-reference-architectures/blob/main
|
|
12
|
-
max_size: 1048576
|
|
13
|
-
database_config:
|
|
14
|
-
type: 'qdrant'
|
|
15
|
-
params:
|
|
16
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
17
|
-
qdrant_port: 443
|
|
18
|
-
collection_name: 'github-solo-reference-architectures'
|
|
19
|
-
|
|
20
|
-
# GitHub Sources
|
|
21
|
-
- type: github
|
|
22
|
-
product_name: 'istio'
|
|
23
|
-
version: 'latest'
|
|
24
|
-
repo: 'istio/istio'
|
|
25
|
-
start_date: '2024-01-01'
|
|
26
|
-
max_size: 1048576
|
|
27
|
-
database_config:
|
|
28
|
-
type: 'qdrant'
|
|
29
|
-
params:
|
|
30
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
31
|
-
qdrant_port: 443
|
|
32
|
-
collection_name: 'github-istio'
|
|
33
|
-
|
|
34
|
-
- type: github
|
|
35
|
-
product_name: 'solo-projects'
|
|
36
|
-
version: 'latest'
|
|
37
|
-
repo: 'solo-io/solo-projects'
|
|
38
|
-
start_date: '2024-01-01'
|
|
39
|
-
max_size: 1048576
|
|
40
|
-
database_config:
|
|
41
|
-
type: 'qdrant'
|
|
42
|
-
params:
|
|
43
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
44
|
-
qdrant_port: 443
|
|
45
|
-
collection_name: 'github-solo-projects'
|
|
46
|
-
|
|
47
|
-
- type: github
|
|
48
|
-
product_name: 'gloo-mesh-enterprise'
|
|
49
|
-
version: 'latest'
|
|
50
|
-
repo: 'solo-io/gloo-mesh-enterprise'
|
|
51
|
-
start_date: '2024-01-01'
|
|
52
|
-
max_size: 1048576
|
|
53
|
-
database_config:
|
|
54
|
-
type: 'qdrant'
|
|
55
|
-
params:
|
|
56
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
57
|
-
qdrant_port: 443
|
|
58
|
-
collection_name: 'github-gloo-mesh-enterprise'
|
|
59
|
-
|
|
60
|
-
# Website Sources
|
|
61
|
-
- type: website
|
|
62
|
-
product_name: 'ambient'
|
|
63
|
-
version: 'latest'
|
|
64
|
-
url: 'https://ambientmesh.io/docs/'
|
|
65
|
-
max_size: 1048576
|
|
66
|
-
database_config:
|
|
67
|
-
type: 'qdrant'
|
|
68
|
-
params:
|
|
69
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
70
|
-
qdrant_port: 443
|
|
71
|
-
collection_name: 'ambient'
|
|
72
|
-
|
|
73
|
-
- type: website
|
|
74
|
-
product_name: 'argo'
|
|
75
|
-
version: 'latest'
|
|
76
|
-
url: 'https://argo-cd.readthedocs.io/en/stable/'
|
|
77
|
-
max_size: 1048576
|
|
78
|
-
database_config:
|
|
79
|
-
type: 'qdrant'
|
|
80
|
-
params:
|
|
81
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
82
|
-
qdrant_port: 443
|
|
83
|
-
collection_name: 'argo'
|
|
84
|
-
|
|
85
|
-
- type: website
|
|
86
|
-
product_name: 'argo-rollouts'
|
|
87
|
-
version: 'latest'
|
|
88
|
-
url: 'https://argoproj.github.io/argo-rollouts/installation/'
|
|
89
|
-
max_size: 1048576
|
|
90
|
-
database_config:
|
|
91
|
-
type: 'qdrant'
|
|
92
|
-
params:
|
|
93
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
94
|
-
qdrant_port: 443
|
|
95
|
-
collection_name: 'argo-rollouts'
|
|
96
|
-
|
|
97
|
-
- type: website
|
|
98
|
-
product_name: 'argo-rollouts'
|
|
99
|
-
version: 'latest'
|
|
100
|
-
url: 'https://rollouts-plugin-trafficrouter-gatewayapi.readthedocs.io/en/latest/'
|
|
101
|
-
max_size: 1048576
|
|
102
|
-
database_config:
|
|
103
|
-
type: 'qdrant'
|
|
104
|
-
params:
|
|
105
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
106
|
-
qdrant_port: 443
|
|
107
|
-
collection_name: 'argo-rollouts'
|
|
108
|
-
|
|
109
|
-
- type: website
|
|
110
|
-
product_name: 'cilium'
|
|
111
|
-
version: 'latest'
|
|
112
|
-
url: 'https://docs.cilium.io/en/stable/'
|
|
113
|
-
max_size: 1048576
|
|
114
|
-
database_config:
|
|
115
|
-
type: 'qdrant'
|
|
116
|
-
params:
|
|
117
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
118
|
-
qdrant_port: 443
|
|
119
|
-
collection_name: 'cilium'
|
|
120
|
-
|
|
121
|
-
- type: website
|
|
122
|
-
product_name: 'gateway-api'
|
|
123
|
-
version: 'latest'
|
|
124
|
-
url: 'https://gateway-api.sigs.k8s.io/'
|
|
125
|
-
max_size: 1048576
|
|
126
|
-
database_config:
|
|
127
|
-
type: 'qdrant'
|
|
128
|
-
params:
|
|
129
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
130
|
-
qdrant_port: 443
|
|
131
|
-
collection_name: 'gateway-api'
|
|
132
|
-
|
|
133
|
-
- type: website
|
|
134
|
-
product_name: 'gloo-mesh-core'
|
|
135
|
-
version: 'latest'
|
|
136
|
-
url: 'https://docs.solo.io/gloo-mesh/main/'
|
|
137
|
-
max_size: 1048576
|
|
138
|
-
database_config:
|
|
139
|
-
type: 'qdrant'
|
|
140
|
-
params:
|
|
141
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
142
|
-
qdrant_port: 443
|
|
143
|
-
collection_name: 'gloo-mesh-core'
|
|
144
|
-
|
|
145
|
-
- type: website
|
|
146
|
-
product_name: 'gloo-mesh-enterprise'
|
|
147
|
-
version: 'latest'
|
|
148
|
-
url: 'https://docs.solo.io/gloo-mesh-enterprise/main/'
|
|
149
|
-
max_size: 1048576
|
|
150
|
-
database_config:
|
|
151
|
-
type: 'qdrant'
|
|
152
|
-
params:
|
|
153
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
154
|
-
qdrant_port: 443
|
|
155
|
-
collection_name: 'gloo-mesh-enterprise'
|
|
156
|
-
|
|
157
|
-
- type: website
|
|
158
|
-
product_name: 'gloo-edge'
|
|
159
|
-
version: 'latest'
|
|
160
|
-
url: 'https://docs.solo.io/gloo-edge/main/'
|
|
161
|
-
max_size: 1048576
|
|
162
|
-
database_config:
|
|
163
|
-
type: 'qdrant'
|
|
164
|
-
params:
|
|
165
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
166
|
-
qdrant_port: 443
|
|
167
|
-
collection_name: 'gloo-edge'
|
|
168
|
-
|
|
169
|
-
- type: website
|
|
170
|
-
product_name: 'gloo-gateway'
|
|
171
|
-
version: 'latest'
|
|
172
|
-
url: 'https://docs.solo.io/gateway/main/'
|
|
173
|
-
max_size: 1048576
|
|
174
|
-
database_config:
|
|
175
|
-
type: 'qdrant'
|
|
176
|
-
params:
|
|
177
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
178
|
-
qdrant_port: 443
|
|
179
|
-
collection_name: 'gloo-gateway'
|
|
180
|
-
|
|
181
|
-
- type: website
|
|
182
|
-
product_name: 'helm'
|
|
183
|
-
version: 'latest'
|
|
184
|
-
url: 'https://helm.sh/docs/'
|
|
185
|
-
max_size: 1048576
|
|
186
|
-
database_config:
|
|
187
|
-
type: 'qdrant'
|
|
188
|
-
params:
|
|
189
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
190
|
-
qdrant_port: 443
|
|
191
|
-
collection_name: 'helm'
|
|
192
|
-
|
|
193
|
-
- type: website
|
|
194
|
-
product_name: 'istio'
|
|
195
|
-
version: 'latest'
|
|
196
|
-
url: 'https://istio.io/latest/docs/'
|
|
197
|
-
max_size: 1048576
|
|
198
|
-
database_config:
|
|
199
|
-
type: 'qdrant'
|
|
200
|
-
params:
|
|
201
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
202
|
-
qdrant_port: 443
|
|
203
|
-
collection_name: 'istio'
|
|
204
|
-
|
|
205
|
-
- type: website
|
|
206
|
-
product_name: 'kgateway'
|
|
207
|
-
version: 'latest'
|
|
208
|
-
url: 'https://kgateway.dev/docs/'
|
|
209
|
-
max_size: 1048576
|
|
210
|
-
database_config:
|
|
211
|
-
type: 'qdrant'
|
|
212
|
-
params:
|
|
213
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
214
|
-
qdrant_port: 443
|
|
215
|
-
collection_name: 'kgateway'
|
|
216
|
-
|
|
217
|
-
- type: website
|
|
218
|
-
product_name: 'kubernetes'
|
|
219
|
-
version: 'latest'
|
|
220
|
-
url: 'https://kubernetes.io/docs/'
|
|
221
|
-
max_size: 1048576
|
|
222
|
-
database_config:
|
|
223
|
-
type: 'qdrant'
|
|
224
|
-
params:
|
|
225
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
226
|
-
qdrant_port: 443
|
|
227
|
-
collection_name: 'kubernetes'
|
|
228
|
-
|
|
229
|
-
- type: website
|
|
230
|
-
product_name: 'otel'
|
|
231
|
-
version: 'latest'
|
|
232
|
-
url: 'https://opentelemetry.io/docs/'
|
|
233
|
-
max_size: 1048576
|
|
234
|
-
database_config:
|
|
235
|
-
type: 'qdrant'
|
|
236
|
-
params:
|
|
237
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
238
|
-
qdrant_port: 443
|
|
239
|
-
collection_name: 'otel'
|
|
240
|
-
|
|
241
|
-
- type: website
|
|
242
|
-
product_name: 'prometheus'
|
|
243
|
-
version: 'latest'
|
|
244
|
-
url: 'https://prometheus.io/docs/'
|
|
245
|
-
max_size: 1048576
|
|
246
|
-
database_config:
|
|
247
|
-
type: 'qdrant'
|
|
248
|
-
params:
|
|
249
|
-
qdrant_url: 'https://qdrant.is.solo.io'
|
|
250
|
-
qdrant_port: 443
|
|
251
|
-
collection_name: 'prometheus'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACMCdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class ACMCdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
if (!process.env.DOMAIN_NAME) {
|
|
9
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
10
|
-
}
|
|
11
|
-
const hostedZone = props.hostedZone;
|
|
12
|
-
const edgeSiteDomainName = "apps." + process.env.DOMAIN_NAME;
|
|
13
|
-
this.acmCertificate = new aws_cdk_lib_1.aws_certificatemanager.Certificate(this, 'SiteCertificate', {
|
|
14
|
-
domainName: edgeSiteDomainName,
|
|
15
|
-
validation: aws_cdk_lib_1.aws_certificatemanager.CertificateValidation.fromDns(hostedZone),
|
|
16
|
-
});
|
|
17
|
-
new aws_cdk_lib_1.CfnOutput(this, 'ACMCertificate', { value: this.acmCertificate.certificateArn });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ACMCdkStack = ACMCdkStack;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Route53CdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class Route53CdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
if (!process.env.PARENT_DOMAIN_NAME) {
|
|
9
|
-
throw new Error("PARENT_DOMAIN_NAME environment variable is not defined");
|
|
10
|
-
}
|
|
11
|
-
if (!process.env.DOMAIN_NAME) {
|
|
12
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
13
|
-
}
|
|
14
|
-
this.hostedZone = new aws_cdk_lib_1.aws_route53.PublicHostedZone(this, "HostedZone", {
|
|
15
|
-
zoneName: process.env.DOMAIN_NAME,
|
|
16
|
-
comment: "Managed by CDK"
|
|
17
|
-
});
|
|
18
|
-
const parent = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, "ParentHostedZone", {
|
|
19
|
-
domainName: process.env.PARENT_DOMAIN_NAME + "."
|
|
20
|
-
});
|
|
21
|
-
if (!this.hostedZone.hostedZoneNameServers) {
|
|
22
|
-
throw new Error("NS record is undefined.");
|
|
23
|
-
}
|
|
24
|
-
new aws_cdk_lib_1.aws_route53.ZoneDelegationRecord(this, "NS", {
|
|
25
|
-
zone: parent,
|
|
26
|
-
recordName: process.env.DOMAIN_NAME,
|
|
27
|
-
nameServers: this.hostedZone.hostedZoneNameServers,
|
|
28
|
-
comment: "Managed by CDK"
|
|
29
|
-
});
|
|
30
|
-
new aws_cdk_lib_1.CfnOutput(this, 'ZoneId', { value: this.hostedZone.hostedZoneId });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.Route53CdkStack = Route53CdkStack;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WAFCdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class WAFCdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
const webAcl = new aws_cdk_lib_1.aws_wafv2.CfnWebACL(this, 'RateLimitWebAcl', {
|
|
9
|
-
description: 'WebACL to rate limit the calls',
|
|
10
|
-
defaultAction: { allow: {} },
|
|
11
|
-
scope: 'REGIONAL',
|
|
12
|
-
visibilityConfig: {
|
|
13
|
-
metricName: 'RateLimitWebAclMetric',
|
|
14
|
-
cloudWatchMetricsEnabled: true,
|
|
15
|
-
sampledRequestsEnabled: true,
|
|
16
|
-
},
|
|
17
|
-
rules: [
|
|
18
|
-
{
|
|
19
|
-
// rate limit to 100 based on IP within 5 minutes
|
|
20
|
-
name: 'AWSRateLimitRuleSet',
|
|
21
|
-
priority: 1,
|
|
22
|
-
action: { block: {} },
|
|
23
|
-
visibilityConfig: {
|
|
24
|
-
metricName: "AWSRateLimitIP",
|
|
25
|
-
cloudWatchMetricsEnabled: true,
|
|
26
|
-
sampledRequestsEnabled: false
|
|
27
|
-
},
|
|
28
|
-
statement: {
|
|
29
|
-
rateBasedStatement: {
|
|
30
|
-
aggregateKeyType: "IP",
|
|
31
|
-
limit: 100,
|
|
32
|
-
evaluationWindowSec: 300
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
// common rule set
|
|
38
|
-
name: 'AWSManagedRulesCommonRuleSet',
|
|
39
|
-
priority: 2,
|
|
40
|
-
overrideAction: { none: {} },
|
|
41
|
-
visibilityConfig: {
|
|
42
|
-
metricName: 'AWSManagedRulesCommonRuleSetMetric',
|
|
43
|
-
cloudWatchMetricsEnabled: true,
|
|
44
|
-
sampledRequestsEnabled: true
|
|
45
|
-
},
|
|
46
|
-
statement: {
|
|
47
|
-
managedRuleGroupStatement: {
|
|
48
|
-
vendorName: 'AWS',
|
|
49
|
-
name: 'AWSManagedRulesCommonRuleSet'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
const alb = aws_cdk_lib_1.aws_elasticloadbalancingv2.ApplicationLoadBalancer.fromLookup(this, 'ALBListener', {
|
|
56
|
-
loadBalancerTags: {
|
|
57
|
-
'elbv2.k8s.aws/cluster': process.env.CLUSTER_OWNER + '-' + process.env.PROJECT
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
new aws_cdk_lib_1.aws_wafv2.CfnWebACLAssociation(this, "ALBWebACLAssociation", {
|
|
61
|
-
webAclArn: webAcl.attrArn,
|
|
62
|
-
resourceArn: alb.loadBalancerArn
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.WAFCdkStack = WAFCdkStack;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import * as cdk from 'aws-cdk-lib';
|
|
3
|
-
// import { Template } from 'aws-cdk-lib/assertions';
|
|
4
|
-
// import * as S3CloudfrontCdk from '../lib/s3-cloudfront-cdk-stack';
|
|
5
|
-
// example test. To run these tests, uncomment this file along with the
|
|
6
|
-
// example resource in lib/s3-cloudfront-cdk-stack.ts
|
|
7
|
-
test('SQS Queue Created', () => {
|
|
8
|
-
// const app = new cdk.App();
|
|
9
|
-
// // WHEN
|
|
10
|
-
// const stack = new S3CloudfrontCdk.S3CloudfrontCdkStack(app, 'MyTestStack');
|
|
11
|
-
// // THEN
|
|
12
|
-
// const template = Template.fromStack(stack);
|
|
13
|
-
// template.hasResourceProperties('AWS::SQS::Queue', {
|
|
14
|
-
// VisibilityTimeout: 300
|
|
15
|
-
// });
|
|
16
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AcmCdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class AcmCdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
if (!process.env.DOMAIN_NAME) {
|
|
9
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
10
|
-
}
|
|
11
|
-
const edgeSiteDomainName = "edge." + process.env.DOMAIN_NAME;
|
|
12
|
-
const zone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'Zone', { domainName: process.env.DOMAIN_NAME });
|
|
13
|
-
// setup acm
|
|
14
|
-
this.acmCertificate = new aws_cdk_lib_1.aws_certificatemanager.Certificate(this, 'SiteCertificate', {
|
|
15
|
-
domainName: edgeSiteDomainName,
|
|
16
|
-
validation: aws_cdk_lib_1.aws_certificatemanager.CertificateValidation.fromDns(zone),
|
|
17
|
-
});
|
|
18
|
-
new aws_cdk_lib_1.CfnOutput(this, 'ACMCertificate', { value: this.acmCertificate.certificateArn });
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.AcmCdkStack = AcmCdkStack;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S3CloudfrontCdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class S3CloudfrontCdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
const acmCertificate = props.acmCertificate;
|
|
9
|
-
const originBucketUriHeader = 'x-s3-bucket-host';
|
|
10
|
-
const bucketName = process.env.S3_BUCKET_NAME || "default-s3-bucket";
|
|
11
|
-
const bucketUri = process.env.S3_BUCKET_URI;
|
|
12
|
-
if (!process.env.DOMAIN_NAME) {
|
|
13
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
14
|
-
}
|
|
15
|
-
const edgeSiteDomainName = "edge." + process.env.DOMAIN_NAME;
|
|
16
|
-
const originDomainName = "apps." + process.env.DOMAIN_NAME;
|
|
17
|
-
if (!bucketUri) {
|
|
18
|
-
throw new Error("S3_BUCKET_URI environment variable is not defined");
|
|
19
|
-
}
|
|
20
|
-
const zone = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, 'Zone', { domainName: process.env.DOMAIN_NAME });
|
|
21
|
-
// create an S3 bucket
|
|
22
|
-
const bucket = new aws_cdk_lib_1.aws_s3.Bucket(this, 'PrivateBucket', {
|
|
23
|
-
bucketName: bucketName,
|
|
24
|
-
removalPolicy: aws_cdk_lib_1.RemovalPolicy.DESTROY,
|
|
25
|
-
autoDeleteObjects: true,
|
|
26
|
-
publicReadAccess: false,
|
|
27
|
-
blockPublicAccess: new aws_cdk_lib_1.aws_s3.BlockPublicAccess({
|
|
28
|
-
blockPublicAcls: false,
|
|
29
|
-
blockPublicPolicy: false,
|
|
30
|
-
ignorePublicAcls: false,
|
|
31
|
-
restrictPublicBuckets: false
|
|
32
|
-
}),
|
|
33
|
-
versioned: true,
|
|
34
|
-
});
|
|
35
|
-
// attach the policy to only credentials based on SigV4
|
|
36
|
-
let authHeaderPolicy = new aws_cdk_lib_1.aws_iam.PolicyStatement({
|
|
37
|
-
actions: ['s3:Get*'],
|
|
38
|
-
resources: [bucket.arnForObjects('*')],
|
|
39
|
-
principals: [new aws_cdk_lib_1.aws_iam.AnyPrincipal()]
|
|
40
|
-
});
|
|
41
|
-
authHeaderPolicy.addCondition('StringEquals', {
|
|
42
|
-
's3:signatureversion': 'AWS4-HMAC-SHA256'
|
|
43
|
-
});
|
|
44
|
-
authHeaderPolicy.addCondition('StringEquals', {
|
|
45
|
-
's3:authType': 'REST-HEADER'
|
|
46
|
-
});
|
|
47
|
-
bucket.addToResourcePolicy(authHeaderPolicy);
|
|
48
|
-
// deploy all the artifacts
|
|
49
|
-
new aws_cdk_lib_1.aws_s3_deployment.BucketDeployment(this, 'DeployToBucket', {
|
|
50
|
-
sources: [aws_cdk_lib_1.aws_s3_deployment.Source.asset('./s3-bucket-contents/original')],
|
|
51
|
-
destinationBucket: bucket,
|
|
52
|
-
});
|
|
53
|
-
// setup cloudfront
|
|
54
|
-
const cdnDistribution = new aws_cdk_lib_1.aws_cloudfront.Distribution(this, 'SiteCDN', {
|
|
55
|
-
domainNames: [edgeSiteDomainName],
|
|
56
|
-
certificate: acmCertificate,
|
|
57
|
-
minimumProtocolVersion: aws_cdk_lib_1.aws_cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021,
|
|
58
|
-
enableIpv6: false,
|
|
59
|
-
defaultBehavior: {
|
|
60
|
-
origin: new aws_cdk_lib_1.aws_cloudfront_origins.HttpOrigin(originDomainName, {
|
|
61
|
-
protocolPolicy: aws_cdk_lib_1.aws_cloudfront.OriginProtocolPolicy.HTTPS_ONLY,
|
|
62
|
-
originSslProtocols: [aws_cdk_lib_1.aws_cloudfront.OriginSslPolicy.TLS_V1_2],
|
|
63
|
-
httpsPort: 443,
|
|
64
|
-
readTimeout: aws_cdk_lib_1.Duration.seconds(45),
|
|
65
|
-
connectionTimeout: aws_cdk_lib_1.Duration.seconds(10),
|
|
66
|
-
customHeaders: {
|
|
67
|
-
'x-s3-bucket-host': bucketUri
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
viewerProtocolPolicy: aws_cdk_lib_1.aws_cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
71
|
-
allowedMethods: aws_cdk_lib_1.aws_cloudfront.AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
|
|
72
|
-
cachedMethods: aws_cdk_lib_1.aws_cloudfront.CachedMethods.CACHE_GET_HEAD_OPTIONS,
|
|
73
|
-
cachePolicy: aws_cdk_lib_1.aws_cloudfront.CachePolicy.CACHING_OPTIMIZED,
|
|
74
|
-
compress: true
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
// add A record to route53
|
|
78
|
-
new aws_cdk_lib_1.aws_route53.ARecord(this, 'SiteAliasARecord', {
|
|
79
|
-
recordName: edgeSiteDomainName,
|
|
80
|
-
target: aws_cdk_lib_1.aws_route53.RecordTarget.fromAlias(new aws_cdk_lib_1.aws_route53_targets.CloudFrontTarget(cdnDistribution)),
|
|
81
|
-
zone
|
|
82
|
-
});
|
|
83
|
-
// output information
|
|
84
|
-
new aws_cdk_lib_1.CfnOutput(this, 'SiteDistribution', {
|
|
85
|
-
value: cdnDistribution.distributionId,
|
|
86
|
-
});
|
|
87
|
-
new aws_cdk_lib_1.CfnOutput(this, 'BucketDomain', {
|
|
88
|
-
value: bucket.bucketRegionalDomainName,
|
|
89
|
-
});
|
|
90
|
-
new aws_cdk_lib_1.CfnOutput(this, 'SiteDomain', {
|
|
91
|
-
value: cdnDistribution.domainName,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.S3CloudfrontCdkStack = S3CloudfrontCdkStack;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import * as cdk from 'aws-cdk-lib';
|
|
3
|
-
// import { Template } from 'aws-cdk-lib/assertions';
|
|
4
|
-
// import * as S3CloudfrontCdk from '../lib/s3-cloudfront-cdk-stack';
|
|
5
|
-
// example test. To run these tests, uncomment this file along with the
|
|
6
|
-
// example resource in lib/s3-cloudfront-cdk-stack.ts
|
|
7
|
-
test('SQS Queue Created', () => {
|
|
8
|
-
// const app = new cdk.App();
|
|
9
|
-
// // WHEN
|
|
10
|
-
// const stack = new S3CloudfrontCdk.S3CloudfrontCdkStack(app, 'MyTestStack');
|
|
11
|
-
// // THEN
|
|
12
|
-
// const template = Template.fromStack(stack);
|
|
13
|
-
// template.hasResourceProperties('AWS::SQS::Queue', {
|
|
14
|
-
// VisibilityTimeout: 300
|
|
15
|
-
// });
|
|
16
|
-
});
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
require("source-map-support/register");
|
|
38
|
-
const cdk = __importStar(require("aws-cdk-lib"));
|
|
39
|
-
const acm_cdk_stack_1 = require("../lib/acm-cdk-stack");
|
|
40
|
-
const route53_cdk_stack_1 = require("../lib/route53-cdk-stack");
|
|
41
|
-
const app = new cdk.App();
|
|
42
|
-
const route53Stack = new route53_cdk_stack_1.Route53CdkStack(app, 'Route53CdkStack', {
|
|
43
|
-
env: {
|
|
44
|
-
account: process.env.CDK_DEFAULT_ACCOUNT,
|
|
45
|
-
region: process.env.CLUSTER_REGION || process.env.CDK_DEFAULT_REGION
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const acmStack = new acm_cdk_stack_1.ACMCdkStack(app, 'ACMCdkStack', {
|
|
49
|
-
env: {
|
|
50
|
-
account: process.env.CDK_DEFAULT_ACCOUNT,
|
|
51
|
-
region: process.env.CLUSTER_REGION || process.env.CDK_DEFAULT_REGION
|
|
52
|
-
},
|
|
53
|
-
hostedZone: route53Stack.hostedZone
|
|
54
|
-
});
|
|
55
|
-
acmStack.addDependency(route53Stack);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ACMCdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class ACMCdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
if (!process.env.DOMAIN_NAME) {
|
|
9
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
10
|
-
}
|
|
11
|
-
const hostedZone = props.hostedZone;
|
|
12
|
-
const edgeSiteDomainName = "apps." + process.env.DOMAIN_NAME;
|
|
13
|
-
this.acmCertificate = new aws_cdk_lib_1.aws_certificatemanager.Certificate(this, 'SiteCertificate', {
|
|
14
|
-
domainName: edgeSiteDomainName,
|
|
15
|
-
validation: aws_cdk_lib_1.aws_certificatemanager.CertificateValidation.fromDns(hostedZone),
|
|
16
|
-
});
|
|
17
|
-
new aws_cdk_lib_1.CfnOutput(this, 'ACMCertificate', { value: this.acmCertificate.certificateArn });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ACMCdkStack = ACMCdkStack;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Route53CdkStack = void 0;
|
|
4
|
-
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
5
|
-
class Route53CdkStack extends aws_cdk_lib_1.Stack {
|
|
6
|
-
constructor(scope, id, props) {
|
|
7
|
-
super(scope, id, props);
|
|
8
|
-
if (!process.env.PARENT_DOMAIN_NAME) {
|
|
9
|
-
throw new Error("PARENT_DOMAIN_NAME environment variable is not defined");
|
|
10
|
-
}
|
|
11
|
-
if (!process.env.DOMAIN_NAME) {
|
|
12
|
-
throw new Error("DOMAIN_NAME environment variable is not defined");
|
|
13
|
-
}
|
|
14
|
-
this.hostedZone = new aws_cdk_lib_1.aws_route53.PublicHostedZone(this, "HostedZone", {
|
|
15
|
-
zoneName: process.env.DOMAIN_NAME,
|
|
16
|
-
comment: "Managed by CDK"
|
|
17
|
-
});
|
|
18
|
-
const parent = aws_cdk_lib_1.aws_route53.HostedZone.fromLookup(this, "ParentHostedZone", {
|
|
19
|
-
domainName: process.env.PARENT_DOMAIN_NAME + "."
|
|
20
|
-
});
|
|
21
|
-
if (!this.hostedZone.hostedZoneNameServers) {
|
|
22
|
-
throw new Error("NS record is undefined.");
|
|
23
|
-
}
|
|
24
|
-
new aws_cdk_lib_1.aws_route53.ZoneDelegationRecord(this, "NS", {
|
|
25
|
-
zone: parent,
|
|
26
|
-
recordName: process.env.DOMAIN_NAME,
|
|
27
|
-
nameServers: this.hostedZone.hostedZoneNameServers,
|
|
28
|
-
comment: "Managed by CDK"
|
|
29
|
-
});
|
|
30
|
-
new aws_cdk_lib_1.CfnOutput(this, 'ZoneId', { value: this.hostedZone.hostedZoneId });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.Route53CdkStack = Route53CdkStack;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// import * as cdk from 'aws-cdk-lib';
|
|
3
|
-
// import { Template } from 'aws-cdk-lib/assertions';
|
|
4
|
-
// import * as S3CloudfrontCdk from '../lib/s3-cloudfront-cdk-stack';
|
|
5
|
-
// example test. To run these tests, uncomment this file along with the
|
|
6
|
-
// example resource in lib/s3-cloudfront-cdk-stack.ts
|
|
7
|
-
test('SQS Queue Created', () => {
|
|
8
|
-
// const app = new cdk.App();
|
|
9
|
-
// // WHEN
|
|
10
|
-
// const stack = new S3CloudfrontCdk.S3CloudfrontCdkStack(app, 'MyTestStack');
|
|
11
|
-
// // THEN
|
|
12
|
-
// const template = Template.fromStack(stack);
|
|
13
|
-
// template.hasResourceProperties('AWS::SQS::Queue', {
|
|
14
|
-
// VisibilityTimeout: 300
|
|
15
|
-
// });
|
|
16
|
-
});
|