@openhi/constructs 0.0.114 → 0.0.115
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/chunk-AHYQFT4N.mjs +212 -0
- package/lib/chunk-AHYQFT4N.mjs.map +1 -0
- package/lib/{chunk-CUUKXDB2.mjs → chunk-AJQUWHFK.mjs} +460 -54
- package/lib/chunk-AJQUWHFK.mjs.map +1 -0
- package/lib/{chunk-GBDIGTNV.mjs → chunk-QWWLM452.mjs} +2 -2
- package/lib/{chunk-QMBJ4VHC.mjs → chunk-U7L7T4XU.mjs} +25 -25
- package/lib/{chunk-QMBJ4VHC.mjs.map → chunk-U7L7T4XU.mjs.map} +1 -1
- package/lib/{chunk-NZRW7ROK.mjs → chunk-YYRWDEG4.mjs} +2 -2
- package/lib/{chunk-KSFC72TT.mjs → chunk-ZHMHLK3S.mjs} +2 -2
- package/lib/{events-DPodvl07.d.mts → events-CMG8xanm.d.mts} +7 -53
- package/lib/{events-DPodvl07.d.ts → events-CMG8xanm.d.ts} +7 -53
- package/lib/index.d.mts +64 -77
- package/lib/index.d.ts +70 -129
- package/lib/index.js +499 -241
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +58 -184
- package/lib/index.mjs.map +1 -1
- package/lib/pre-token-generation.handler.mjs +3 -3
- package/lib/provision-default-workspace.handler.mjs +3 -3
- package/lib/rest-api-lambda.handler.mjs +282 -452
- package/lib/rest-api-lambda.handler.mjs.map +1 -1
- package/lib/seed-demo-data.handler.d.mts +6 -3
- package/lib/seed-demo-data.handler.d.ts +6 -3
- package/lib/seed-demo-data.handler.js +656 -0
- package/lib/seed-demo-data.handler.js.map +1 -1
- package/lib/seed-demo-data.handler.mjs +4 -4
- package/package.json +1 -1
- package/lib/chunk-53OHXLIL.mjs +0 -27
- package/lib/chunk-53OHXLIL.mjs.map +0 -1
- package/lib/chunk-CUUKXDB2.mjs.map +0 -1
- /package/lib/{chunk-GBDIGTNV.mjs.map → chunk-QWWLM452.mjs.map} +0 -0
- /package/lib/{chunk-NZRW7ROK.mjs.map → chunk-YYRWDEG4.mjs.map} +0 -0
- /package/lib/{chunk-KSFC72TT.mjs.map → chunk-ZHMHLK3S.mjs.map} +0 -0
package/lib/index.mjs
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
import_workflows as import_workflows2
|
|
12
12
|
} from "./chunk-WPCBVDFZ.mjs";
|
|
13
13
|
import {
|
|
14
|
+
DEMO_DATA_PLANE_FIXTURES,
|
|
14
15
|
DEMO_PERIOD,
|
|
15
16
|
DEMO_TENANT_SPECS,
|
|
16
17
|
DEMO_URN_SYSTEM,
|
|
@@ -21,21 +22,13 @@ import {
|
|
|
21
22
|
PLATFORM_SCOPE_TENANT_ID,
|
|
22
23
|
SEED_DEMO_DATA_CONSUMER_NAME,
|
|
23
24
|
SEED_DEMO_DATA_USER_POOL_ID_ENV_VAR,
|
|
24
|
-
demoBasePartitionKeys,
|
|
25
|
-
demoDevUserPartitionKeys,
|
|
26
25
|
demoMembershipId,
|
|
27
|
-
demoMembershipPartitionKey,
|
|
28
26
|
demoRoleAssignmentId,
|
|
29
|
-
demoRoleAssignmentPartitionKey,
|
|
30
27
|
demoRolesForUserInTenant,
|
|
31
28
|
demoScenarioIdentifier,
|
|
32
|
-
demoTenantPartitionKey,
|
|
33
|
-
demoUserPartitionKey,
|
|
34
|
-
demoWorkspacePartitionKey,
|
|
35
29
|
import_workflows,
|
|
36
|
-
openhiResourceIdentifier
|
|
37
|
-
|
|
38
|
-
} from "./chunk-CUUKXDB2.mjs";
|
|
30
|
+
openhiResourceIdentifier
|
|
31
|
+
} from "./chunk-AJQUWHFK.mjs";
|
|
39
32
|
import {
|
|
40
33
|
OWNING_DELETE_CASCADE_CONSUMER_NAME,
|
|
41
34
|
OWNING_DELETE_CASCADE_DEFAULT_CONCURRENCY,
|
|
@@ -51,7 +44,7 @@ import {
|
|
|
51
44
|
RENAME_CASCADE_SLOW_THRESHOLD_SECONDS,
|
|
52
45
|
import_workflows as import_workflows4
|
|
53
46
|
} from "./chunk-23PUSHBV.mjs";
|
|
54
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-AHYQFT4N.mjs";
|
|
55
48
|
import {
|
|
56
49
|
PROVISION_DEFAULT_WORKSPACE_DETAIL_TYPE,
|
|
57
50
|
USER_ONBOARDING_EVENT_SOURCE,
|
|
@@ -69,10 +62,10 @@ import {
|
|
|
69
62
|
import {
|
|
70
63
|
require_lib
|
|
71
64
|
} from "./chunk-ZM4GDHHC.mjs";
|
|
72
|
-
import "./chunk-
|
|
65
|
+
import "./chunk-QWWLM452.mjs";
|
|
73
66
|
import "./chunk-HQ67J7BP.mjs";
|
|
74
67
|
import "./chunk-QJDHVMKT.mjs";
|
|
75
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-U7L7T4XU.mjs";
|
|
76
69
|
import "./chunk-FYHBHHWK.mjs";
|
|
77
70
|
import "./chunk-6NBGYGFL.mjs";
|
|
78
71
|
import "./chunk-TRY7JGWO.mjs";
|
|
@@ -620,46 +613,6 @@ var _RootGraphqlApi = class _RootGraphqlApi extends GraphqlApi {
|
|
|
620
613
|
_RootGraphqlApi.SSM_PARAM_NAME = "ROOT_GRAPHQL_API";
|
|
621
614
|
var RootGraphqlApi = _RootGraphqlApi;
|
|
622
615
|
|
|
623
|
-
// src/components/cognito/cognito-fixture-seeder-client.ts
|
|
624
|
-
import { Duration } from "aws-cdk-lib";
|
|
625
|
-
import {
|
|
626
|
-
UserPoolClient
|
|
627
|
-
} from "aws-cdk-lib/aws-cognito";
|
|
628
|
-
var CognitoFixtureSeederClient = class extends UserPoolClient {
|
|
629
|
-
constructor(scope, props) {
|
|
630
|
-
const { userPool, ...rest } = props;
|
|
631
|
-
super(scope, "fixture-seeder-client", {
|
|
632
|
-
userPool,
|
|
633
|
-
generateSecret: false,
|
|
634
|
-
authFlows: {
|
|
635
|
-
userPassword: true
|
|
636
|
-
},
|
|
637
|
-
// No OAuth flows — the seeder calls Cognito's `InitiateAuth`
|
|
638
|
-
// directly with USER_PASSWORD_AUTH, not through the hosted-UI
|
|
639
|
-
// OAuth grant flows the SPA client uses. `disableOAuth: true`
|
|
640
|
-
// causes CDK to omit `AllowedOAuthFlowsUserPoolClient` entirely;
|
|
641
|
-
// passing an empty `oAuth` block instead still flips that flag on
|
|
642
|
-
// and Cognito rejects the create call for missing flows/scopes.
|
|
643
|
-
disableOAuth: true,
|
|
644
|
-
// Short-lived tokens: a seeder run takes seconds, not hours.
|
|
645
|
-
// 1h access-token validity is the minimum Cognito permits and is
|
|
646
|
-
// plenty for a fixture run.
|
|
647
|
-
accessTokenValidity: Duration.hours(1),
|
|
648
|
-
idTokenValidity: Duration.hours(1),
|
|
649
|
-
refreshTokenValidity: Duration.days(1),
|
|
650
|
-
preventUserExistenceErrors: true,
|
|
651
|
-
...rest
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
/**
|
|
656
|
-
* SSM parameter name suffix used to publish this client's ID for
|
|
657
|
-
* cross-stack lookups. Built into a full parameter name via
|
|
658
|
-
* `buildParameterName` with `serviceType` AUTH (since the auth stack
|
|
659
|
-
* owns this resource).
|
|
660
|
-
*/
|
|
661
|
-
CognitoFixtureSeederClient.SSM_PARAM_NAME = "COGNITO_FIXTURE_SEEDER_CLIENT";
|
|
662
|
-
|
|
663
616
|
// src/components/cognito/cognito-user-pool.ts
|
|
664
617
|
import {
|
|
665
618
|
FeaturePlan,
|
|
@@ -704,8 +657,8 @@ var CognitoUserPool = class extends UserPool {
|
|
|
704
657
|
CognitoUserPool.SSM_PARAM_NAME = "COGNITO_USER_POOL";
|
|
705
658
|
|
|
706
659
|
// src/components/cognito/cognito-user-pool-client.ts
|
|
707
|
-
import { UserPoolClient
|
|
708
|
-
var CognitoUserPoolClient = class extends
|
|
660
|
+
import { UserPoolClient } from "aws-cdk-lib/aws-cognito";
|
|
661
|
+
var CognitoUserPoolClient = class extends UserPoolClient {
|
|
709
662
|
constructor(scope, props) {
|
|
710
663
|
super(scope, "user-pool-client", {
|
|
711
664
|
/**
|
|
@@ -850,7 +803,7 @@ var PreTokenGenerationLambda = class extends Construct3 {
|
|
|
850
803
|
// src/components/dynamodb/data-store-historical-archive.ts
|
|
851
804
|
import fs4 from "fs";
|
|
852
805
|
import path4 from "path";
|
|
853
|
-
import { Duration
|
|
806
|
+
import { Duration, RemovalPolicy as RemovalPolicy2, Size } from "aws-cdk-lib";
|
|
854
807
|
import * as kinesisfirehose from "aws-cdk-lib/aws-kinesisfirehose";
|
|
855
808
|
import { Runtime as Runtime4 } from "aws-cdk-lib/aws-lambda";
|
|
856
809
|
import { NodejsFunction as NodejsFunction4 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
@@ -888,7 +841,7 @@ var DataStoreHistoricalArchive = class extends Construct4 {
|
|
|
888
841
|
entry: resolveHandlerEntry4(__dirname),
|
|
889
842
|
runtime: Runtime4.NODEJS_LATEST,
|
|
890
843
|
memorySize: 512,
|
|
891
|
-
timeout:
|
|
844
|
+
timeout: Duration.minutes(1),
|
|
892
845
|
description: "Firehose transform: filter CURRENT resource rows, S3 keys, EventBridge PutEvents",
|
|
893
846
|
environment: props.dataEventBus && putEventsFailureDlqBucket ? {
|
|
894
847
|
DATA_EVENT_BUS_NAME: props.dataEventBus.eventBusName,
|
|
@@ -904,14 +857,14 @@ var DataStoreHistoricalArchive = class extends Construct4 {
|
|
|
904
857
|
const processor = new kinesisfirehose.LambdaFunctionProcessor(
|
|
905
858
|
this.transformFunction,
|
|
906
859
|
{
|
|
907
|
-
bufferInterval:
|
|
860
|
+
bufferInterval: Duration.seconds(60),
|
|
908
861
|
bufferSize: Size.mebibytes(3),
|
|
909
862
|
retries: 3
|
|
910
863
|
}
|
|
911
864
|
);
|
|
912
865
|
const destination = new kinesisfirehose.S3Bucket(this.archiveBucket, {
|
|
913
866
|
compression: kinesisfirehose.Compression.GZIP,
|
|
914
|
-
bufferingInterval:
|
|
867
|
+
bufferingInterval: Duration.seconds(300),
|
|
915
868
|
// Firehose requires SizeInMBs ≥ 64 when dynamic partitioning is enabled.
|
|
916
869
|
bufferingSize: Size.mebibytes(64),
|
|
917
870
|
processors: [processor],
|
|
@@ -1291,7 +1244,7 @@ var ControlEventBus = class _ControlEventBus extends EventBus3 {
|
|
|
1291
1244
|
// src/components/postgres/data-store-postgres-replica.ts
|
|
1292
1245
|
import fs5 from "fs";
|
|
1293
1246
|
import path5 from "path";
|
|
1294
|
-
import { Duration as
|
|
1247
|
+
import { Duration as Duration2, Stack as Stack2 } from "aws-cdk-lib";
|
|
1295
1248
|
import * as ec2 from "aws-cdk-lib/aws-ec2";
|
|
1296
1249
|
import { Runtime as Runtime5, StartingPosition } from "aws-cdk-lib/aws-lambda";
|
|
1297
1250
|
import { KinesisEventSource } from "aws-cdk-lib/aws-lambda-event-sources";
|
|
@@ -1393,7 +1346,7 @@ var DataStorePostgresReplica = class extends Construct6 {
|
|
|
1393
1346
|
entry: resolveHandlerEntry5(__dirname),
|
|
1394
1347
|
runtime: Runtime5.NODEJS_LATEST,
|
|
1395
1348
|
memorySize: 512,
|
|
1396
|
-
timeout:
|
|
1349
|
+
timeout: Duration2.minutes(1),
|
|
1397
1350
|
vpc: this.vpc,
|
|
1398
1351
|
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
|
|
1399
1352
|
description: "Replicates DynamoDB current-resource changes into the Postgres `resources` JSONB table (ADR 2026-04-17-01).",
|
|
@@ -1420,7 +1373,7 @@ var DataStorePostgresReplica = class extends Construct6 {
|
|
|
1420
1373
|
new KinesisEventSource(props.kinesisStream, {
|
|
1421
1374
|
startingPosition: StartingPosition.LATEST,
|
|
1422
1375
|
batchSize: 100,
|
|
1423
|
-
maxBatchingWindow:
|
|
1376
|
+
maxBatchingWindow: Duration2.seconds(5),
|
|
1424
1377
|
retryAttempts: 10,
|
|
1425
1378
|
bisectBatchOnError: true,
|
|
1426
1379
|
parallelizationFactor: 2,
|
|
@@ -1453,7 +1406,7 @@ var DataStorePostgresReplica = class extends Construct6 {
|
|
|
1453
1406
|
};
|
|
1454
1407
|
|
|
1455
1408
|
// src/components/route-53/child-hosted-zone.ts
|
|
1456
|
-
import { Duration as
|
|
1409
|
+
import { Duration as Duration3 } from "aws-cdk-lib";
|
|
1457
1410
|
import {
|
|
1458
1411
|
HostedZone,
|
|
1459
1412
|
NsRecord
|
|
@@ -1465,7 +1418,7 @@ var ChildHostedZone = class extends HostedZone {
|
|
|
1465
1418
|
zone: props.parentHostedZone,
|
|
1466
1419
|
recordName: this.zoneName,
|
|
1467
1420
|
values: this.hostedZoneNameServers || [],
|
|
1468
|
-
ttl:
|
|
1421
|
+
ttl: Duration3.minutes(5)
|
|
1469
1422
|
});
|
|
1470
1423
|
}
|
|
1471
1424
|
};
|
|
@@ -1486,7 +1439,7 @@ import {
|
|
|
1486
1439
|
} from "aws-cdk-lib/aws-cloudfront";
|
|
1487
1440
|
import { S3BucketOrigin } from "aws-cdk-lib/aws-cloudfront-origins";
|
|
1488
1441
|
import { Bucket as Bucket2 } from "aws-cdk-lib/aws-s3";
|
|
1489
|
-
import { Duration as
|
|
1442
|
+
import { Duration as Duration4 } from "aws-cdk-lib/core";
|
|
1490
1443
|
import { Construct as Construct8 } from "constructs";
|
|
1491
1444
|
var STATIC_HOSTING_SERVICE_TYPE = "website";
|
|
1492
1445
|
var _StaticHosting = class _StaticHosting extends Construct8 {
|
|
@@ -1507,9 +1460,9 @@ var _StaticHosting = class _StaticHosting extends Construct8 {
|
|
|
1507
1460
|
const cachePolicy = new CachePolicy(this, "cache-policy", {
|
|
1508
1461
|
cachePolicyName: `static-hosting-10s-${stack.branchHash}`,
|
|
1509
1462
|
comment: "Low TTL (10s) for static hosting; no invalidation",
|
|
1510
|
-
defaultTtl:
|
|
1511
|
-
minTtl:
|
|
1512
|
-
maxTtl:
|
|
1463
|
+
defaultTtl: Duration4.seconds(10),
|
|
1464
|
+
minTtl: Duration4.seconds(0),
|
|
1465
|
+
maxTtl: Duration4.seconds(10)
|
|
1513
1466
|
});
|
|
1514
1467
|
this.distribution = new Distribution(this, "distribution", {
|
|
1515
1468
|
defaultBehavior: {
|
|
@@ -1541,11 +1494,10 @@ _StaticHosting.SSM_PARAM_NAME_DISTRIBUTION_ARN = "STATIC_HOSTING_DISTRIBUTION_AR
|
|
|
1541
1494
|
var StaticHosting = _StaticHosting;
|
|
1542
1495
|
|
|
1543
1496
|
// src/services/open-hi-auth-service.ts
|
|
1544
|
-
var import_config5 = __toESM(require_lib2());
|
|
1545
1497
|
import {
|
|
1546
1498
|
LambdaVersion,
|
|
1547
1499
|
UserPool as UserPool2,
|
|
1548
|
-
UserPoolClient as
|
|
1500
|
+
UserPoolClient as UserPoolClient2,
|
|
1549
1501
|
UserPoolDomain as UserPoolDomain2,
|
|
1550
1502
|
UserPoolOperation
|
|
1551
1503
|
} from "aws-cdk-lib/aws-cognito";
|
|
@@ -1575,7 +1527,7 @@ import { Construct as Construct10 } from "constructs";
|
|
|
1575
1527
|
// src/workflows/control-plane/platform-deploy-bridge/platform-deploy-bridge-lambda.ts
|
|
1576
1528
|
import fs6 from "fs";
|
|
1577
1529
|
import path6 from "path";
|
|
1578
|
-
import { Duration as
|
|
1530
|
+
import { Duration as Duration5, Stack as Stack3 } from "aws-cdk-lib";
|
|
1579
1531
|
import { Rule } from "aws-cdk-lib/aws-events";
|
|
1580
1532
|
import { LambdaFunction } from "aws-cdk-lib/aws-events-targets";
|
|
1581
1533
|
import { Effect as Effect2, PolicyStatement as PolicyStatement2 } from "aws-cdk-lib/aws-iam";
|
|
@@ -1607,7 +1559,7 @@ var PlatformDeployBridgeLambda = class extends Construct9 {
|
|
|
1607
1559
|
entry: resolveHandlerEntry6(__dirname),
|
|
1608
1560
|
runtime: Runtime6.NODEJS_LATEST,
|
|
1609
1561
|
memorySize: 256,
|
|
1610
|
-
timeout:
|
|
1562
|
+
timeout: Duration5.seconds(30),
|
|
1611
1563
|
environment: {
|
|
1612
1564
|
[CONTROL_EVENT_BUS_NAME_ENV_VAR]: props.controlEventBus.eventBusName,
|
|
1613
1565
|
[OPENHI_REPO_TAG_KEY_ENV_VAR]: repoTagKey,
|
|
@@ -1638,7 +1590,7 @@ var PlatformDeployBridgeLambda = class extends Construct9 {
|
|
|
1638
1590
|
targets: [
|
|
1639
1591
|
new LambdaFunction(this.lambda, {
|
|
1640
1592
|
retryAttempts: 2,
|
|
1641
|
-
maxEventAge:
|
|
1593
|
+
maxEventAge: Duration5.hours(2)
|
|
1642
1594
|
})
|
|
1643
1595
|
]
|
|
1644
1596
|
});
|
|
@@ -1841,8 +1793,7 @@ var OpenHiGlobalService = _OpenHiGlobalService;
|
|
|
1841
1793
|
// src/workflows/control-plane/seed-demo-data/seed-demo-data-lambda.ts
|
|
1842
1794
|
import fs7 from "fs";
|
|
1843
1795
|
import path7 from "path";
|
|
1844
|
-
import {
|
|
1845
|
-
import { Duration as Duration7, Stack as Stack4 } from "aws-cdk-lib";
|
|
1796
|
+
import { Duration as Duration6, Stack as Stack4 } from "aws-cdk-lib";
|
|
1846
1797
|
import { Rule as Rule2 } from "aws-cdk-lib/aws-events";
|
|
1847
1798
|
import { LambdaFunction as LambdaFunction2 } from "aws-cdk-lib/aws-events-targets";
|
|
1848
1799
|
import { Effect as Effect3, PolicyStatement as PolicyStatement3 } from "aws-cdk-lib/aws-iam";
|
|
@@ -1864,39 +1815,24 @@ var SeedDemoDataLambda = class extends Construct11 {
|
|
|
1864
1815
|
entry: resolveHandlerEntry7(__dirname),
|
|
1865
1816
|
runtime: Runtime7.NODEJS_LATEST,
|
|
1866
1817
|
memorySize: 512,
|
|
1867
|
-
timeout:
|
|
1818
|
+
timeout: Duration6.minutes(2),
|
|
1868
1819
|
environment: {
|
|
1869
1820
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
1870
1821
|
[SEED_DEMO_DATA_USER_POOL_ID_ENV_VAR]: props.userPool.userPoolId
|
|
1871
1822
|
}
|
|
1872
1823
|
});
|
|
1873
|
-
const roleReadKeys = Object.values(PLATFORM_ROLE_IDS).map(rolePartitionKey);
|
|
1874
1824
|
this.lambda.addToRolePolicy(
|
|
1875
1825
|
new PolicyStatement3({
|
|
1876
1826
|
effect: Effect3.ALLOW,
|
|
1877
1827
|
actions: ["dynamodb:GetItem"],
|
|
1878
|
-
resources: [props.dataStoreTable.tableArn]
|
|
1879
|
-
conditions: {
|
|
1880
|
-
"ForAllValues:StringEquals": {
|
|
1881
|
-
"dynamodb:LeadingKeys": roleReadKeys
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1828
|
+
resources: [props.dataStoreTable.tableArn]
|
|
1884
1829
|
})
|
|
1885
1830
|
);
|
|
1886
|
-
const writeKeys = [
|
|
1887
|
-
...demoBasePartitionKeys(),
|
|
1888
|
-
...demoDevUserPartitionKeys(DEV_USERS)
|
|
1889
|
-
];
|
|
1890
1831
|
this.lambda.addToRolePolicy(
|
|
1891
1832
|
new PolicyStatement3({
|
|
1892
1833
|
effect: Effect3.ALLOW,
|
|
1893
1834
|
actions: ["dynamodb:PutItem", "dynamodb:UpdateItem"],
|
|
1894
|
-
resources: [props.dataStoreTable.tableArn]
|
|
1895
|
-
conditions: {
|
|
1896
|
-
"ForAllValues:StringEquals": {
|
|
1897
|
-
"dynamodb:LeadingKeys": writeKeys
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1835
|
+
resources: [props.dataStoreTable.tableArn]
|
|
1900
1836
|
})
|
|
1901
1837
|
);
|
|
1902
1838
|
this.lambda.addToRolePolicy(
|
|
@@ -1925,7 +1861,7 @@ var SeedDemoDataLambda = class extends Construct11 {
|
|
|
1925
1861
|
targets: [
|
|
1926
1862
|
new LambdaFunction2(this.lambda, {
|
|
1927
1863
|
retryAttempts: 2,
|
|
1928
|
-
maxEventAge:
|
|
1864
|
+
maxEventAge: Duration6.hours(2)
|
|
1929
1865
|
})
|
|
1930
1866
|
]
|
|
1931
1867
|
});
|
|
@@ -1953,8 +1889,8 @@ var SeedDemoDataWorkflow = class extends Construct12 {
|
|
|
1953
1889
|
// src/workflows/control-plane/seed-system-data/seed-system-data-lambda.ts
|
|
1954
1890
|
import fs8 from "fs";
|
|
1955
1891
|
import path8 from "path";
|
|
1956
|
-
import { PLATFORM_ROLE_IDS
|
|
1957
|
-
import { Duration as
|
|
1892
|
+
import { PLATFORM_ROLE_IDS } from "@openhi/types";
|
|
1893
|
+
import { Duration as Duration7, Stack as Stack5 } from "aws-cdk-lib";
|
|
1958
1894
|
import { Rule as Rule3 } from "aws-cdk-lib/aws-events";
|
|
1959
1895
|
import { LambdaFunction as LambdaFunction3 } from "aws-cdk-lib/aws-events-targets";
|
|
1960
1896
|
import { Effect as Effect4, PolicyStatement as PolicyStatement4 } from "aws-cdk-lib/aws-iam";
|
|
@@ -1976,13 +1912,13 @@ var SeedSystemDataLambda = class extends Construct13 {
|
|
|
1976
1912
|
entry: resolveHandlerEntry8(__dirname),
|
|
1977
1913
|
runtime: Runtime8.NODEJS_LATEST,
|
|
1978
1914
|
memorySize: 512,
|
|
1979
|
-
timeout:
|
|
1915
|
+
timeout: Duration7.minutes(1),
|
|
1980
1916
|
environment: {
|
|
1981
1917
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
1982
1918
|
[SEED_SYSTEM_DATA_CONTROL_BUS_ENV_VAR]: props.controlEventBus.eventBusName
|
|
1983
1919
|
}
|
|
1984
1920
|
});
|
|
1985
|
-
const roleArns = Object.values(
|
|
1921
|
+
const roleArns = Object.values(PLATFORM_ROLE_IDS).map(
|
|
1986
1922
|
(id) => `role#id#${id}`
|
|
1987
1923
|
);
|
|
1988
1924
|
this.lambda.addToRolePolicy(
|
|
@@ -2013,7 +1949,7 @@ var SeedSystemDataLambda = class extends Construct13 {
|
|
|
2013
1949
|
targets: [
|
|
2014
1950
|
new LambdaFunction3(this.lambda, {
|
|
2015
1951
|
retryAttempts: 2,
|
|
2016
|
-
maxEventAge:
|
|
1952
|
+
maxEventAge: Duration7.hours(2)
|
|
2017
1953
|
})
|
|
2018
1954
|
]
|
|
2019
1955
|
});
|
|
@@ -2150,7 +2086,7 @@ var OpenHiDataService = _OpenHiDataService;
|
|
|
2150
2086
|
// src/workflows/control-plane/user-onboarding/provision-default-workspace-lambda.ts
|
|
2151
2087
|
import fs9 from "fs";
|
|
2152
2088
|
import path9 from "path";
|
|
2153
|
-
import { Duration as
|
|
2089
|
+
import { Duration as Duration8 } from "aws-cdk-lib";
|
|
2154
2090
|
import { Rule as Rule4 } from "aws-cdk-lib/aws-events";
|
|
2155
2091
|
import { LambdaFunction as LambdaFunction4 } from "aws-cdk-lib/aws-events-targets";
|
|
2156
2092
|
import { Effect as Effect5, PolicyStatement as PolicyStatement5 } from "aws-cdk-lib/aws-iam";
|
|
@@ -2197,7 +2133,7 @@ var ProvisionDefaultWorkspaceLambda = class extends Construct15 {
|
|
|
2197
2133
|
targets: [
|
|
2198
2134
|
new LambdaFunction4(this.lambda, {
|
|
2199
2135
|
retryAttempts: 2,
|
|
2200
|
-
maxEventAge:
|
|
2136
|
+
maxEventAge: Duration8.hours(2)
|
|
2201
2137
|
})
|
|
2202
2138
|
]
|
|
2203
2139
|
});
|
|
@@ -2240,7 +2176,6 @@ var _OpenHiAuthService = class _OpenHiAuthService extends OpenHiService {
|
|
|
2240
2176
|
this.grantPostConfirmationPermissions();
|
|
2241
2177
|
this.userPoolClient = this.createUserPoolClient();
|
|
2242
2178
|
this.userPoolDomain = this.createUserPoolDomain();
|
|
2243
|
-
this.fixtureSeederClient = this.createFixtureSeederClient();
|
|
2244
2179
|
}
|
|
2245
2180
|
/**
|
|
2246
2181
|
* Returns an IUserPool by looking up the Auth stack's User Pool ID from SSM.
|
|
@@ -2263,33 +2198,12 @@ var _OpenHiAuthService = class _OpenHiAuthService extends OpenHiService {
|
|
|
2263
2198
|
serviceType: _OpenHiAuthService.SERVICE_TYPE
|
|
2264
2199
|
}
|
|
2265
2200
|
);
|
|
2266
|
-
return
|
|
2201
|
+
return UserPoolClient2.fromUserPoolClientId(
|
|
2267
2202
|
scope,
|
|
2268
2203
|
"user-pool-client",
|
|
2269
2204
|
userPoolClientId
|
|
2270
2205
|
);
|
|
2271
2206
|
}
|
|
2272
|
-
/**
|
|
2273
|
-
* Returns the dedicated fixture-seeder IUserPoolClient by looking up
|
|
2274
|
-
* its ID from SSM. Only non-prod auth stacks publish this parameter
|
|
2275
|
-
* (per the conditional in {@link createFixtureSeederClient}); calling
|
|
2276
|
-
* this against a prod-deployed stack will fail at lookup time.
|
|
2277
|
-
*
|
|
2278
|
-
* Consumed by `OpenHiRestApiService` (in non-prod) so the authorizer
|
|
2279
|
-
* accepts tokens issued by this client, and by the seed-fixtures CLI
|
|
2280
|
-
* to drive USER_PASSWORD_AUTH against this client's ID.
|
|
2281
|
-
*/
|
|
2282
|
-
static fixtureSeederClientFromConstruct(scope) {
|
|
2283
|
-
const clientId = DiscoverableStringParameter.valueForLookupName(scope, {
|
|
2284
|
-
ssmParamName: CognitoFixtureSeederClient.SSM_PARAM_NAME,
|
|
2285
|
-
serviceType: _OpenHiAuthService.SERVICE_TYPE
|
|
2286
|
-
});
|
|
2287
|
-
return UserPoolClient3.fromUserPoolClientId(
|
|
2288
|
-
scope,
|
|
2289
|
-
"fixture-seeder-client",
|
|
2290
|
-
clientId
|
|
2291
|
-
);
|
|
2292
|
-
}
|
|
2293
2207
|
/**
|
|
2294
2208
|
* Returns an IUserPoolDomain by looking up the Auth stack's User Pool Domain from SSM.
|
|
2295
2209
|
*/
|
|
@@ -2478,31 +2392,6 @@ var _OpenHiAuthService = class _OpenHiAuthService extends OpenHiService {
|
|
|
2478
2392
|
});
|
|
2479
2393
|
return client;
|
|
2480
2394
|
}
|
|
2481
|
-
/**
|
|
2482
|
-
* Creates the dedicated USER_PASSWORD_AUTH app client for the
|
|
2483
|
-
* `@openhi/seed-fixtures` CLI, **only** in non-prod environments.
|
|
2484
|
-
* Returns `undefined` when this stack is being deployed to a prod
|
|
2485
|
-
* stage so the prod auth stack carries no fixture-seeder code path.
|
|
2486
|
-
*
|
|
2487
|
-
* Operator post-deploy: create a `fixture-seeder` Cognito user with
|
|
2488
|
-
* a service password (manually via console or scripted with
|
|
2489
|
-
* `aws cognito-idp admin-create-user`); the CLI consumes those creds
|
|
2490
|
-
* via env vars to drive `InitiateAuth`.
|
|
2491
|
-
*/
|
|
2492
|
-
createFixtureSeederClient() {
|
|
2493
|
-
if (this.ohEnv.ohStage.stageType === import_config5.OPEN_HI_STAGE.PROD) {
|
|
2494
|
-
return void 0;
|
|
2495
|
-
}
|
|
2496
|
-
const client = new CognitoFixtureSeederClient(this, {
|
|
2497
|
-
userPool: this.userPool
|
|
2498
|
-
});
|
|
2499
|
-
new DiscoverableStringParameter(this, "fixture-seeder-client-param", {
|
|
2500
|
-
ssmParamName: CognitoFixtureSeederClient.SSM_PARAM_NAME,
|
|
2501
|
-
stringValue: client.userPoolClientId,
|
|
2502
|
-
description: "Cognito User Pool Client ID for the OpenHI fixture-seeder CLI (USER_PASSWORD_AUTH; non-prod only); cross-stack reference"
|
|
2503
|
-
});
|
|
2504
|
-
return client;
|
|
2505
|
-
}
|
|
2506
2395
|
/**
|
|
2507
2396
|
* Creates the User Pool Domain (Cognito hosted UI) and exports domain name to SSM.
|
|
2508
2397
|
* Look up via {@link OpenHiAuthService.userPoolDomainFromConstruct}.
|
|
@@ -2527,7 +2416,6 @@ _OpenHiAuthService.SERVICE_TYPE = "auth";
|
|
|
2527
2416
|
var OpenHiAuthService = _OpenHiAuthService;
|
|
2528
2417
|
|
|
2529
2418
|
// src/services/open-hi-rest-api-service.ts
|
|
2530
|
-
var import_config6 = __toESM(require_lib2());
|
|
2531
2419
|
import {
|
|
2532
2420
|
CorsHttpMethod,
|
|
2533
2421
|
DomainName,
|
|
@@ -2546,7 +2434,7 @@ import {
|
|
|
2546
2434
|
RecordTarget
|
|
2547
2435
|
} from "aws-cdk-lib/aws-route53";
|
|
2548
2436
|
import { ApiGatewayv2DomainProperties } from "aws-cdk-lib/aws-route53-targets";
|
|
2549
|
-
import { Duration as
|
|
2437
|
+
import { Duration as Duration9 } from "aws-cdk-lib/core";
|
|
2550
2438
|
|
|
2551
2439
|
// src/data/lambda/cors-options-lambda.ts
|
|
2552
2440
|
import fs10 from "fs";
|
|
@@ -2831,16 +2719,10 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
|
|
|
2831
2719
|
createRootHttpApi(domainName) {
|
|
2832
2720
|
const userPool = OpenHiAuthService.userPoolFromConstruct(this);
|
|
2833
2721
|
const userPoolClient = OpenHiAuthService.userPoolClientFromConstruct(this);
|
|
2834
|
-
const userPoolClients = [userPoolClient];
|
|
2835
|
-
if (this.ohEnv.ohStage.stageType !== import_config6.OPEN_HI_STAGE.PROD) {
|
|
2836
|
-
userPoolClients.push(
|
|
2837
|
-
OpenHiAuthService.fixtureSeederClientFromConstruct(this)
|
|
2838
|
-
);
|
|
2839
|
-
}
|
|
2840
2722
|
const cognitoAuthorizer = new HttpUserPoolAuthorizer(
|
|
2841
2723
|
"cognito-authorizer",
|
|
2842
2724
|
userPool,
|
|
2843
|
-
{ userPoolClients }
|
|
2725
|
+
{ userPoolClients: [userPoolClient] }
|
|
2844
2726
|
);
|
|
2845
2727
|
const { corsPreflight: cors, ...restRootHttpApiProps } = this.props.rootHttpApiProps ?? {};
|
|
2846
2728
|
const corsPreflight = cors !== void 0 ? {
|
|
@@ -2859,7 +2741,7 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
|
|
|
2859
2741
|
"Authorization"
|
|
2860
2742
|
],
|
|
2861
2743
|
allowCredentials: cors.allowCredentials ?? true,
|
|
2862
|
-
maxAge: cors.maxAge ??
|
|
2744
|
+
maxAge: cors.maxAge ?? Duration9.days(1),
|
|
2863
2745
|
...cors.exposeHeaders !== void 0 && {
|
|
2864
2746
|
exposeHeaders: cors.exposeHeaders
|
|
2865
2747
|
}
|
|
@@ -2927,7 +2809,7 @@ var OpenHiGraphqlService = _OpenHiGraphqlService;
|
|
|
2927
2809
|
// src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-lambdas.ts
|
|
2928
2810
|
import fs12 from "fs";
|
|
2929
2811
|
import path12 from "path";
|
|
2930
|
-
import { Duration as
|
|
2812
|
+
import { Duration as Duration10 } from "aws-cdk-lib";
|
|
2931
2813
|
import { Effect as Effect8, PolicyStatement as PolicyStatement8 } from "aws-cdk-lib/aws-iam";
|
|
2932
2814
|
import { Runtime as Runtime12 } from "aws-cdk-lib/aws-lambda";
|
|
2933
2815
|
import { NodejsFunction as NodejsFunction12 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
@@ -2951,7 +2833,7 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
2951
2833
|
entry: listResolved.entry,
|
|
2952
2834
|
runtime: Runtime12.NODEJS_LATEST,
|
|
2953
2835
|
memorySize: 512,
|
|
2954
|
-
timeout:
|
|
2836
|
+
timeout: Duration10.minutes(1),
|
|
2955
2837
|
environment: {
|
|
2956
2838
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
2957
2839
|
}
|
|
@@ -2965,7 +2847,7 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
2965
2847
|
entry: deleteResolved.entry,
|
|
2966
2848
|
runtime: Runtime12.NODEJS_LATEST,
|
|
2967
2849
|
memorySize: 512,
|
|
2968
|
-
timeout:
|
|
2850
|
+
timeout: Duration10.minutes(1),
|
|
2969
2851
|
environment: {
|
|
2970
2852
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
2971
2853
|
}
|
|
@@ -2984,7 +2866,7 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
2984
2866
|
entry: finalizeResolved.entry,
|
|
2985
2867
|
runtime: Runtime12.NODEJS_LATEST,
|
|
2986
2868
|
memorySize: 512,
|
|
2987
|
-
timeout:
|
|
2869
|
+
timeout: Duration10.minutes(1),
|
|
2988
2870
|
environment: {
|
|
2989
2871
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
|
|
2990
2872
|
[OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
|
|
@@ -3002,7 +2884,7 @@ var OwningDeleteCascadeLambdas = class extends Construct19 {
|
|
|
3002
2884
|
};
|
|
3003
2885
|
|
|
3004
2886
|
// src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-workflow.ts
|
|
3005
|
-
import { Duration as
|
|
2887
|
+
import { Duration as Duration11 } from "aws-cdk-lib";
|
|
3006
2888
|
import { Rule as Rule5 } from "aws-cdk-lib/aws-events";
|
|
3007
2889
|
import { SfnStateMachine } from "aws-cdk-lib/aws-events-targets";
|
|
3008
2890
|
import {
|
|
@@ -3128,7 +3010,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct20 {
|
|
|
3128
3010
|
}
|
|
3129
3011
|
});
|
|
3130
3012
|
const interPageWait = new Wait(this, "inter-page-wait", {
|
|
3131
|
-
time: WaitTime.duration(
|
|
3013
|
+
time: WaitTime.duration(Duration11.seconds(0))
|
|
3132
3014
|
});
|
|
3133
3015
|
const isExhausted = new Choice(this, "is-exhausted");
|
|
3134
3016
|
const finalize = new LambdaInvoke(this, "finalize", {
|
|
@@ -3159,7 +3041,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct20 {
|
|
|
3159
3041
|
// Long timeout because real-world cascades can run minutes when
|
|
3160
3042
|
// a workspace has thousands of members. The stuck-cascade alarm
|
|
3161
3043
|
// fires at 15 minutes; the state machine itself does not abort.
|
|
3162
|
-
timeout:
|
|
3044
|
+
timeout: Duration11.hours(2)
|
|
3163
3045
|
});
|
|
3164
3046
|
this.rule = new Rule5(this, "rule", {
|
|
3165
3047
|
eventBus: props.dataEventBus,
|
|
@@ -3170,7 +3052,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct20 {
|
|
|
3170
3052
|
targets: [
|
|
3171
3053
|
new SfnStateMachine(this.stateMachine, {
|
|
3172
3054
|
retryAttempts: 2,
|
|
3173
|
-
maxEventAge:
|
|
3055
|
+
maxEventAge: Duration11.hours(2)
|
|
3174
3056
|
})
|
|
3175
3057
|
]
|
|
3176
3058
|
});
|
|
@@ -3180,7 +3062,7 @@ var OwningDeleteCascadeWorkflow = class extends Construct20 {
|
|
|
3180
3062
|
// src/workflows/control-plane/rename-cascade/rename-cascade-lambdas.ts
|
|
3181
3063
|
import fs13 from "fs";
|
|
3182
3064
|
import path13 from "path";
|
|
3183
|
-
import { Duration as
|
|
3065
|
+
import { Duration as Duration12 } from "aws-cdk-lib";
|
|
3184
3066
|
import { Effect as Effect9, PolicyStatement as PolicyStatement9 } from "aws-cdk-lib/aws-iam";
|
|
3185
3067
|
import { Runtime as Runtime13 } from "aws-cdk-lib/aws-lambda";
|
|
3186
3068
|
import { NodejsFunction as NodejsFunction13 } from "aws-cdk-lib/aws-lambda-nodejs";
|
|
@@ -3204,7 +3086,7 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3204
3086
|
entry: listResolved.entry,
|
|
3205
3087
|
runtime: Runtime13.NODEJS_LATEST,
|
|
3206
3088
|
memorySize: 512,
|
|
3207
|
-
timeout:
|
|
3089
|
+
timeout: Duration12.minutes(1),
|
|
3208
3090
|
environment: {
|
|
3209
3091
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
3210
3092
|
}
|
|
@@ -3218,7 +3100,7 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3218
3100
|
entry: rewriteResolved.entry,
|
|
3219
3101
|
runtime: Runtime13.NODEJS_LATEST,
|
|
3220
3102
|
memorySize: 512,
|
|
3221
|
-
timeout:
|
|
3103
|
+
timeout: Duration12.minutes(1),
|
|
3222
3104
|
environment: {
|
|
3223
3105
|
DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
|
|
3224
3106
|
}
|
|
@@ -3237,7 +3119,7 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3237
3119
|
entry: finalizeResolved.entry,
|
|
3238
3120
|
runtime: Runtime13.NODEJS_LATEST,
|
|
3239
3121
|
memorySize: 512,
|
|
3240
|
-
timeout:
|
|
3122
|
+
timeout: Duration12.minutes(1),
|
|
3241
3123
|
environment: {
|
|
3242
3124
|
[RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
|
|
3243
3125
|
}
|
|
@@ -3253,7 +3135,7 @@ var RenameCascadeLambdas = class extends Construct21 {
|
|
|
3253
3135
|
};
|
|
3254
3136
|
|
|
3255
3137
|
// src/workflows/control-plane/rename-cascade/rename-cascade-workflow.ts
|
|
3256
|
-
import { Duration as
|
|
3138
|
+
import { Duration as Duration13 } from "aws-cdk-lib";
|
|
3257
3139
|
import { Rule as Rule6 } from "aws-cdk-lib/aws-events";
|
|
3258
3140
|
import { SfnStateMachine as SfnStateMachine2 } from "aws-cdk-lib/aws-events-targets";
|
|
3259
3141
|
import {
|
|
@@ -3412,7 +3294,7 @@ var RenameCascadeWorkflow = class extends Construct22 {
|
|
|
3412
3294
|
// Long timeout — large renames may rewrite thousands of rows;
|
|
3413
3295
|
// the `CascadeSlow` alarm fires at 300s p99 but the state
|
|
3414
3296
|
// machine itself does not abort.
|
|
3415
|
-
timeout:
|
|
3297
|
+
timeout: Duration13.hours(2)
|
|
3416
3298
|
});
|
|
3417
3299
|
this.rule = new Rule6(this, "rule", {
|
|
3418
3300
|
eventBus: props.dataEventBus,
|
|
@@ -3423,7 +3305,7 @@ var RenameCascadeWorkflow = class extends Construct22 {
|
|
|
3423
3305
|
targets: [
|
|
3424
3306
|
new SfnStateMachine2(this.stateMachine, {
|
|
3425
3307
|
retryAttempts: 2,
|
|
3426
|
-
maxEventAge:
|
|
3308
|
+
maxEventAge: Duration13.hours(2)
|
|
3427
3309
|
})
|
|
3428
3310
|
]
|
|
3429
3311
|
});
|
|
@@ -3444,7 +3326,6 @@ export {
|
|
|
3444
3326
|
CLOUDFORMATION_STACK_STATUS_CHANGE_DETAIL_TYPE,
|
|
3445
3327
|
CONTROL_EVENT_BUS_NAME_ENV_VAR,
|
|
3446
3328
|
ChildHostedZone,
|
|
3447
|
-
CognitoFixtureSeederClient,
|
|
3448
3329
|
CognitoUserPool,
|
|
3449
3330
|
CognitoUserPoolClient,
|
|
3450
3331
|
CognitoUserPoolDomain,
|
|
@@ -3459,6 +3340,7 @@ export {
|
|
|
3459
3340
|
DATA_STORE_CHANGE_DETAIL_MAX_UTF8_BYTES,
|
|
3460
3341
|
DATA_STORE_CHANGE_DETAIL_TYPE,
|
|
3461
3342
|
DATA_STORE_CHANGE_EVENT_SOURCE,
|
|
3343
|
+
DEMO_DATA_PLANE_FIXTURES,
|
|
3462
3344
|
DEMO_PERIOD,
|
|
3463
3345
|
DEMO_TENANT_SPECS,
|
|
3464
3346
|
DEMO_URN_SYSTEM,
|
|
@@ -3537,22 +3419,14 @@ export {
|
|
|
3537
3419
|
WorkflowDedupTableDuplicateError,
|
|
3538
3420
|
buildFhirCurrentResourceChangeDetail,
|
|
3539
3421
|
buildProvisionDefaultWorkspaceRequestedDetail,
|
|
3540
|
-
demoBasePartitionKeys,
|
|
3541
|
-
demoDevUserPartitionKeys,
|
|
3542
3422
|
demoMembershipId,
|
|
3543
|
-
demoMembershipPartitionKey,
|
|
3544
3423
|
demoRoleAssignmentId,
|
|
3545
|
-
demoRoleAssignmentPartitionKey,
|
|
3546
3424
|
demoRolesForUserInTenant,
|
|
3547
3425
|
demoScenarioIdentifier,
|
|
3548
|
-
demoTenantPartitionKey,
|
|
3549
|
-
demoUserPartitionKey,
|
|
3550
|
-
demoWorkspacePartitionKey,
|
|
3551
3426
|
getDynamoDbDataStoreTableName,
|
|
3552
3427
|
getPostgresReplicaSchemaName,
|
|
3553
3428
|
getWorkflowDedupTableName,
|
|
3554
3429
|
openHiTagKey,
|
|
3555
|
-
openhiResourceIdentifier
|
|
3556
|
-
rolePartitionKey
|
|
3430
|
+
openhiResourceIdentifier
|
|
3557
3431
|
};
|
|
3558
3432
|
//# sourceMappingURL=index.mjs.map
|