@openhi/constructs 0.0.115 → 0.0.116
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/index.d.mts +267 -8
- package/lib/index.d.ts +282 -9
- package/lib/index.js +408 -123
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +417 -123
- package/lib/index.mjs.map +1 -1
- package/lib/static-hosting.viewer-request-handler.d.mts +54 -0
- package/lib/static-hosting.viewer-request-handler.d.ts +54 -0
- package/lib/static-hosting.viewer-request-handler.js +79 -0
- package/lib/static-hosting.viewer-request-handler.js.map +1 -0
- package/lib/static-hosting.viewer-request-handler.mjs +53 -0
- package/lib/static-hosting.viewer-request-handler.mjs.map +1 -0
- package/package.json +2 -2
package/lib/index.mjs
CHANGED
|
@@ -1432,14 +1432,39 @@ import { Construct as Construct7 } from "constructs";
|
|
|
1432
1432
|
var RootHostedZone = class extends Construct7 {
|
|
1433
1433
|
};
|
|
1434
1434
|
|
|
1435
|
+
// src/components/static-hosting/static-content.ts
|
|
1436
|
+
import { Bucket as Bucket3 } from "aws-cdk-lib/aws-s3";
|
|
1437
|
+
import { BucketDeployment, Source } from "aws-cdk-lib/aws-s3-deployment";
|
|
1438
|
+
import { paramCase as paramCase2 } from "change-case";
|
|
1439
|
+
import { Construct as Construct9 } from "constructs";
|
|
1440
|
+
|
|
1435
1441
|
// src/components/static-hosting/static-hosting.ts
|
|
1442
|
+
import * as fs6 from "fs";
|
|
1443
|
+
import * as path6 from "path";
|
|
1444
|
+
import { Duration as Duration4 } from "aws-cdk-lib";
|
|
1436
1445
|
import {
|
|
1446
|
+
AccessLevel,
|
|
1447
|
+
AllowedMethods,
|
|
1448
|
+
CacheCookieBehavior,
|
|
1449
|
+
CacheHeaderBehavior,
|
|
1437
1450
|
CachePolicy,
|
|
1438
|
-
|
|
1451
|
+
CacheQueryStringBehavior,
|
|
1452
|
+
Distribution,
|
|
1453
|
+
LambdaEdgeEventType,
|
|
1454
|
+
S3OriginAccessControl,
|
|
1455
|
+
Signing,
|
|
1456
|
+
ViewerProtocolPolicy
|
|
1439
1457
|
} from "aws-cdk-lib/aws-cloudfront";
|
|
1440
1458
|
import { S3BucketOrigin } from "aws-cdk-lib/aws-cloudfront-origins";
|
|
1459
|
+
import { Runtime as Runtime6 } from "aws-cdk-lib/aws-lambda";
|
|
1460
|
+
import { NodejsFunction as NodejsFunction6 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
1461
|
+
import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs";
|
|
1462
|
+
import {
|
|
1463
|
+
ARecord,
|
|
1464
|
+
RecordTarget
|
|
1465
|
+
} from "aws-cdk-lib/aws-route53";
|
|
1466
|
+
import { CloudFrontTarget } from "aws-cdk-lib/aws-route53-targets";
|
|
1441
1467
|
import { Bucket as Bucket2 } from "aws-cdk-lib/aws-s3";
|
|
1442
|
-
import { Duration as Duration4 } from "aws-cdk-lib/core";
|
|
1443
1468
|
import { Construct as Construct8 } from "constructs";
|
|
1444
1469
|
var STATIC_HOSTING_SERVICE_TYPE = "website";
|
|
1445
1470
|
var _StaticHosting = class _StaticHosting extends Construct8 {
|
|
@@ -1447,6 +1472,7 @@ var _StaticHosting = class _StaticHosting extends Construct8 {
|
|
|
1447
1472
|
super(scope, id);
|
|
1448
1473
|
const stack = OpenHiService.of(scope);
|
|
1449
1474
|
const serviceType = props.serviceType ?? STATIC_HOSTING_SERVICE_TYPE;
|
|
1475
|
+
const hostingMode = props.hostingMode ?? "spa";
|
|
1450
1476
|
this.bucket = new Bucket2(this, "bucket", {
|
|
1451
1477
|
blockPublicAccess: {
|
|
1452
1478
|
blockPublicAcls: true,
|
|
@@ -1456,30 +1482,105 @@ var _StaticHosting = class _StaticHosting extends Construct8 {
|
|
|
1456
1482
|
},
|
|
1457
1483
|
...props.bucketProps
|
|
1458
1484
|
});
|
|
1459
|
-
const
|
|
1485
|
+
const handlerJs = path6.join(
|
|
1486
|
+
__dirname,
|
|
1487
|
+
"static-hosting.viewer-request-handler.js"
|
|
1488
|
+
);
|
|
1489
|
+
const handlerTs = path6.join(
|
|
1490
|
+
__dirname,
|
|
1491
|
+
"static-hosting.viewer-request-handler.ts"
|
|
1492
|
+
);
|
|
1493
|
+
const handlerEntry = fs6.existsSync(handlerJs) ? handlerJs : handlerTs;
|
|
1494
|
+
this.viewerRequestHandler = new NodejsFunction6(
|
|
1495
|
+
this,
|
|
1496
|
+
"viewer-request-handler",
|
|
1497
|
+
{
|
|
1498
|
+
entry: handlerEntry,
|
|
1499
|
+
handler: hostingMode === "static" ? "staticHandler" : "spaHandler",
|
|
1500
|
+
memorySize: 128,
|
|
1501
|
+
runtime: Runtime6.NODEJS_LATEST,
|
|
1502
|
+
logGroup: new LogGroup(this, "viewer-request-handler-log-group", {
|
|
1503
|
+
retention: RetentionDays.ONE_MONTH
|
|
1504
|
+
})
|
|
1505
|
+
}
|
|
1506
|
+
);
|
|
1460
1507
|
const cachePolicy = new CachePolicy(this, "cache-policy", {
|
|
1461
|
-
cachePolicyName: `static-hosting
|
|
1462
|
-
comment: "
|
|
1463
|
-
defaultTtl: Duration4.seconds(
|
|
1508
|
+
cachePolicyName: `static-hosting-${stack.branchHash}`,
|
|
1509
|
+
comment: "Static hosting default: 60s default / 300s max, gzip+brotli.",
|
|
1510
|
+
defaultTtl: Duration4.seconds(60),
|
|
1464
1511
|
minTtl: Duration4.seconds(0),
|
|
1465
|
-
maxTtl: Duration4.seconds(
|
|
1466
|
-
|
|
1512
|
+
maxTtl: Duration4.seconds(300),
|
|
1513
|
+
headerBehavior: CacheHeaderBehavior.none(),
|
|
1514
|
+
queryStringBehavior: CacheQueryStringBehavior.none(),
|
|
1515
|
+
cookieBehavior: CacheCookieBehavior.none(),
|
|
1516
|
+
enableAcceptEncodingGzip: true,
|
|
1517
|
+
enableAcceptEncodingBrotli: true,
|
|
1518
|
+
...props.cachePolicyProps
|
|
1519
|
+
});
|
|
1520
|
+
const oac = new S3OriginAccessControl(this, "origin-access-control", {
|
|
1521
|
+
signing: Signing.SIGV4_NO_OVERRIDE
|
|
1522
|
+
});
|
|
1523
|
+
const origin = S3BucketOrigin.withOriginAccessControl(this.bucket, {
|
|
1524
|
+
originAccessControl: oac,
|
|
1525
|
+
originAccessLevels: [AccessLevel.READ]
|
|
1526
|
+
});
|
|
1527
|
+
const hasCustomDomain = props.certificate !== void 0 && props.hostedZone !== void 0 && props.domainNames !== void 0 && props.domainNames.length > 0;
|
|
1467
1528
|
this.distribution = new Distribution(this, "distribution", {
|
|
1529
|
+
comment: `Static hosting distribution for ${props.description ?? id}`,
|
|
1530
|
+
...hasCustomDomain ? {
|
|
1531
|
+
certificate: props.certificate,
|
|
1532
|
+
domainNames: [...props.domainNames]
|
|
1533
|
+
} : {},
|
|
1534
|
+
defaultRootObject: "index.html",
|
|
1468
1535
|
defaultBehavior: {
|
|
1469
1536
|
origin,
|
|
1470
|
-
|
|
1537
|
+
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
|
|
1538
|
+
cachePolicy,
|
|
1539
|
+
allowedMethods: AllowedMethods.ALLOW_GET_HEAD_OPTIONS,
|
|
1540
|
+
edgeLambdas: [
|
|
1541
|
+
{
|
|
1542
|
+
functionVersion: this.viewerRequestHandler.currentVersion,
|
|
1543
|
+
eventType: LambdaEdgeEventType.VIEWER_REQUEST,
|
|
1544
|
+
includeBody: false
|
|
1545
|
+
}
|
|
1546
|
+
]
|
|
1471
1547
|
},
|
|
1472
1548
|
...props.distributionProps
|
|
1473
1549
|
});
|
|
1550
|
+
if (hasCustomDomain) {
|
|
1551
|
+
props.domainNames.forEach((domainName, index) => {
|
|
1552
|
+
new ARecord(this, `dns-record-${index}`, {
|
|
1553
|
+
zone: props.hostedZone,
|
|
1554
|
+
recordName: domainName,
|
|
1555
|
+
target: RecordTarget.fromAlias(
|
|
1556
|
+
new CloudFrontTarget(this.distribution)
|
|
1557
|
+
)
|
|
1558
|
+
});
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1474
1561
|
new DiscoverableStringParameter(this, "bucket-arn-param", {
|
|
1475
1562
|
ssmParamName: _StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
|
|
1476
1563
|
serviceType,
|
|
1477
|
-
stringValue: this.bucket.bucketArn
|
|
1564
|
+
stringValue: this.bucket.bucketArn,
|
|
1565
|
+
description: `Static hosting bucket ARN (${props.description ?? id})`
|
|
1478
1566
|
});
|
|
1479
1567
|
new DiscoverableStringParameter(this, "distribution-arn-param", {
|
|
1480
1568
|
ssmParamName: _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ARN,
|
|
1481
1569
|
serviceType,
|
|
1482
|
-
stringValue: this.distribution.distributionArn
|
|
1570
|
+
stringValue: this.distribution.distributionArn,
|
|
1571
|
+
description: `Static hosting distribution ARN (${props.description ?? id})`
|
|
1572
|
+
});
|
|
1573
|
+
new DiscoverableStringParameter(this, "distribution-domain-param", {
|
|
1574
|
+
ssmParamName: _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_DOMAIN,
|
|
1575
|
+
serviceType,
|
|
1576
|
+
stringValue: this.distribution.domainName,
|
|
1577
|
+
description: `Static hosting distribution domain (${props.description ?? id})`
|
|
1578
|
+
});
|
|
1579
|
+
new DiscoverableStringParameter(this, "distribution-id-param", {
|
|
1580
|
+
ssmParamName: _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ID,
|
|
1581
|
+
serviceType,
|
|
1582
|
+
stringValue: this.distribution.distributionId,
|
|
1583
|
+
description: `Static hosting distribution ID (${props.description ?? id})`
|
|
1483
1584
|
});
|
|
1484
1585
|
}
|
|
1485
1586
|
};
|
|
@@ -1491,8 +1592,46 @@ _StaticHosting.SSM_PARAM_NAME_BUCKET_ARN = "STATIC_HOSTING_BUCKET_ARN";
|
|
|
1491
1592
|
* SSM parameter name for the CloudFront distribution ARN.
|
|
1492
1593
|
*/
|
|
1493
1594
|
_StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ARN = "STATIC_HOSTING_DISTRIBUTION_ARN";
|
|
1595
|
+
/**
|
|
1596
|
+
* SSM parameter name for the CloudFront distribution domain
|
|
1597
|
+
* (e.g. dXXXXX.cloudfront.net).
|
|
1598
|
+
*/
|
|
1599
|
+
_StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_DOMAIN = "STATIC_HOSTING_DISTRIBUTION_DOMAIN";
|
|
1600
|
+
/**
|
|
1601
|
+
* SSM parameter name for the CloudFront distribution ID.
|
|
1602
|
+
*/
|
|
1603
|
+
_StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ID = "STATIC_HOSTING_DISTRIBUTION_ID";
|
|
1494
1604
|
var StaticHosting = _StaticHosting;
|
|
1495
1605
|
|
|
1606
|
+
// src/components/static-hosting/static-content.ts
|
|
1607
|
+
var StaticContent = class extends Construct9 {
|
|
1608
|
+
constructor(scope, id, props) {
|
|
1609
|
+
super(scope, id);
|
|
1610
|
+
const stack = OpenHiService.of(scope);
|
|
1611
|
+
const {
|
|
1612
|
+
contentSourceDirectory,
|
|
1613
|
+
contentDestinationDirectory = "/",
|
|
1614
|
+
subDomain = stack.branchName,
|
|
1615
|
+
fullDomain,
|
|
1616
|
+
serviceType = STATIC_HOSTING_SERVICE_TYPE
|
|
1617
|
+
} = props;
|
|
1618
|
+
const keyPrefix = [paramCase2(subDomain), fullDomain].join(".");
|
|
1619
|
+
const bucketArn = DiscoverableStringParameter.valueForLookupName(this, {
|
|
1620
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
|
|
1621
|
+
serviceType
|
|
1622
|
+
});
|
|
1623
|
+
const bucket = Bucket3.fromBucketArn(this, "bucket", bucketArn);
|
|
1624
|
+
const isTestEnv = process.env.JEST_WORKER_ID !== void 0;
|
|
1625
|
+
const sources = isTestEnv ? [] : [Source.asset(contentSourceDirectory)];
|
|
1626
|
+
new BucketDeployment(this, "deploy", {
|
|
1627
|
+
sources,
|
|
1628
|
+
destinationBucket: bucket,
|
|
1629
|
+
retainOnDelete: false,
|
|
1630
|
+
destinationKeyPrefix: `${keyPrefix}${contentDestinationDirectory}`
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
|
|
1496
1635
|
// src/services/open-hi-auth-service.ts
|
|
1497
1636
|
import {
|
|
1498
1637
|
LambdaVersion,
|
|
@@ -1522,27 +1661,27 @@ import {
|
|
|
1522
1661
|
import { StringParameter as StringParameter3 } from "aws-cdk-lib/aws-ssm";
|
|
1523
1662
|
|
|
1524
1663
|
// src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge.ts
|
|
1525
|
-
import { Construct as
|
|
1664
|
+
import { Construct as Construct11 } from "constructs";
|
|
1526
1665
|
|
|
1527
1666
|
// src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge-lambda.ts
|
|
1528
|
-
import
|
|
1529
|
-
import
|
|
1667
|
+
import fs7 from "fs";
|
|
1668
|
+
import path7 from "path";
|
|
1530
1669
|
import { Duration as Duration5, Stack as Stack3 } from "aws-cdk-lib";
|
|
1531
1670
|
import { Rule } from "aws-cdk-lib/aws-events";
|
|
1532
1671
|
import { LambdaFunction } from "aws-cdk-lib/aws-events-targets";
|
|
1533
1672
|
import { Effect as Effect2, PolicyStatement as PolicyStatement2 } from "aws-cdk-lib/aws-iam";
|
|
1534
|
-
import { Runtime as
|
|
1535
|
-
import { NodejsFunction as
|
|
1536
|
-
import { Construct as
|
|
1673
|
+
import { Runtime as Runtime7 } from "aws-cdk-lib/aws-lambda";
|
|
1674
|
+
import { NodejsFunction as NodejsFunction7 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
1675
|
+
import { Construct as Construct10 } from "constructs";
|
|
1537
1676
|
var HANDLER_NAME6 = "platform-deploy-bridge.handler.js";
|
|
1538
1677
|
function resolveHandlerEntry6(dirname) {
|
|
1539
|
-
const sameDir =
|
|
1540
|
-
if (
|
|
1678
|
+
const sameDir = path7.join(dirname, HANDLER_NAME6);
|
|
1679
|
+
if (fs7.existsSync(sameDir)) {
|
|
1541
1680
|
return sameDir;
|
|
1542
1681
|
}
|
|
1543
|
-
return
|
|
1682
|
+
return path7.join(dirname, "..", "..", "..", "..", "lib", HANDLER_NAME6);
|
|
1544
1683
|
}
|
|
1545
|
-
var PlatformDeployBridgeLambda = class extends
|
|
1684
|
+
var PlatformDeployBridgeLambda = class extends Construct10 {
|
|
1546
1685
|
constructor(scope, props) {
|
|
1547
1686
|
super(scope, "platform-deploy-bridge-lambda");
|
|
1548
1687
|
const service = OpenHiService.of(this);
|
|
@@ -1555,9 +1694,9 @@ var PlatformDeployBridgeLambda = class extends Construct9 {
|
|
|
1555
1694
|
const ownSuffix = `-${service.serviceId}-${Stack3.of(this).account}-${Stack3.of(this).region}`;
|
|
1556
1695
|
const sharedPrefix = ownStackName.endsWith(ownSuffix) ? ownStackName.slice(0, -ownSuffix.length) : service.branchHash;
|
|
1557
1696
|
const stackIdPrefix = `arn:aws:cloudformation:${Stack3.of(this).region}:${Stack3.of(this).account}:stack/${sharedPrefix}-`;
|
|
1558
|
-
this.lambda = new
|
|
1697
|
+
this.lambda = new NodejsFunction7(this, "handler", {
|
|
1559
1698
|
entry: resolveHandlerEntry6(__dirname),
|
|
1560
|
-
runtime:
|
|
1699
|
+
runtime: Runtime7.NODEJS_LATEST,
|
|
1561
1700
|
memorySize: 256,
|
|
1562
1701
|
timeout: Duration5.seconds(30),
|
|
1563
1702
|
environment: {
|
|
@@ -1598,7 +1737,7 @@ var PlatformDeployBridgeLambda = class extends Construct9 {
|
|
|
1598
1737
|
};
|
|
1599
1738
|
|
|
1600
1739
|
// src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge.ts
|
|
1601
|
-
var PlatformDeployBridge = class extends
|
|
1740
|
+
var PlatformDeployBridge = class extends Construct11 {
|
|
1602
1741
|
constructor(scope, props) {
|
|
1603
1742
|
super(scope, "platform-deploy-bridge");
|
|
1604
1743
|
this.bridgeLambda = new PlatformDeployBridgeLambda(this, {
|
|
@@ -1791,29 +1930,29 @@ _OpenHiGlobalService.SERVICE_TYPE = "global";
|
|
|
1791
1930
|
var OpenHiGlobalService = _OpenHiGlobalService;
|
|
1792
1931
|
|
|
1793
1932
|
// src/workflows/control-plane/seed-demo-data/seed-demo-data-lambda.ts
|
|
1794
|
-
import
|
|
1795
|
-
import
|
|
1933
|
+
import fs8 from "fs";
|
|
1934
|
+
import path8 from "path";
|
|
1796
1935
|
import { Duration as Duration6, Stack as Stack4 } from "aws-cdk-lib";
|
|
1797
1936
|
import { Rule as Rule2 } from "aws-cdk-lib/aws-events";
|
|
1798
1937
|
import { LambdaFunction as LambdaFunction2 } from "aws-cdk-lib/aws-events-targets";
|
|
1799
1938
|
import { Effect as Effect3, PolicyStatement as PolicyStatement3 } from "aws-cdk-lib/aws-iam";
|
|
1800
|
-
import { Runtime as
|
|
1801
|
-
import { NodejsFunction as
|
|
1802
|
-
import { Construct as
|
|
1939
|
+
import { Runtime as Runtime8 } from "aws-cdk-lib/aws-lambda";
|
|
1940
|
+
import { NodejsFunction as NodejsFunction8 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
1941
|
+
import { Construct as Construct12 } from "constructs";
|
|
1803
1942
|
var HANDLER_NAME7 = "seed-demo-data.handler.js";
|
|
1804
1943
|
function resolveHandlerEntry7(dirname) {
|
|
1805
|
-
const sameDir =
|
|
1806
|
-
if (
|
|
1944
|
+
const sameDir = path8.join(dirname, HANDLER_NAME7);
|
|
1945
|
+
if (fs8.existsSync(sameDir)) {
|
|
1807
1946
|
return sameDir;
|
|
1808
1947
|
}
|
|
1809
|
-
return
|
|
1948
|
+
return path8.join(dirname, "..", "..", "..", "..", "lib", HANDLER_NAME7);
|
|
1810
1949
|
}
|
|
1811
|
-
var SeedDemoDataLambda = class extends
|
|
1950
|
+
var SeedDemoDataLambda = class extends Construct12 {
|
|
1812
1951
|
constructor(scope, props) {
|
|
1813
1952
|
super(scope, "seed-demo-data-lambda");
|
|
1814
|
-
this.lambda = new
|
|
1953
|
+
this.lambda = new NodejsFunction8(this, "handler", {
|
|
1815
1954
|
entry: resolveHandlerEntry7(__dirname),
|
|
1816
|
-
runtime:
|
|
1955
|
+
runtime: Runtime8.NODEJS_LATEST,
|
|
1817
1956
|
memorySize: 512,
|
|
1818
1957
|
timeout: Duration6.minutes(2),
|
|
1819
1958
|
environment: {
|
|
@@ -1869,8 +2008,8 @@ var SeedDemoDataLambda = class extends Construct11 {
|
|
|
1869
2008
|
};
|
|
1870
2009
|
|
|
1871
2010
|
// src/workflows/control-plane/seed-demo-data/seed-demo-data-workflow.ts
|
|
1872
|
-
import { Construct as
|
|
1873
|
-
var SeedDemoDataWorkflow = class extends
|
|
2011
|
+
import { Construct as Construct13 } from "constructs";
|
|
2012
|
+
var SeedDemoDataWorkflow = class extends Construct13 {
|
|
1874
2013
|
constructor(scope, props) {
|
|
1875
2014
|
super(scope, "seed-demo-data-workflow");
|
|
1876
2015
|
this.seedDemoData = new SeedDemoDataLambda(this, {
|
|
@@ -1887,30 +2026,30 @@ var SeedDemoDataWorkflow = class extends Construct12 {
|
|
|
1887
2026
|
};
|
|
1888
2027
|
|
|
1889
2028
|
// src/workflows/control-plane/seed-system-data/seed-system-data-lambda.ts
|
|
1890
|
-
import
|
|
1891
|
-
import
|
|
2029
|
+
import fs9 from "fs";
|
|
2030
|
+
import path9 from "path";
|
|
1892
2031
|
import { PLATFORM_ROLE_IDS } from "@openhi/types";
|
|
1893
2032
|
import { Duration as Duration7, Stack as Stack5 } from "aws-cdk-lib";
|
|
1894
2033
|
import { Rule as Rule3 } from "aws-cdk-lib/aws-events";
|
|
1895
2034
|
import { LambdaFunction as LambdaFunction3 } from "aws-cdk-lib/aws-events-targets";
|
|
1896
2035
|
import { Effect as Effect4, PolicyStatement as PolicyStatement4 } from "aws-cdk-lib/aws-iam";
|
|
1897
|
-
import { Runtime as
|
|
1898
|
-
import { NodejsFunction as
|
|
1899
|
-
import { Construct as
|
|
2036
|
+
import { Runtime as Runtime9 } from "aws-cdk-lib/aws-lambda";
|
|
2037
|
+
import { NodejsFunction as NodejsFunction9 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
2038
|
+
import { Construct as Construct14 } from "constructs";
|
|
1900
2039
|
var HANDLER_NAME8 = "seed-system-data.handler.js";
|
|
1901
2040
|
function resolveHandlerEntry8(dirname) {
|
|
1902
|
-
const sameDir =
|
|
1903
|
-
if (
|
|
2041
|
+
const sameDir = path9.join(dirname, HANDLER_NAME8);
|
|
2042
|
+
if (fs9.existsSync(sameDir)) {
|
|
1904
2043
|
return sameDir;
|
|
1905
2044
|
}
|
|
1906
|
-
return
|
|
2045
|
+
return path9.join(dirname, "..", "..", "..", "..", "lib", HANDLER_NAME8);
|
|
1907
2046
|
}
|
|
1908
|
-
var SeedSystemDataLambda = class extends
|
|
2047
|
+
var SeedSystemDataLambda = class extends Construct14 {
|
|
1909
2048
|
constructor(scope, props) {
|
|
1910
2049
|
super(scope, "seed-system-data-lambda");
|
|
1911
|
-
this.lambda = new
|
|
2050
|
+
this.lambda = new NodejsFunction9(this, "handler", {
|
|
1912
2051
|
entry: resolveHandlerEntry8(__dirname),
|
|
1913
|
-
runtime:
|
|
2052
|
+
runtime: Runtime9.NODEJS_LATEST,
|
|
1914
2053
|
memorySize: 512,
|
|
1915
2054
|
timeout: Duration7.minutes(1),
|
|
1916
2055
|
environment: {
|
|
@@ -1957,8 +2096,8 @@ var SeedSystemDataLambda = class extends Construct13 {
|
|
|
1957
2096
|
};
|
|
1958
2097
|
|
|
1959
2098
|
// src/workflows/control-plane/seed-system-data/seed-system-data-workflow.ts
|
|
1960
|
-
import { Construct as
|
|
1961
|
-
var SeedSystemDataWorkflow = class extends
|
|
2099
|
+
import { Construct as Construct15 } from "constructs";
|
|
2100
|
+
var SeedSystemDataWorkflow = class extends Construct15 {
|
|
1962
2101
|
constructor(scope, props) {
|
|
1963
2102
|
super(scope, "seed-system-data-workflow");
|
|
1964
2103
|
this.seedSystemData = new SeedSystemDataLambda(this, {
|
|
@@ -2084,29 +2223,29 @@ _OpenHiDataService.SERVICE_TYPE = "data";
|
|
|
2084
2223
|
var OpenHiDataService = _OpenHiDataService;
|
|
2085
2224
|
|
|
2086
2225
|
// src/workflows/control-plane/user-onboarding/provision-default-workspace-lambda.ts
|
|
2087
|
-
import
|
|
2088
|
-
import
|
|
2226
|
+
import fs10 from "fs";
|
|
2227
|
+
import path10 from "path";
|
|
2089
2228
|
import { Duration as Duration8 } from "aws-cdk-lib";
|
|
2090
2229
|
import { Rule as Rule4 } from "aws-cdk-lib/aws-events";
|
|
2091
2230
|
import { LambdaFunction as LambdaFunction4 } from "aws-cdk-lib/aws-events-targets";
|
|
2092
2231
|
import { Effect as Effect5, PolicyStatement as PolicyStatement5 } from "aws-cdk-lib/aws-iam";
|
|
2093
|
-
import { Runtime as
|
|
2094
|
-
import { NodejsFunction as
|
|
2095
|
-
import { Construct as
|
|
2232
|
+
import { Runtime as Runtime10 } from "aws-cdk-lib/aws-lambda";
|
|
2233
|
+
import { NodejsFunction as NodejsFunction10 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
2234
|
+
import { Construct as Construct16 } from "constructs";
|
|
2096
2235
|
var HANDLER_NAME9 = "provision-default-workspace.handler.js";
|
|
2097
2236
|
function resolveHandlerEntry9(dirname) {
|
|
2098
|
-
const sameDir =
|
|
2099
|
-
if (
|
|
2237
|
+
const sameDir = path10.join(dirname, HANDLER_NAME9);
|
|
2238
|
+
if (fs10.existsSync(sameDir)) {
|
|
2100
2239
|
return sameDir;
|
|
2101
2240
|
}
|
|
2102
|
-
return
|
|
2241
|
+
return path10.join(dirname, "..", "..", "..", "..", "lib", HANDLER_NAME9);
|
|
2103
2242
|
}
|
|
2104
|
-
var ProvisionDefaultWorkspaceLambda = class extends
|
|
2243
|
+
var ProvisionDefaultWorkspaceLambda = class extends Construct16 {
|
|
2105
2244
|
constructor(scope, props) {
|
|
2106
2245
|
super(scope, "provision-default-workspace-lambda");
|
|
2107
|
-
this.lambda = new
|
|
2246
|
+
this.lambda = new NodejsFunction10(this, "handler", {
|
|
2108
2247
|
entry: resolveHandlerEntry9(__dirname),
|
|
2109
|
-
runtime:
|
|
2248
|
+
runtime: Runtime10.NODEJS_LATEST,
|
|
2110
2249
|
memorySize: 1024,
|
|
2111
2250
|
environment: {
|
|
2112
2251
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
@@ -2141,8 +2280,8 @@ var ProvisionDefaultWorkspaceLambda = class extends Construct15 {
|
|
|
2141
2280
|
};
|
|
2142
2281
|
|
|
2143
2282
|
// src/workflows/control-plane/user-onboarding/user-onboarding-workflow.ts
|
|
2144
|
-
import { Construct as
|
|
2145
|
-
var UserOnboardingWorkflow = class extends
|
|
2283
|
+
import { Construct as Construct17 } from "constructs";
|
|
2284
|
+
var UserOnboardingWorkflow = class extends Construct17 {
|
|
2146
2285
|
constructor(scope, props) {
|
|
2147
2286
|
super(scope, "user-onboarding-workflow");
|
|
2148
2287
|
this.provisionDefaultWorkspace = new ProvisionDefaultWorkspaceLambda(this, {
|
|
@@ -2429,60 +2568,60 @@ import { HttpUserPoolAuthorizer } from "aws-cdk-lib/aws-apigatewayv2-authorizers
|
|
|
2429
2568
|
import { HttpLambdaIntegration } from "aws-cdk-lib/aws-apigatewayv2-integrations";
|
|
2430
2569
|
import { Effect as Effect7, PolicyStatement as PolicyStatement7 } from "aws-cdk-lib/aws-iam";
|
|
2431
2570
|
import {
|
|
2432
|
-
ARecord,
|
|
2571
|
+
ARecord as ARecord2,
|
|
2433
2572
|
HostedZone as HostedZone3,
|
|
2434
|
-
RecordTarget
|
|
2573
|
+
RecordTarget as RecordTarget2
|
|
2435
2574
|
} from "aws-cdk-lib/aws-route53";
|
|
2436
2575
|
import { ApiGatewayv2DomainProperties } from "aws-cdk-lib/aws-route53-targets";
|
|
2437
2576
|
import { Duration as Duration9 } from "aws-cdk-lib/core";
|
|
2438
2577
|
|
|
2439
2578
|
// src/data/lambda/cors-options-lambda.ts
|
|
2440
|
-
import
|
|
2441
|
-
import
|
|
2442
|
-
import { Runtime as
|
|
2443
|
-
import { NodejsFunction as
|
|
2444
|
-
import { Construct as
|
|
2579
|
+
import fs11 from "fs";
|
|
2580
|
+
import path11 from "path";
|
|
2581
|
+
import { Runtime as Runtime11 } from "aws-cdk-lib/aws-lambda";
|
|
2582
|
+
import { NodejsFunction as NodejsFunction11 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
2583
|
+
import { Construct as Construct18 } from "constructs";
|
|
2445
2584
|
var HANDLER_NAME10 = "cors-options-lambda.handler.js";
|
|
2446
2585
|
function resolveHandlerEntry10(dirname) {
|
|
2447
|
-
const sameDir =
|
|
2448
|
-
if (
|
|
2586
|
+
const sameDir = path11.join(dirname, HANDLER_NAME10);
|
|
2587
|
+
if (fs11.existsSync(sameDir)) {
|
|
2449
2588
|
return sameDir;
|
|
2450
2589
|
}
|
|
2451
|
-
const fromLib =
|
|
2590
|
+
const fromLib = path11.join(dirname, "..", "..", "..", "lib", HANDLER_NAME10);
|
|
2452
2591
|
return fromLib;
|
|
2453
2592
|
}
|
|
2454
|
-
var CorsOptionsLambda = class extends
|
|
2593
|
+
var CorsOptionsLambda = class extends Construct18 {
|
|
2455
2594
|
constructor(scope, id = "cors-options-lambda") {
|
|
2456
2595
|
super(scope, id);
|
|
2457
|
-
this.lambda = new
|
|
2596
|
+
this.lambda = new NodejsFunction11(this, "handler", {
|
|
2458
2597
|
entry: resolveHandlerEntry10(__dirname),
|
|
2459
|
-
runtime:
|
|
2598
|
+
runtime: Runtime11.NODEJS_LATEST,
|
|
2460
2599
|
memorySize: 128
|
|
2461
2600
|
});
|
|
2462
2601
|
}
|
|
2463
2602
|
};
|
|
2464
2603
|
|
|
2465
2604
|
// src/data/lambda/rest-api-lambda.ts
|
|
2466
|
-
import
|
|
2467
|
-
import
|
|
2468
|
-
import { Runtime as
|
|
2469
|
-
import { NodejsFunction as
|
|
2470
|
-
import { Construct as
|
|
2605
|
+
import fs12 from "fs";
|
|
2606
|
+
import path12 from "path";
|
|
2607
|
+
import { Runtime as Runtime12 } from "aws-cdk-lib/aws-lambda";
|
|
2608
|
+
import { NodejsFunction as NodejsFunction12 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
2609
|
+
import { Construct as Construct19 } from "constructs";
|
|
2471
2610
|
var HANDLER_NAME11 = "rest-api-lambda.handler.js";
|
|
2472
2611
|
function resolveHandlerEntry11(dirname) {
|
|
2473
|
-
const sameDir =
|
|
2474
|
-
if (
|
|
2612
|
+
const sameDir = path12.join(dirname, HANDLER_NAME11);
|
|
2613
|
+
if (fs12.existsSync(sameDir)) {
|
|
2475
2614
|
return sameDir;
|
|
2476
2615
|
}
|
|
2477
|
-
const fromLib =
|
|
2616
|
+
const fromLib = path12.join(dirname, "..", "..", "..", "lib", HANDLER_NAME11);
|
|
2478
2617
|
return fromLib;
|
|
2479
2618
|
}
|
|
2480
|
-
var RestApiLambda = class extends
|
|
2619
|
+
var RestApiLambda = class extends Construct19 {
|
|
2481
2620
|
constructor(scope, props) {
|
|
2482
2621
|
super(scope, "rest-api-lambda");
|
|
2483
|
-
this.lambda = new
|
|
2622
|
+
this.lambda = new NodejsFunction12(this, "handler", {
|
|
2484
2623
|
entry: resolveHandlerEntry11(__dirname),
|
|
2485
|
-
runtime:
|
|
2624
|
+
runtime: Runtime12.NODEJS_LATEST,
|
|
2486
2625
|
memorySize: 1024,
|
|
2487
2626
|
environment: {
|
|
2488
2627
|
DYNAMO_TABLE_NAME: props.dynamoTableName,
|
|
@@ -2700,10 +2839,10 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
|
|
|
2700
2839
|
integration
|
|
2701
2840
|
});
|
|
2702
2841
|
const apiPrefix = this.branchName === "main" ? `api` : `api-${this.childZonePrefix}`;
|
|
2703
|
-
new
|
|
2842
|
+
new ARecord2(this, "api-a-record", {
|
|
2704
2843
|
zone: hostedZone,
|
|
2705
2844
|
recordName: apiPrefix,
|
|
2706
|
-
target:
|
|
2845
|
+
target: RecordTarget2.fromAlias(
|
|
2707
2846
|
new ApiGatewayv2DomainProperties(
|
|
2708
2847
|
domainName.regionalDomainName,
|
|
2709
2848
|
domainName.regionalHostedZoneId
|
|
@@ -2806,32 +2945,184 @@ var _OpenHiGraphqlService = class _OpenHiGraphqlService extends OpenHiService {
|
|
|
2806
2945
|
_OpenHiGraphqlService.SERVICE_TYPE = "graphql-api";
|
|
2807
2946
|
var OpenHiGraphqlService = _OpenHiGraphqlService;
|
|
2808
2947
|
|
|
2948
|
+
// src/services/open-hi-website-service.ts
|
|
2949
|
+
var SSM_PARAM_NAME_FULL_DOMAIN = "WEBSITE_FULL_DOMAIN";
|
|
2950
|
+
var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
|
|
2951
|
+
/**
|
|
2952
|
+
* Looks up the static-hosting bucket ARN published by the release-branch
|
|
2953
|
+
* deploy of this service.
|
|
2954
|
+
*/
|
|
2955
|
+
static bucketArnFromConstruct(scope) {
|
|
2956
|
+
return DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2957
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_BUCKET_ARN,
|
|
2958
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
2959
|
+
});
|
|
2960
|
+
}
|
|
2961
|
+
/**
|
|
2962
|
+
* Looks up the CloudFront distribution ARN published by the release-branch
|
|
2963
|
+
* deploy of this service.
|
|
2964
|
+
*/
|
|
2965
|
+
static distributionArnFromConstruct(scope) {
|
|
2966
|
+
return DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2967
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ARN,
|
|
2968
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
/**
|
|
2972
|
+
* Looks up the CloudFront distribution domain
|
|
2973
|
+
* (e.g. dXXXXX.cloudfront.net) published by the release-branch deploy.
|
|
2974
|
+
*/
|
|
2975
|
+
static distributionDomainFromConstruct(scope) {
|
|
2976
|
+
return DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2977
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_DOMAIN,
|
|
2978
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
/**
|
|
2982
|
+
* Looks up the CloudFront distribution ID published by the release-branch
|
|
2983
|
+
* deploy of this service.
|
|
2984
|
+
*/
|
|
2985
|
+
static distributionIdFromConstruct(scope) {
|
|
2986
|
+
return DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2987
|
+
ssmParamName: StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ID,
|
|
2988
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
2989
|
+
});
|
|
2990
|
+
}
|
|
2991
|
+
/**
|
|
2992
|
+
* Looks up the website's full domain (e.g. www.example.com) published by
|
|
2993
|
+
* the release-branch deploy of this service.
|
|
2994
|
+
*/
|
|
2995
|
+
static fullDomainFromConstruct(scope) {
|
|
2996
|
+
return DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2997
|
+
ssmParamName: SSM_PARAM_NAME_FULL_DOMAIN,
|
|
2998
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
2999
|
+
});
|
|
3000
|
+
}
|
|
3001
|
+
get serviceType() {
|
|
3002
|
+
return _OpenHiWebsiteService.SERVICE_TYPE;
|
|
3003
|
+
}
|
|
3004
|
+
constructor(ohEnv, props) {
|
|
3005
|
+
super(ohEnv, _OpenHiWebsiteService.SERVICE_TYPE, props);
|
|
3006
|
+
this.props = props;
|
|
3007
|
+
this.validateConfig(props);
|
|
3008
|
+
const hostedZone = this.createHostedZone();
|
|
3009
|
+
this.fullDomain = this.computeFullDomain(hostedZone);
|
|
3010
|
+
const shouldCreateHostingInfra = props.createHostingInfrastructure ?? this.branchName === this.defaultReleaseBranch;
|
|
3011
|
+
if (shouldCreateHostingInfra) {
|
|
3012
|
+
const certificate = this.createCertificate();
|
|
3013
|
+
this.staticHosting = this.createStaticHosting({
|
|
3014
|
+
certificate,
|
|
3015
|
+
hostedZone
|
|
3016
|
+
});
|
|
3017
|
+
this.createFullDomainParameter();
|
|
3018
|
+
}
|
|
3019
|
+
this.staticContent = this.createStaticContent();
|
|
3020
|
+
}
|
|
3021
|
+
/**
|
|
3022
|
+
* Validates that config required for the website stack is present.
|
|
3023
|
+
*/
|
|
3024
|
+
validateConfig(props) {
|
|
3025
|
+
const { config } = props;
|
|
3026
|
+
if (!config) {
|
|
3027
|
+
throw new Error("Config is required");
|
|
3028
|
+
}
|
|
3029
|
+
if (!config.zoneName) {
|
|
3030
|
+
throw new Error("Zone name is required");
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
/**
|
|
3034
|
+
* Looks up the child hosted zone published by the Global service.
|
|
3035
|
+
* Override to customize.
|
|
3036
|
+
*/
|
|
3037
|
+
createHostedZone() {
|
|
3038
|
+
return OpenHiGlobalService.childHostedZoneFromConstruct(this, {
|
|
3039
|
+
zoneName: this.config.zoneName
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
/**
|
|
3043
|
+
* Returns the wildcard certificate looked up from the Global service.
|
|
3044
|
+
* Override to customize.
|
|
3045
|
+
*/
|
|
3046
|
+
createCertificate() {
|
|
3047
|
+
return OpenHiGlobalService.rootWildcardCertificateFromConstruct(this);
|
|
3048
|
+
}
|
|
3049
|
+
/**
|
|
3050
|
+
* Computes the full website domain from `domainPrefix` and the child
|
|
3051
|
+
* zone name.
|
|
3052
|
+
*/
|
|
3053
|
+
computeFullDomain(hostedZone) {
|
|
3054
|
+
const prefix = this.props.domainPrefix ?? "www";
|
|
3055
|
+
return [prefix, hostedZone.zoneName].join(".");
|
|
3056
|
+
}
|
|
3057
|
+
/**
|
|
3058
|
+
* Creates the StaticHosting infrastructure (bucket + distribution +
|
|
3059
|
+
* Lambda@Edge + 4 SSM params + DNS).
|
|
3060
|
+
*/
|
|
3061
|
+
createStaticHosting(deps) {
|
|
3062
|
+
return new StaticHosting(this, "static-hosting", {
|
|
3063
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE,
|
|
3064
|
+
certificate: deps.certificate,
|
|
3065
|
+
hostedZone: deps.hostedZone,
|
|
3066
|
+
domainNames: [this.fullDomain],
|
|
3067
|
+
description: `OpenHI website (${this.fullDomain})`
|
|
3068
|
+
});
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Creates the SSM parameter that publishes the website's full domain.
|
|
3072
|
+
* Look up via {@link OpenHiWebsiteService.fullDomainFromConstruct}.
|
|
3073
|
+
*/
|
|
3074
|
+
createFullDomainParameter() {
|
|
3075
|
+
new DiscoverableStringParameter(this, "full-domain-param", {
|
|
3076
|
+
ssmParamName: SSM_PARAM_NAME_FULL_DOMAIN,
|
|
3077
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE,
|
|
3078
|
+
stringValue: this.fullDomain,
|
|
3079
|
+
description: "Full website domain (e.g. www.example.com)"
|
|
3080
|
+
});
|
|
3081
|
+
}
|
|
3082
|
+
/**
|
|
3083
|
+
* Creates the StaticContent uploader. Always created so feature-branch
|
|
3084
|
+
* deploys can publish content to their own sub-domain folder against the
|
|
3085
|
+
* release-branch bucket.
|
|
3086
|
+
*/
|
|
3087
|
+
createStaticContent() {
|
|
3088
|
+
const { contentSourceDirectory, contentDestinationDirectory } = this.props;
|
|
3089
|
+
return new StaticContent(this, "static-content", {
|
|
3090
|
+
contentSourceDirectory,
|
|
3091
|
+
contentDestinationDirectory,
|
|
3092
|
+
fullDomain: this.fullDomain,
|
|
3093
|
+
serviceType: _OpenHiWebsiteService.SERVICE_TYPE
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
};
|
|
3097
|
+
_OpenHiWebsiteService.SERVICE_TYPE = "website";
|
|
3098
|
+
var OpenHiWebsiteService = _OpenHiWebsiteService;
|
|
3099
|
+
|
|
2809
3100
|
// src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-lambdas.ts
|
|
2810
|
-
import
|
|
2811
|
-
import
|
|
3101
|
+
import fs13 from "fs";
|
|
3102
|
+
import path13 from "path";
|
|
2812
3103
|
import { Duration as Duration10 } from "aws-cdk-lib";
|
|
2813
3104
|
import { Effect as Effect8, PolicyStatement as PolicyStatement8 } from "aws-cdk-lib/aws-iam";
|
|
2814
|
-
import { Runtime as
|
|
2815
|
-
import { NodejsFunction as
|
|
2816
|
-
import { Construct as
|
|
3105
|
+
import { Runtime as Runtime13 } from "aws-cdk-lib/aws-lambda";
|
|
3106
|
+
import { NodejsFunction as NodejsFunction13 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
3107
|
+
import { Construct as Construct20 } from "constructs";
|
|
2817
3108
|
function resolveHandlerEntry12(dirname, handlerName) {
|
|
2818
|
-
const sameDir =
|
|
2819
|
-
if (
|
|
3109
|
+
const sameDir = path13.join(dirname, handlerName);
|
|
3110
|
+
if (fs13.existsSync(sameDir)) {
|
|
2820
3111
|
return { entry: sameDir, handler: "handler" };
|
|
2821
3112
|
}
|
|
2822
|
-
const libDir =
|
|
3113
|
+
const libDir = path13.join(dirname, "..", "..", "..", "..", "lib", handlerName);
|
|
2823
3114
|
return { entry: libDir, handler: "handler" };
|
|
2824
3115
|
}
|
|
2825
|
-
var OwningDeleteCascadeLambdas = class extends
|
|
3116
|
+
var OwningDeleteCascadeLambdas = class extends Construct20 {
|
|
2826
3117
|
constructor(scope, props) {
|
|
2827
3118
|
super(scope, "owning-delete-cascade-lambdas");
|
|
2828
3119
|
const listResolved = resolveHandlerEntry12(
|
|
2829
3120
|
__dirname,
|
|
2830
3121
|
"list-chunks.handler.js"
|
|
2831
3122
|
);
|
|
2832
|
-
this.listChunks = new
|
|
3123
|
+
this.listChunks = new NodejsFunction13(this, "list-chunks-handler", {
|
|
2833
3124
|
entry: listResolved.entry,
|
|
2834
|
-
runtime:
|
|
3125
|
+
runtime: Runtime13.NODEJS_LATEST,
|
|
2835
3126
|
memorySize: 512,
|
|
2836
3127
|
timeout: Duration10.minutes(1),
|
|
2837
3128
|
environment: {
|
|
@@ -2843,9 +3134,9 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
2843
3134
|
__dirname,
|
|
2844
3135
|
"delete-chunk.handler.js"
|
|
2845
3136
|
);
|
|
2846
|
-
this.deleteChunk = new
|
|
3137
|
+
this.deleteChunk = new NodejsFunction13(this, "delete-chunk-handler", {
|
|
2847
3138
|
entry: deleteResolved.entry,
|
|
2848
|
-
runtime:
|
|
3139
|
+
runtime: Runtime13.NODEJS_LATEST,
|
|
2849
3140
|
memorySize: 512,
|
|
2850
3141
|
timeout: Duration10.minutes(1),
|
|
2851
3142
|
environment: {
|
|
@@ -2862,9 +3153,9 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
2862
3153
|
__dirname,
|
|
2863
3154
|
"finalize.handler.js"
|
|
2864
3155
|
);
|
|
2865
|
-
this.finalize = new
|
|
3156
|
+
this.finalize = new NodejsFunction13(this, "finalize-handler", {
|
|
2866
3157
|
entry: finalizeResolved.entry,
|
|
2867
|
-
runtime:
|
|
3158
|
+
runtime: Runtime13.NODEJS_LATEST,
|
|
2868
3159
|
memorySize: 512,
|
|
2869
3160
|
timeout: Duration10.minutes(1),
|
|
2870
3161
|
environment: {
|
|
@@ -2900,8 +3191,8 @@ import {
|
|
|
2900
3191
|
WaitTime
|
|
2901
3192
|
} from "aws-cdk-lib/aws-stepfunctions";
|
|
2902
3193
|
import { LambdaInvoke } from "aws-cdk-lib/aws-stepfunctions-tasks";
|
|
2903
|
-
import { Construct as
|
|
2904
|
-
var OwningDeleteCascadeWorkflow = class extends
|
|
3194
|
+
import { Construct as Construct21 } from "constructs";
|
|
3195
|
+
var OwningDeleteCascadeWorkflow = class extends Construct21 {
|
|
2905
3196
|
constructor(scope, props) {
|
|
2906
3197
|
super(scope, "owning-delete-cascade-workflow");
|
|
2907
3198
|
this.lambdas = new OwningDeleteCascadeLambdas(this, {
|
|
@@ -3060,31 +3351,31 @@ var OwningDeleteCascadeWorkflow = class extends Construct20 {
|
|
|
3060
3351
|
};
|
|
3061
3352
|
|
|
3062
3353
|
// src/workflows/control-plane/rename-cascade/rename-cascade-lambdas.ts
|
|
3063
|
-
import
|
|
3064
|
-
import
|
|
3354
|
+
import fs14 from "fs";
|
|
3355
|
+
import path14 from "path";
|
|
3065
3356
|
import { Duration as Duration12 } from "aws-cdk-lib";
|
|
3066
3357
|
import { Effect as Effect9, PolicyStatement as PolicyStatement9 } from "aws-cdk-lib/aws-iam";
|
|
3067
|
-
import { Runtime as
|
|
3068
|
-
import { NodejsFunction as
|
|
3069
|
-
import { Construct as
|
|
3358
|
+
import { Runtime as Runtime14 } from "aws-cdk-lib/aws-lambda";
|
|
3359
|
+
import { NodejsFunction as NodejsFunction14 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
3360
|
+
import { Construct as Construct22 } from "constructs";
|
|
3070
3361
|
function resolveHandlerEntry13(dirname, handlerName) {
|
|
3071
|
-
const sameDir =
|
|
3072
|
-
if (
|
|
3362
|
+
const sameDir = path14.join(dirname, handlerName);
|
|
3363
|
+
if (fs14.existsSync(sameDir)) {
|
|
3073
3364
|
return { entry: sameDir, handler: "handler" };
|
|
3074
3365
|
}
|
|
3075
|
-
const libDir =
|
|
3366
|
+
const libDir = path14.join(dirname, "..", "..", "..", "..", "lib", handlerName);
|
|
3076
3367
|
return { entry: libDir, handler: "handler" };
|
|
3077
3368
|
}
|
|
3078
|
-
var RenameCascadeLambdas = class extends
|
|
3369
|
+
var RenameCascadeLambdas = class extends Construct22 {
|
|
3079
3370
|
constructor(scope, props) {
|
|
3080
3371
|
super(scope, "rename-cascade-lambdas");
|
|
3081
3372
|
const listResolved = resolveHandlerEntry13(
|
|
3082
3373
|
__dirname,
|
|
3083
3374
|
"rename-list-targets.handler.js"
|
|
3084
3375
|
);
|
|
3085
|
-
this.listTargets = new
|
|
3376
|
+
this.listTargets = new NodejsFunction14(this, "list-targets-handler", {
|
|
3086
3377
|
entry: listResolved.entry,
|
|
3087
|
-
runtime:
|
|
3378
|
+
runtime: Runtime14.NODEJS_LATEST,
|
|
3088
3379
|
memorySize: 512,
|
|
3089
3380
|
timeout: Duration12.minutes(1),
|
|
3090
3381
|
environment: {
|
|
@@ -3096,9 +3387,9 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3096
3387
|
__dirname,
|
|
3097
3388
|
"rename-rewrite-chunk.handler.js"
|
|
3098
3389
|
);
|
|
3099
|
-
this.rewriteChunk = new
|
|
3390
|
+
this.rewriteChunk = new NodejsFunction14(this, "rewrite-chunk-handler", {
|
|
3100
3391
|
entry: rewriteResolved.entry,
|
|
3101
|
-
runtime:
|
|
3392
|
+
runtime: Runtime14.NODEJS_LATEST,
|
|
3102
3393
|
memorySize: 512,
|
|
3103
3394
|
timeout: Duration12.minutes(1),
|
|
3104
3395
|
environment: {
|
|
@@ -3115,9 +3406,9 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3115
3406
|
__dirname,
|
|
3116
3407
|
"rename-finalize.handler.js"
|
|
3117
3408
|
);
|
|
3118
|
-
this.finalize = new
|
|
3409
|
+
this.finalize = new NodejsFunction14(this, "finalize-handler", {
|
|
3119
3410
|
entry: finalizeResolved.entry,
|
|
3120
|
-
runtime:
|
|
3411
|
+
runtime: Runtime14.NODEJS_LATEST,
|
|
3121
3412
|
memorySize: 512,
|
|
3122
3413
|
timeout: Duration12.minutes(1),
|
|
3123
3414
|
environment: {
|
|
@@ -3149,8 +3440,8 @@ import {
|
|
|
3149
3440
|
TaskInput as TaskInput2
|
|
3150
3441
|
} from "aws-cdk-lib/aws-stepfunctions";
|
|
3151
3442
|
import { LambdaInvoke as LambdaInvoke2 } from "aws-cdk-lib/aws-stepfunctions-tasks";
|
|
3152
|
-
import { Construct as
|
|
3153
|
-
var RenameCascadeWorkflow = class extends
|
|
3443
|
+
import { Construct as Construct23 } from "constructs";
|
|
3444
|
+
var RenameCascadeWorkflow = class extends Construct23 {
|
|
3154
3445
|
constructor(scope, props) {
|
|
3155
3446
|
super(scope, "rename-cascade-workflow");
|
|
3156
3447
|
this.lambdas = new RenameCascadeLambdas(this, {
|
|
@@ -3371,6 +3662,7 @@ export {
|
|
|
3371
3662
|
OpenHiRestApiService,
|
|
3372
3663
|
OpenHiService,
|
|
3373
3664
|
OpenHiStage,
|
|
3665
|
+
OpenHiWebsiteService,
|
|
3374
3666
|
OpsEventBus,
|
|
3375
3667
|
OwningDeleteCascadeLambdas,
|
|
3376
3668
|
OwningDeleteCascadeWorkflow,
|
|
@@ -3406,11 +3698,13 @@ export {
|
|
|
3406
3698
|
SEED_SYSTEM_DATA_ACTOR_SYSTEM,
|
|
3407
3699
|
SEED_SYSTEM_DATA_CONSUMER_NAME,
|
|
3408
3700
|
SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR,
|
|
3701
|
+
SSM_PARAM_NAME_FULL_DOMAIN,
|
|
3409
3702
|
STATIC_HOSTING_SERVICE_TYPE,
|
|
3410
3703
|
SeedDemoDataLambda,
|
|
3411
3704
|
SeedDemoDataWorkflow,
|
|
3412
3705
|
SeedSystemDataLambda,
|
|
3413
3706
|
SeedSystemDataWorkflow,
|
|
3707
|
+
StaticContent,
|
|
3414
3708
|
StaticHosting,
|
|
3415
3709
|
USER_ONBOARDING_EVENT_SOURCE,
|
|
3416
3710
|
UserOnboardingWorkflow,
|