@reventlessdev/reventless-aws 3.0.0-alpha.345 → 3.0.0-alpha.347
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/CHANGELOG.md +54 -0
- package/package.json +19 -12
- package/rescript.json +2 -1
- package/run-bake-manifest.mjs +3 -0
- package/run-deploy-app.mjs +3 -0
- package/run-provision-accounts.mjs +3 -0
- package/run-provision-admin.mjs +3 -0
- package/scripts/BakeManifest.res +395 -0
- package/scripts/BakeManifest.res.mjs +487 -0
- package/scripts/DeployApp.res +708 -0
- package/scripts/DeployApp.res.mjs +1015 -0
- package/scripts/DeployManifest.res +84 -0
- package/scripts/DeployManifest.res.mjs +112 -0
- package/scripts/ProvisionAccounts.res +339 -0
- package/scripts/ProvisionAccounts.res.mjs +351 -0
- package/scripts/ProvisionAdmin.res +275 -0
- package/scripts/ProvisionAdmin.res.mjs +289 -0
- package/scripts/ProvisionCognito.res +149 -0
- package/scripts/ProvisionCognito.res.mjs +98 -0
- package/scripts/ProvisionIdentity.res +76 -11
- package/scripts/ProvisionIdentity.res.mjs +72 -7
- package/scripts/ProvisionProvider.res +104 -0
- package/scripts/ProvisionProvider.res.mjs +123 -0
- package/scripts/PulumiCli.res +43 -0
- package/scripts/PulumiCli.res.mjs +106 -0
- package/src/Platform.res +51 -4
- package/src/Platform.res.mjs +32 -14
- package/src/Platform_Stack.res +119 -9
- package/src/Platform_Stack.res.mjs +42 -4
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +1 -5
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +1 -1
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +1 -5
- package/src/adapter/Api/Platform_UIFragments_Lambda.res.mjs +1 -2
- package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -5
- package/src/adapter/Auth/Auth_ActiveRoleStore.res.mjs +1 -2
- package/src/adapter/Auth/Auth_ActiveRoleTrigger.res +1 -5
- package/src/adapter/Auth/Auth_ActiveRoleTrigger.res.mjs +1 -2
- package/src/adapter/Auth/Auth_LoginIdentifier.res +66 -0
- package/src/adapter/Auth/Auth_LoginIdentifier.res.mjs +70 -0
- package/src/adapter/Auth/Auth_SignUpMode.res +78 -0
- package/src/adapter/Auth/Auth_SignUpMode.res.mjs +56 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +52 -31
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res.mjs +75 -44
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +1 -5
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs +1 -2
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +1 -5
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res.mjs +1 -2
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +5 -4
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res.mjs +1 -1
- package/src/adapter/Postgres/PgMigration_Builder.res +1 -1
- package/src/adapter/Postgres/PgMigration_Builder.res.mjs +1 -2
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +5 -0
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res.mjs +5 -1
- package/src/adapter/Runtime/CommandGeneratorEntryPoint_Ops.res +2 -0
- package/src/adapter/Runtime/CommandGeneratorEntryPoint_Ops.res.mjs +2 -2
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +15 -6
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +51 -30
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res.mjs +31 -14
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +1 -5
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +1 -1
- package/src/adapter/StateTopic/StateTopic_AppSync.res +1 -5
- package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +1 -1
- package/src/adapter/Task/TaskBucket_S3.res +1 -3
- package/src/adapter/Task/TaskBucket_S3.res.mjs +1 -1
- package/src/adapter/Upload/Upload_Claim_S3.res +1 -5
- package/src/adapter/Upload/Upload_Claim_S3.res.mjs +1 -1
- package/src/adapter/Upload/Upload_Presign_S3.res +1 -5
- package/src/adapter/Upload/Upload_Presign_S3.res.mjs +1 -2
- package/src/capability/Capability_Geocoding_AwsLocation.res +5 -1
- package/src/capability/Capability_Geocoding_AwsLocation.res.mjs +7 -1
- package/src/components/Api/AppSync_Adapter.res +56 -72
- package/src/components/Api/AppSync_Adapter.res.mjs +26 -60
- package/src/components/Api/AppSync_SdlDecorate.res +82 -1
- package/src/components/Api/AppSync_SdlDecorate.res.mjs +45 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res +1 -5
- package/src/plugin/cloner/ClonerRunner_Fargate.res.mjs +1 -1
- package/src/plugin/stack/Plugin_Stack.res +4 -0
- package/src/plugin/stack/Plugin_Stack.res.mjs +2 -0
- package/src/util/Util_DeadLetterQueue.res +1 -5
- package/src/util/Util_DeadLetterQueue.res.mjs +1 -2
- package/src/util/Util_StoreLayout.res +15 -2
- package/src/util/Util_StoreLayout.res.mjs +11 -3
- package/tests/AppSync_AdapterTest.res +83 -0
- package/tests/AppSync_AdapterTest.res.mjs +69 -0
- package/tests/Auth_LoginIdentifierTest.res +51 -0
- package/tests/Auth_LoginIdentifierTest.res.mjs +51 -0
- package/tests/Auth_SignUpModeTest.res +56 -0
- package/tests/Auth_SignUpModeTest.res.mjs +53 -0
- package/tests/BakeManifestTest.res +204 -0
- package/tests/BakeManifestTest.res.mjs +259 -0
- package/tests/DcbColdStartPartitionTest.res +32 -0
- package/tests/DcbColdStartPartitionTest.res.mjs +33 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +88 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res.mjs +112 -0
- package/tests/DcbUnresolvedPartitionSlice.res +28 -0
- package/tests/DcbUnresolvedPartitionSlice.res.mjs +38 -0
- package/tests/DeployAppTest.res +90 -0
- package/tests/DeployAppTest.res.mjs +133 -0
- package/tests/LambdaLayerLookupTest.res +104 -0
- package/tests/LambdaLayerLookupTest.res.mjs +117 -0
- package/tests/ProvisionAccountsTest.res +168 -0
- package/tests/ProvisionAccountsTest.res.mjs +184 -0
- package/tests/ProvisionAdminTest.res +55 -0
- package/tests/ProvisionAdminTest.res.mjs +66 -0
- package/tests/ProvisionIdentityTest.res +89 -3
- package/tests/ProvisionIdentityTest.res.mjs +66 -1
- package/tests/Util_OwnerScopeEnvTest.res +25 -0
- package/tests/Util_OwnerScopeEnvTest.res.mjs +13 -0
- package/tests/Util_StoreLayoutTest.res +6 -0
- package/tests/Util_StoreLayoutTest.res.mjs +7 -4
- package/tests/dcbColdStartPartition.mjs +66 -0
- package/tests/setup/layerArn.cjs +5 -0
package/src/Platform.res.mjs
CHANGED
|
@@ -16,7 +16,9 @@ import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
|
16
16
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
17
17
|
import * as Plugin$ReventlessAws from "./components/Plugin.res.mjs";
|
|
18
18
|
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
19
|
+
import * as AdminGroup$Reventless from "@reventlessdev/reventless-spec/src/types/AdminGroup.res.mjs";
|
|
19
20
|
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
21
|
+
import * as OwnerScope$Reventless from "@reventlessdev/reventless-spec/src/types/OwnerScope.res.mjs";
|
|
20
22
|
import * as Plugin$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/component/Plugin.res.mjs";
|
|
21
23
|
import * as AWS_Tags$ReventlessAws from "./adapter/AWS_Tags.res.mjs";
|
|
22
24
|
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
@@ -150,6 +152,7 @@ let messagingEmailProviderRef = {
|
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
function MakeWithConfig(Config) {
|
|
155
|
+
OwnerScope$Reventless.defaultElevatedGroups([AdminGroup$Reventless.name]);
|
|
153
156
|
Stdlib_Option.forEach(Config.commandHandlerConfig.aggregates, param => {
|
|
154
157
|
Stdlib_Option.forEach(param.sync, AggregateRuntime_Builder_Single$ReventlessAws.setConfig);
|
|
155
158
|
Stdlib_Option.forEach(param.async, AggregateRuntime_Builder_Single_Async$ReventlessAws.setConfig);
|
|
@@ -211,7 +214,7 @@ function MakeWithConfig(Config) {
|
|
|
211
214
|
subscriptionSources: []
|
|
212
215
|
});
|
|
213
216
|
let adminSourceSdl = () => {
|
|
214
|
-
let baseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(Platform_AdminApi$ReventlessCore.baseFragment(Config.cloner),
|
|
217
|
+
let baseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(Platform_AdminApi$ReventlessCore.baseFragment(Config.cloner), AdminGroup$Reventless.name, undefined);
|
|
215
218
|
return AppSync_SdlDecorate$ReventlessAws.stampCanonicalTypes(AppSync_Adapter$ReventlessAws.stitchStandaloneWithAwsDirectives(baseFragment));
|
|
216
219
|
};
|
|
217
220
|
let match;
|
|
@@ -870,7 +873,7 @@ function MakeWithConfig(Config) {
|
|
|
870
873
|
}
|
|
871
874
|
});
|
|
872
875
|
PluginRuntime_Builder$ReventlessAws.registerConfig(pluginEpEventTopicArn, pluginReadModelTableName, hooks_schedulerRoleUrn.contents, undefined, undefined, domainApiId, Config.cloner, undefined);
|
|
873
|
-
let offloadProtection = Util_StoreLayout$ReventlessAws.
|
|
876
|
+
let offloadProtection = Util_StoreLayout$ReventlessAws.protectionOfDeployedStack();
|
|
874
877
|
let offloadBucket = new (Aws.s3.Bucket)("reventless-offload", {
|
|
875
878
|
forceDestroy: offloadProtection === "Unprotected",
|
|
876
879
|
tags: AWS_Tags$ReventlessAws.make("reventless-offload", "Platform", {
|
|
@@ -889,6 +892,7 @@ function MakeWithConfig(Config) {
|
|
|
889
892
|
restrictPublicBuckets: true
|
|
890
893
|
});
|
|
891
894
|
Pulumi$Pulumi.$$export("offloadBucket", offloadBucketName);
|
|
895
|
+
Pulumi$Pulumi.$$export("platformStack", Pulumi.output(Pulumi.getOrganization() + `/` + Pulumi.getProject() + `/` + Pulumi.getStack()));
|
|
892
896
|
let componentDefinitions = pluginReadModelTableName !== undefined ? (AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(pluginReadModelTableName), Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, pluginReadModelTableName, offloadBucketName, admin.adminSchemaPushed, Stdlib_Option.flatMap(hostUiBundle, cfg => cfg.bakedManifest), {})) : undefined;
|
|
893
897
|
let rm = admin.stateViewSlicesOutputs["UiFragments"];
|
|
894
898
|
if (rm !== undefined) {
|
|
@@ -966,7 +970,7 @@ function MakeWithConfig(Config) {
|
|
|
966
970
|
});
|
|
967
971
|
let stackName = Pulumi.getStack();
|
|
968
972
|
let storeLayout = Util_StoreLayout$ReventlessAws.layoutFor(stackName, Util_HostUiDomain$ReventlessAws.resolveProdStacks());
|
|
969
|
-
let storeProtection = Util_StoreLayout$ReventlessAws.
|
|
973
|
+
let storeProtection = Util_StoreLayout$ReventlessAws.protectionOfDeployedStack();
|
|
970
974
|
let declaredStores = Stdlib_Array.reduce(Stdlib_Array.filterMap(capabilities, c => {
|
|
971
975
|
if (typeof c !== "object") {
|
|
972
976
|
return;
|
|
@@ -1324,6 +1328,9 @@ function MakeWithConfig(Config) {
|
|
|
1324
1328
|
let startServers = () => {};
|
|
1325
1329
|
let deployPlugin = (plugin, apiTargetOpt) => {
|
|
1326
1330
|
let apiTarget = apiTargetOpt !== undefined ? apiTargetOpt : "Domain";
|
|
1331
|
+
if (Stdlib_Option.isNone(platformStackRef)) {
|
|
1332
|
+
Stdlib_JsError.throwWithMessage(`This plugin stack has no platform:stack setting, so it cannot find its platform. Set it to the platform's stack: pulumi config set platform:stack ` + (Pulumi.getOrganization() + `/<platform project>/` + Pulumi.getStack()));
|
|
1333
|
+
}
|
|
1327
1334
|
let tmp;
|
|
1328
1335
|
tmp = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
1329
1336
|
log.info("Platform:deployPlugin", undefined, `target=` + tmp);
|
|
@@ -1439,10 +1446,13 @@ function MakeWithConfig(Config) {
|
|
|
1439
1446
|
if (missing.length !== 0) {
|
|
1440
1447
|
Stdlib_JsError.throwWithMessage(CapabilityNeed$Reventless.unmetMessage(missing) + Belt_SetString.toArray(Belt_SetString.fromArray(missing.map(u => {
|
|
1441
1448
|
let match = u.need;
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1449
|
+
switch (match) {
|
|
1450
|
+
case "Geocoding" :
|
|
1451
|
+
return `\n Geocoding is \`Capability_Geocoding_AwsLocation.make\`, passed to the platform as \`~geocoderPlaceIndex\`.`;
|
|
1452
|
+
case "Messaging" :
|
|
1453
|
+
return `\n Messaging is \`Capability_Messaging.make\`, passed to the platform as \`~messagingSender\`. The sender itself is configuration and has no default: set \`platform:messagingEmailSender\` in Pulumi.<stack>.yaml (or REVENTLESS_MESSAGING_EMAIL_SENDER), then verify the address with SES — or \`platform:messagingEmailProvider: log\` to log every message and send none.`;
|
|
1454
|
+
case "IdentityProvider" :
|
|
1455
|
+
return `\n IdentityProvider has no backend on any platform yet — the seam and the refusal exist, the Cognito and local implementations do not. A plugin declaring this need cannot be deployed until one lands; nothing about this deployment's configuration will change that.`;
|
|
1446
1456
|
}
|
|
1447
1457
|
}))).join(""));
|
|
1448
1458
|
}
|
|
@@ -1550,6 +1560,7 @@ function MakeWithConfig(Config) {
|
|
|
1550
1560
|
|
|
1551
1561
|
function Make($star) {
|
|
1552
1562
|
let commandHandlerConfig = {};
|
|
1563
|
+
OwnerScope$Reventless.defaultElevatedGroups([AdminGroup$Reventless.name]);
|
|
1553
1564
|
Stdlib_Option.forEach(commandHandlerConfig.aggregates, param => {
|
|
1554
1565
|
Stdlib_Option.forEach(param.sync, AggregateRuntime_Builder_Single$ReventlessAws.setConfig);
|
|
1555
1566
|
Stdlib_Option.forEach(param.async, AggregateRuntime_Builder_Single_Async$ReventlessAws.setConfig);
|
|
@@ -1611,7 +1622,7 @@ function Make($star) {
|
|
|
1611
1622
|
subscriptionSources: []
|
|
1612
1623
|
});
|
|
1613
1624
|
let adminSourceSdl = () => {
|
|
1614
|
-
let baseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(Platform_AdminApi$ReventlessCore.baseFragment(false),
|
|
1625
|
+
let baseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(Platform_AdminApi$ReventlessCore.baseFragment(false), AdminGroup$Reventless.name, undefined);
|
|
1615
1626
|
return AppSync_SdlDecorate$ReventlessAws.stampCanonicalTypes(AppSync_Adapter$ReventlessAws.stitchStandaloneWithAwsDirectives(baseFragment));
|
|
1616
1627
|
};
|
|
1617
1628
|
let match;
|
|
@@ -2253,7 +2264,7 @@ function Make($star) {
|
|
|
2253
2264
|
}
|
|
2254
2265
|
});
|
|
2255
2266
|
PluginRuntime_Builder$ReventlessAws.registerConfig(pluginEpEventTopicArn, pluginReadModelTableName, hooks_schedulerRoleUrn.contents, undefined, undefined, domainApiId, false, undefined);
|
|
2256
|
-
let offloadProtection = Util_StoreLayout$ReventlessAws.
|
|
2267
|
+
let offloadProtection = Util_StoreLayout$ReventlessAws.protectionOfDeployedStack();
|
|
2257
2268
|
let offloadBucket = new (Aws.s3.Bucket)("reventless-offload", {
|
|
2258
2269
|
forceDestroy: offloadProtection === "Unprotected",
|
|
2259
2270
|
tags: AWS_Tags$ReventlessAws.make("reventless-offload", "Platform", {
|
|
@@ -2272,6 +2283,7 @@ function Make($star) {
|
|
|
2272
2283
|
restrictPublicBuckets: true
|
|
2273
2284
|
});
|
|
2274
2285
|
Pulumi$Pulumi.$$export("offloadBucket", offloadBucketName);
|
|
2286
|
+
Pulumi$Pulumi.$$export("platformStack", Pulumi.output(Pulumi.getOrganization() + `/` + Pulumi.getProject() + `/` + Pulumi.getStack()));
|
|
2275
2287
|
let componentDefinitions = pluginReadModelTableName !== undefined ? (AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(pluginReadModelTableName), Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, pluginReadModelTableName, offloadBucketName, admin.adminSchemaPushed, Stdlib_Option.flatMap(hostUiBundle, cfg => cfg.bakedManifest), {})) : undefined;
|
|
2276
2288
|
let rm = admin.stateViewSlicesOutputs["UiFragments"];
|
|
2277
2289
|
if (rm !== undefined) {
|
|
@@ -2343,7 +2355,7 @@ function Make($star) {
|
|
|
2343
2355
|
});
|
|
2344
2356
|
let stackName = Pulumi.getStack();
|
|
2345
2357
|
let storeLayout = Util_StoreLayout$ReventlessAws.layoutFor(stackName, Util_HostUiDomain$ReventlessAws.resolveProdStacks());
|
|
2346
|
-
let storeProtection = Util_StoreLayout$ReventlessAws.
|
|
2358
|
+
let storeProtection = Util_StoreLayout$ReventlessAws.protectionOfDeployedStack();
|
|
2347
2359
|
let declaredStores = Stdlib_Array.reduce(Stdlib_Array.filterMap(capabilities, c => {
|
|
2348
2360
|
if (typeof c !== "object") {
|
|
2349
2361
|
return;
|
|
@@ -2699,6 +2711,9 @@ function Make($star) {
|
|
|
2699
2711
|
let startServers = () => {};
|
|
2700
2712
|
let deployPlugin = (plugin, apiTargetOpt) => {
|
|
2701
2713
|
let apiTarget = apiTargetOpt !== undefined ? apiTargetOpt : "Domain";
|
|
2714
|
+
if (Stdlib_Option.isNone(platformStackRef)) {
|
|
2715
|
+
Stdlib_JsError.throwWithMessage(`This plugin stack has no platform:stack setting, so it cannot find its platform. Set it to the platform's stack: pulumi config set platform:stack ` + (Pulumi.getOrganization() + `/<platform project>/` + Pulumi.getStack()));
|
|
2716
|
+
}
|
|
2702
2717
|
let tmp;
|
|
2703
2718
|
tmp = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
2704
2719
|
log.info("Platform:deployPlugin", undefined, `target=` + tmp);
|
|
@@ -2814,10 +2829,13 @@ function Make($star) {
|
|
|
2814
2829
|
if (missing.length !== 0) {
|
|
2815
2830
|
Stdlib_JsError.throwWithMessage(CapabilityNeed$Reventless.unmetMessage(missing) + Belt_SetString.toArray(Belt_SetString.fromArray(missing.map(u => {
|
|
2816
2831
|
let match = u.need;
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2832
|
+
switch (match) {
|
|
2833
|
+
case "Geocoding" :
|
|
2834
|
+
return `\n Geocoding is \`Capability_Geocoding_AwsLocation.make\`, passed to the platform as \`~geocoderPlaceIndex\`.`;
|
|
2835
|
+
case "Messaging" :
|
|
2836
|
+
return `\n Messaging is \`Capability_Messaging.make\`, passed to the platform as \`~messagingSender\`. The sender itself is configuration and has no default: set \`platform:messagingEmailSender\` in Pulumi.<stack>.yaml (or REVENTLESS_MESSAGING_EMAIL_SENDER), then verify the address with SES — or \`platform:messagingEmailProvider: log\` to log every message and send none.`;
|
|
2837
|
+
case "IdentityProvider" :
|
|
2838
|
+
return `\n IdentityProvider has no backend on any platform yet — the seam and the refusal exist, the Cognito and local implementations do not. A plugin declaring this need cannot be deployed until one lands; nothing about this deployment's configuration will change that.`;
|
|
2821
2839
|
}
|
|
2822
2840
|
}))).join(""));
|
|
2823
2841
|
}
|
package/src/Platform_Stack.res
CHANGED
|
@@ -12,15 +12,24 @@ type cognitoUserPool = {
|
|
|
12
12
|
is declared with the trigger's ARN), while the mutation that writes it is
|
|
13
13
|
provisioned after the API — see [Auth_ActiveRoleStore.res]. */
|
|
14
14
|
activeRoleTable: Auth_ActiveRoleStore.storeTable,
|
|
15
|
+
/** The sign-in attribute this stack created the pool with. `None` in BYO mode:
|
|
16
|
+
the pool's own choice was made elsewhere and no lookup here reads it back,
|
|
17
|
+
so reporting one would be a guess. */
|
|
18
|
+
loginIdentifier: option<Auth_LoginIdentifier.t>,
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* Resolve the Cognito UserPool used by AppSync auth. Two modes:
|
|
19
23
|
*
|
|
20
24
|
* - **Auto**: no `platform:identityProviderId` config — create a fresh UserPool
|
|
21
|
-
* with SPA-friendly defaults (email
|
|
22
|
-
*
|
|
23
|
-
*
|
|
25
|
+
* with SPA-friendly defaults (email sign-in unless `platform:loginIdentifier`
|
|
26
|
+
* says otherwise, 12-char password policy, no MFA, and admin-only user
|
|
27
|
+
* creation unless `platform:signUpMode` says otherwise), plus the
|
|
28
|
+
* administrator group named by [Reventless.AdminGroup] and an elevated-groups
|
|
29
|
+
* default naming it. What it does **not** create is the first administrator:
|
|
30
|
+
* accounts are not stack resources, and a pool full of them is not something a
|
|
31
|
+
* `pulumi destroy` should be able to empty. `provision-admin` makes that one,
|
|
32
|
+
* and no step of this needs the AWS console.
|
|
24
33
|
*
|
|
25
34
|
* - **BYO**: provider ID provided — skip pool creation, look up the existing
|
|
26
35
|
* pool via `aws.cognito.getUserPool` for its ARN. Lookup precedence
|
|
@@ -38,10 +47,21 @@ type cognitoUserPool = {
|
|
|
38
47
|
* Pulumi can destroy without touching the parent pool).
|
|
39
48
|
*
|
|
40
49
|
* Always exports `identityProviderId`, `identityProviderClientId`,
|
|
41
|
-
* `identityProviderArn`, `identityProviderRegion`, `identityProviderManaged
|
|
42
|
-
* `
|
|
43
|
-
*
|
|
44
|
-
*
|
|
50
|
+
* `identityProviderArn`, `identityProviderRegion`, `identityProviderManaged`,
|
|
51
|
+
* `identityProviderLoginIdentifier`, `identityProviderAdminGroup` and
|
|
52
|
+
* `activeRoleStore` as stack outputs so
|
|
53
|
+
* downstream stacks (and Stage D AppSync wiring) can read them via
|
|
54
|
+
* `StackReference` — plus, for one release, the deprecated `cognito*` spellings
|
|
55
|
+
* of the first five.
|
|
56
|
+
*
|
|
57
|
+
* 🚨 In auto mode `platform:loginIdentifier` picks the sign-in attribute, and it
|
|
58
|
+
* is the one setting no later deploy can correct: changing it replaces the pool
|
|
59
|
+
* and empties it. Absent means `email`. See [Auth_LoginIdentifier].
|
|
60
|
+
*
|
|
61
|
+
* `platform:signUpMode` decides whether a stranger may register themselves.
|
|
62
|
+
* Absent means `adminOnly`. It is the opposite kind of setting — an ordinary
|
|
63
|
+
* in-place update, free and reversible on a pool full of accounts — but on a
|
|
64
|
+
* pool shared between stacks the flip is pool-wide. See [Auth_SignUpMode].
|
|
45
65
|
*
|
|
46
66
|
* Also provisions the role-state table and the pre-token-generation trigger that
|
|
47
67
|
* narrows `cognito:groups` to a caller's chosen role. They belong here rather
|
|
@@ -86,6 +106,42 @@ let _identityProviderId = (~cfg: Pulumi.Config.t): option<string> => {
|
|
|
86
106
|
}
|
|
87
107
|
}
|
|
88
108
|
|
|
109
|
+
/** The sign-in attribute for a pool this stack creates, from
|
|
110
|
+
`platform:loginIdentifier` (or `REVENTLESS_LOGIN_IDENTIFIER` / the sidecar).
|
|
111
|
+
|
|
112
|
+
Absent means `email`, which is what every pool so far was created with. An
|
|
113
|
+
unrecognised spelling fails the deploy — see [Auth_LoginIdentifier] for why
|
|
114
|
+
defaulting past a typo here is unrecoverable. */
|
|
115
|
+
let _loginIdentifier = (~cfg: Pulumi.Config.t): Auth_LoginIdentifier.t => {
|
|
116
|
+
let raw = switch Util_LocalConfig.get("loginIdentifier") {
|
|
117
|
+
| Some(_) as v => v
|
|
118
|
+
| None => cfg->Pulumi.Config.get("loginIdentifier")
|
|
119
|
+
}
|
|
120
|
+
switch Auth_LoginIdentifier.parse(raw) {
|
|
121
|
+
| Ok(identifier) => identifier
|
|
122
|
+
| Error(message) => JsError.throwWithMessage(message)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Whether a stranger may create their own account in a pool this stack creates,
|
|
127
|
+
from `platform:signUpMode` (or `REVENTLESS_SIGN_UP_MODE` / the sidecar).
|
|
128
|
+
|
|
129
|
+
Absent means `adminOnly`, which is what every pool so far was created with, so
|
|
130
|
+
an existing stack redeploys unchanged. Unlike the sign-in attribute this is an
|
|
131
|
+
ordinary in-place update on a live pool — but an unrecognised spelling still
|
|
132
|
+
fails the deploy, because defaulting past it would refuse every registration
|
|
133
|
+
while the config read as if it allowed them. See [Auth_SignUpMode]. */
|
|
134
|
+
let _signUpMode = (~cfg: Pulumi.Config.t): Auth_SignUpMode.t => {
|
|
135
|
+
let raw = switch Util_LocalConfig.get("signUpMode") {
|
|
136
|
+
| Some(_) as v => v
|
|
137
|
+
| None => cfg->Pulumi.Config.get("signUpMode")
|
|
138
|
+
}
|
|
139
|
+
switch Auth_SignUpMode.parse(raw) {
|
|
140
|
+
| Ok(mode) => mode
|
|
141
|
+
| Error(message) => JsError.throwWithMessage(message)
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
89
145
|
let _resolveUncached = (): cognitoUserPool => {
|
|
90
146
|
let cfg = Pulumi.Config.make(Some("platform"))
|
|
91
147
|
let existingPoolId = _identityProviderId(~cfg)
|
|
@@ -183,11 +239,19 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
183
239
|
poolArn: lookup->Pulumi.Output.apply(r => r.arn),
|
|
184
240
|
managed: false,
|
|
185
241
|
activeRoleTable,
|
|
242
|
+
loginIdentifier: None,
|
|
186
243
|
}
|
|
187
244
|
|
|
188
245
|
| None =>
|
|
246
|
+
let loginIdentifier = _loginIdentifier(~cfg)
|
|
247
|
+
let signUpMode = _signUpMode(~cfg)
|
|
248
|
+
// In place, unlike the sign-in attribute below: `AdminCreateUserConfig` is a
|
|
249
|
+
// member of `UpdateUserPoolRequest`, so flipping this on a pool full of
|
|
250
|
+
// accounts is an ordinary update rather than a replacement.
|
|
189
251
|
let adminConfig: PulumiAws.Cognito.UserPool.adminCreateUserConfig = {
|
|
190
|
-
allowAdminCreateUserOnly: Pulumi.Input.make(
|
|
252
|
+
allowAdminCreateUserOnly: Pulumi.Input.make(
|
|
253
|
+
signUpMode->Auth_SignUpMode.allowAdminCreateUserOnly,
|
|
254
|
+
),
|
|
191
255
|
}
|
|
192
256
|
let pwdPolicy: PulumiAws.Cognito.UserPool.passwordPolicy = {
|
|
193
257
|
minimumLength: Pulumi.Input.make(12),
|
|
@@ -204,7 +268,13 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
204
268
|
~name="HostUiPool",
|
|
205
269
|
~args={
|
|
206
270
|
adminCreateUserConfig: Pulumi.Input.make(adminConfig),
|
|
207
|
-
|
|
271
|
+
// 🚨 Changing this on a live stack replaces the pool and empties it —
|
|
272
|
+
// Cognito has no update for the sign-in attribute. Chosen once, here.
|
|
273
|
+
usernameAttributes: Pulumi.Input.make(
|
|
274
|
+
loginIdentifier
|
|
275
|
+
->Auth_LoginIdentifier.usernameAttributes
|
|
276
|
+
->Array.map(Pulumi.Input.make),
|
|
277
|
+
),
|
|
208
278
|
passwordPolicy: Pulumi.Input.make(pwdPolicy),
|
|
209
279
|
mfaConfiguration: Pulumi.Input.make("OFF"),
|
|
210
280
|
lambdaConfig: Pulumi.Input.make({
|
|
@@ -219,6 +289,23 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
219
289
|
},
|
|
220
290
|
)
|
|
221
291
|
|
|
292
|
+
// The administrator group, declared beside the pool that holds it.
|
|
293
|
+
//
|
|
294
|
+
// Auto mode only, and the restriction is the point: a group is a pool-level
|
|
295
|
+
// fact, and on a pool this stack does not own those are not this stack's to
|
|
296
|
+
// declare. Two stacks pointed at one shared provider would each declare this
|
|
297
|
+
// group, and the second would fail on a name that already exists — the same
|
|
298
|
+
// split, for the same reason, as [Auth_SignUpMode] and the active-role store.
|
|
299
|
+
// The BYO half is `provision-admin`, which creates the group beside the first
|
|
300
|
+
// administrator who needs it.
|
|
301
|
+
//
|
|
302
|
+
// An ordinary child resource: the pool is ours, so this needs no out-of-band
|
|
303
|
+
// call and Pulumi's state stays the authority for whether it exists.
|
|
304
|
+
let _adminGroup = Util_CognitoGroupUser.addUserGroup(
|
|
305
|
+
~name=Reventless.AdminGroup.name,
|
|
306
|
+
~userPoolId=pool.id,
|
|
307
|
+
)
|
|
308
|
+
|
|
222
309
|
let tokenUnits2: PulumiAws.Cognito.UserPoolClient.tokenValidityUnits = {
|
|
223
310
|
accessToken: Pulumi.Input.make("minutes"),
|
|
224
311
|
idToken: Pulumi.Input.make("minutes"),
|
|
@@ -247,6 +334,7 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
247
334
|
poolArn: pool.arn,
|
|
248
335
|
managed: true,
|
|
249
336
|
activeRoleTable,
|
|
337
|
+
loginIdentifier: Some(loginIdentifier),
|
|
250
338
|
}
|
|
251
339
|
}
|
|
252
340
|
|
|
@@ -279,11 +367,23 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
279
367
|
let managedStr = Pulumi.Output.make(result.managed ? "true" : "false")
|
|
280
368
|
let regionOutput = Pulumi.Output.make(regionStr)
|
|
281
369
|
|
|
370
|
+
// The sign-in attribute is unchangeable after creation, so the value a pool was
|
|
371
|
+
// born with has to be readable somewhere other than the source that has since
|
|
372
|
+
// moved on. `unknown` for a BYO pool: this stack did not choose it and does not
|
|
373
|
+
// read it back.
|
|
374
|
+
let loginIdentifierStr = Pulumi.Output.make(
|
|
375
|
+
switch result.loginIdentifier {
|
|
376
|
+
| Some(identifier) => Auth_LoginIdentifier.toString(identifier)
|
|
377
|
+
| None => "unknown"
|
|
378
|
+
},
|
|
379
|
+
)
|
|
380
|
+
|
|
282
381
|
Pulumi.Pulumi.export("identityProviderId", result.poolId)
|
|
283
382
|
Pulumi.Pulumi.export("identityProviderClientId", result.clientId)
|
|
284
383
|
Pulumi.Pulumi.export("identityProviderArn", result.poolArn)
|
|
285
384
|
Pulumi.Pulumi.export("identityProviderRegion", regionOutput)
|
|
286
385
|
Pulumi.Pulumi.export("identityProviderManaged", managedStr)
|
|
386
|
+
Pulumi.Pulumi.export("identityProviderLoginIdentifier", loginIdentifierStr)
|
|
287
387
|
|
|
288
388
|
// Deprecated spellings — see above.
|
|
289
389
|
Pulumi.Pulumi.export("cognitoUserPoolId", result.poolId)
|
|
@@ -292,6 +392,16 @@ let _resolveUncached = (): cognitoUserPool => {
|
|
|
292
392
|
Pulumi.Pulumi.export("cognitoRegion", regionOutput)
|
|
293
393
|
Pulumi.Pulumi.export("cognitoUserPoolManaged", managedStr)
|
|
294
394
|
|
|
395
|
+
// The group that administers this deployment, readable without reading source.
|
|
396
|
+
// `provision-admin` puts its first user in it, and a deployment overriding who
|
|
397
|
+
// is elevated needs to know which name it is overriding.
|
|
398
|
+
//
|
|
399
|
+
// Exported in both pool modes although only auto mode *declares* the group: the
|
|
400
|
+
// name is what a caller needs either way, and an output that appeared in one
|
|
401
|
+
// mode and not the other would read as "there is no administrator group here"
|
|
402
|
+
// rather than "this stack did not create it".
|
|
403
|
+
Pulumi.Pulumi.export("identityProviderAdminGroup", Pulumi.Output.make(Reventless.AdminGroup.name))
|
|
404
|
+
|
|
295
405
|
// Exported so an operator can read back the store this provider resolved to —
|
|
296
406
|
// the name is derived, not configured, so this is a convenience for checking
|
|
297
407
|
// rather than a value anything is meant to copy into a config.
|
|
@@ -4,10 +4,15 @@ import * as Aws from "@pulumi/aws";
|
|
|
4
4
|
import * as Pulumi$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Pulumi.res.mjs";
|
|
5
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
6
|
import * as Pulumi from "@pulumi/pulumi";
|
|
7
|
+
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
8
|
+
import * as AdminGroup$Reventless from "@reventlessdev/reventless-spec/src/types/AdminGroup.res.mjs";
|
|
7
9
|
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
8
10
|
import * as AWS_Tags$ReventlessAws from "./adapter/AWS_Tags.res.mjs";
|
|
11
|
+
import * as Auth_SignUpMode$ReventlessAws from "./adapter/Auth/Auth_SignUpMode.res.mjs";
|
|
9
12
|
import * as Util_LocalConfig$ReventlessAws from "./util/Util_LocalConfig.res.mjs";
|
|
10
13
|
import * as Auth_ActiveRoleStore$ReventlessAws from "./adapter/Auth/Auth_ActiveRoleStore.res.mjs";
|
|
14
|
+
import * as Auth_LoginIdentifier$ReventlessAws from "./adapter/Auth/Auth_LoginIdentifier.res.mjs";
|
|
15
|
+
import * as Util_CognitoGroupUser$ReventlessAws from "./util/Util_CognitoGroupUser.res.mjs";
|
|
11
16
|
import * as Auth_ActiveRoleTrigger$ReventlessAws from "./adapter/Auth/Auth_ActiveRoleTrigger.res.mjs";
|
|
12
17
|
import * as Auth_ActiveRolePoolAttachment$ReventlessAws from "./adapter/Auth/Auth_ActiveRolePoolAttachment.res.mjs";
|
|
13
18
|
|
|
@@ -35,6 +40,28 @@ function _identityProviderId(cfg) {
|
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
function _loginIdentifier(cfg) {
|
|
44
|
+
let v = Util_LocalConfig$ReventlessAws.get("loginIdentifier");
|
|
45
|
+
let raw = v !== undefined ? v : cfg.get("loginIdentifier");
|
|
46
|
+
let identifier = Auth_LoginIdentifier$ReventlessAws.parse(raw);
|
|
47
|
+
if (identifier.TAG === "Ok") {
|
|
48
|
+
return identifier._0;
|
|
49
|
+
} else {
|
|
50
|
+
return Stdlib_JsError.throwWithMessage(identifier._0);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function _signUpMode(cfg) {
|
|
55
|
+
let v = Util_LocalConfig$ReventlessAws.get("signUpMode");
|
|
56
|
+
let raw = v !== undefined ? v : cfg.get("signUpMode");
|
|
57
|
+
let mode = Auth_SignUpMode$ReventlessAws.parse(raw);
|
|
58
|
+
if (mode.TAG === "Ok") {
|
|
59
|
+
return mode._0;
|
|
60
|
+
} else {
|
|
61
|
+
return Stdlib_JsError.throwWithMessage(mode._0);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
38
65
|
function _resolveUncached() {
|
|
39
66
|
let cfg = new Pulumi.Config("platform");
|
|
40
67
|
let existingPoolId = _identityProviderId(cfg);
|
|
@@ -77,11 +104,14 @@ function _resolveUncached() {
|
|
|
77
104
|
clientId: client.id,
|
|
78
105
|
poolArn: lookup.apply(r => r.arn),
|
|
79
106
|
managed: false,
|
|
80
|
-
activeRoleTable: activeRoleTable
|
|
107
|
+
activeRoleTable: activeRoleTable,
|
|
108
|
+
loginIdentifier: undefined
|
|
81
109
|
};
|
|
82
110
|
} else {
|
|
111
|
+
let loginIdentifier = _loginIdentifier(cfg);
|
|
112
|
+
let signUpMode = _signUpMode(cfg);
|
|
83
113
|
let adminConfig = {
|
|
84
|
-
allowAdminCreateUserOnly:
|
|
114
|
+
allowAdminCreateUserOnly: Auth_SignUpMode$ReventlessAws.allowAdminCreateUserOnly(signUpMode)
|
|
85
115
|
};
|
|
86
116
|
let pwdPolicy_minimumLength = 12;
|
|
87
117
|
let pwdPolicy_requireLowercase = true;
|
|
@@ -98,11 +128,12 @@ function _resolveUncached() {
|
|
|
98
128
|
preTokenGeneration: activeRoleTrigger.functionArn
|
|
99
129
|
},
|
|
100
130
|
adminCreateUserConfig: adminConfig,
|
|
101
|
-
usernameAttributes:
|
|
131
|
+
usernameAttributes: Auth_LoginIdentifier$ReventlessAws.usernameAttributes(loginIdentifier).map(prim => prim),
|
|
102
132
|
passwordPolicy: pwdPolicy,
|
|
103
133
|
mfaConfiguration: "OFF",
|
|
104
134
|
tags: AWS_Tags$ReventlessAws.make("HostUiPool", "Platform", "Auth", "Platform", undefined, undefined, undefined, undefined)
|
|
105
135
|
});
|
|
136
|
+
Util_CognitoGroupUser$ReventlessAws.addUserGroup(AdminGroup$Reventless.name, pool.id);
|
|
106
137
|
let tokenUnits2_accessToken = "minutes";
|
|
107
138
|
let tokenUnits2_idToken = "minutes";
|
|
108
139
|
let tokenUnits2_refreshToken = "days";
|
|
@@ -129,23 +160,28 @@ function _resolveUncached() {
|
|
|
129
160
|
clientId: client$1.id,
|
|
130
161
|
poolArn: pool.arn,
|
|
131
162
|
managed: true,
|
|
132
|
-
activeRoleTable: activeRoleTable
|
|
163
|
+
activeRoleTable: activeRoleTable,
|
|
164
|
+
loginIdentifier: loginIdentifier
|
|
133
165
|
};
|
|
134
166
|
}
|
|
135
167
|
Auth_ActiveRoleTrigger$ReventlessAws.grantInvoke(activeRoleTrigger, result.poolArn, undefined, {});
|
|
136
168
|
let regionStr = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
137
169
|
let managedStr = Pulumi.output(result.managed ? "true" : "false");
|
|
138
170
|
let regionOutput = Pulumi.output(regionStr);
|
|
171
|
+
let identifier = result.loginIdentifier;
|
|
172
|
+
let loginIdentifierStr = Pulumi.output(identifier !== undefined ? Auth_LoginIdentifier$ReventlessAws.toString(identifier) : "unknown");
|
|
139
173
|
Pulumi$Pulumi.$$export("identityProviderId", result.poolId);
|
|
140
174
|
Pulumi$Pulumi.$$export("identityProviderClientId", result.clientId);
|
|
141
175
|
Pulumi$Pulumi.$$export("identityProviderArn", result.poolArn);
|
|
142
176
|
Pulumi$Pulumi.$$export("identityProviderRegion", regionOutput);
|
|
143
177
|
Pulumi$Pulumi.$$export("identityProviderManaged", managedStr);
|
|
178
|
+
Pulumi$Pulumi.$$export("identityProviderLoginIdentifier", loginIdentifierStr);
|
|
144
179
|
Pulumi$Pulumi.$$export("cognitoUserPoolId", result.poolId);
|
|
145
180
|
Pulumi$Pulumi.$$export("cognitoUserPoolClientId", result.clientId);
|
|
146
181
|
Pulumi$Pulumi.$$export("cognitoUserPoolArn", result.poolArn);
|
|
147
182
|
Pulumi$Pulumi.$$export("cognitoRegion", regionOutput);
|
|
148
183
|
Pulumi$Pulumi.$$export("cognitoUserPoolManaged", managedStr);
|
|
184
|
+
Pulumi$Pulumi.$$export("identityProviderAdminGroup", Pulumi.output(AdminGroup$Reventless.name));
|
|
149
185
|
Pulumi$Pulumi.$$export("activeRoleStore", result.activeRoleTable.name);
|
|
150
186
|
return result;
|
|
151
187
|
}
|
|
@@ -168,6 +204,8 @@ export {
|
|
|
168
204
|
log,
|
|
169
205
|
_deprecatedPoolIdKey,
|
|
170
206
|
_identityProviderId,
|
|
207
|
+
_loginIdentifier,
|
|
208
|
+
_signUpMode,
|
|
171
209
|
_resolveUncached,
|
|
172
210
|
_cached,
|
|
173
211
|
resolveCognitoUserPool,
|
|
@@ -217,11 +217,7 @@ let make = (
|
|
|
217
217
|
~bundleRuntimeExtensions=false,
|
|
218
218
|
)
|
|
219
219
|
|
|
220
|
-
let layers =
|
|
221
|
-
Lambda.reventlessLayerArn
|
|
222
|
-
->Option.map(arn => [arn->Pulumi.Input.make])
|
|
223
|
-
->Option.getOr([])
|
|
224
|
-
->Pulumi.Input.make
|
|
220
|
+
let layers = Lambda.reventlessLayers()
|
|
225
221
|
|
|
226
222
|
// Created before the function that writes to it — see
|
|
227
223
|
// `Util_LambdaLogging.makeManagedLogGroup` for why the ordering matters.
|
|
@@ -116,7 +116,7 @@ function make(api, pluginReadModelTableName, offloadBucketName, schemaReady, bak
|
|
|
116
116
|
"adminEntry.json",
|
|
117
117
|
adminEntryJson
|
|
118
118
|
]]), false);
|
|
119
|
-
let layers =
|
|
119
|
+
let layers = Lambda$PulumiAws.reventlessLayers();
|
|
120
120
|
let logGroup = Util_LambdaLogging$ReventlessAws.makeManagedLogGroup(name + "Lambda", undefined, AWS_Tags$ReventlessAws.make(name + "LambdaLogGroup", "Platform", "Logs", "Platform", undefined, undefined, undefined, undefined), opts$1, undefined);
|
|
121
121
|
let lambda = new (Aws.lambda.Function)(name + "Lambda", {
|
|
122
122
|
handler: "index.handler",
|
|
@@ -89,11 +89,7 @@ let make = (
|
|
|
89
89
|
~bundleRuntimeExtensions=false,
|
|
90
90
|
)
|
|
91
91
|
|
|
92
|
-
let layers =
|
|
93
|
-
Lambda.reventlessLayerArn
|
|
94
|
-
->Option.map(arn => [arn->Pulumi.Input.make])
|
|
95
|
-
->Option.getOr([])
|
|
96
|
-
->Pulumi.Input.make
|
|
92
|
+
let layers = Lambda.reventlessLayers()
|
|
97
93
|
|
|
98
94
|
// Created before the function that writes to it — see
|
|
99
95
|
// `Util_LambdaLogging.makeManagedLogGroup` for why the ordering matters.
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import * as Aws from "@pulumi/aws";
|
|
4
4
|
import * as IAM$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/IAM.res.mjs";
|
|
5
5
|
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
6
|
-
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
7
6
|
import * as Pulumi from "@pulumi/pulumi";
|
|
8
7
|
import * as Lambda$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Lambda/Lambda.res.mjs";
|
|
9
8
|
import * as AWS$ReventlessAws from "../AWS.res.mjs";
|
|
@@ -53,7 +52,7 @@ function make(api, uiFragmentRegistryTableName, schemaReady, opts) {
|
|
|
53
52
|
Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, "@reventlessdev/reventless-aws")
|
|
54
53
|
]]);
|
|
55
54
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res.mjs", packageDirs, undefined, false);
|
|
56
|
-
let layers =
|
|
55
|
+
let layers = Lambda$PulumiAws.reventlessLayers();
|
|
57
56
|
let logGroup = Util_LambdaLogging$ReventlessAws.makeManagedLogGroup(name + "Lambda", undefined, AWS_Tags$ReventlessAws.make(name + "LambdaLogGroup", "Platform", "Logs", "Platform", undefined, undefined, undefined, undefined), opts$1, undefined);
|
|
58
57
|
let lambda = new (Aws.lambda.Function)(name + "Lambda", {
|
|
59
58
|
handler: "index.handler",
|
|
@@ -261,11 +261,7 @@ let makeWriteDoor = (
|
|
|
261
261
|
~bundleRuntimeExtensions=false,
|
|
262
262
|
)
|
|
263
263
|
|
|
264
|
-
let layers =
|
|
265
|
-
Lambda.reventlessLayerArn
|
|
266
|
-
->Option.map(arn => [arn->Pulumi.Input.make])
|
|
267
|
-
->Option.getOr([])
|
|
268
|
-
->Pulumi.Input.make
|
|
264
|
+
let layers = Lambda.reventlessLayers()
|
|
269
265
|
|
|
270
266
|
let logGroup = Util_LambdaLogging.makeManagedLogGroup(
|
|
271
267
|
~name=name ++ "Lambda",
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import * as Aws from "@pulumi/aws";
|
|
4
4
|
import * as IAM$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/IAM.res.mjs";
|
|
5
5
|
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
6
|
-
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
7
6
|
import * as Pulumi from "@pulumi/pulumi";
|
|
8
7
|
import * as Lambda$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Lambda/Lambda.res.mjs";
|
|
9
8
|
import * as AWS$ReventlessAws from "../AWS.res.mjs";
|
|
@@ -136,7 +135,7 @@ function makeWriteDoor(api, table, cognitoUserPoolId, cognitoUserPoolArn, nameOp
|
|
|
136
135
|
Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, "@reventlessdev/reventless-aws")
|
|
137
136
|
]]);
|
|
138
137
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Auth/Auth_ActiveRoleStore_Ops.res.mjs", packageDirs, undefined, false);
|
|
139
|
-
let layers =
|
|
138
|
+
let layers = Lambda$PulumiAws.reventlessLayers();
|
|
140
139
|
let logGroup = Util_LambdaLogging$ReventlessAws.makeManagedLogGroup(name + "Lambda", undefined, AWS_Tags$ReventlessAws.make(name + "LambdaLogGroup", "Platform", "Logs", "Platform", undefined, undefined, undefined, undefined), opts$1, undefined);
|
|
141
140
|
let lambda = new (Aws.lambda.Function)(name + "Lambda", {
|
|
142
141
|
handler: "index.handler",
|
|
@@ -99,11 +99,7 @@ let make = (
|
|
|
99
99
|
~bundleRuntimeExtensions=false,
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
-
let layers =
|
|
103
|
-
Lambda.reventlessLayerArn
|
|
104
|
-
->Option.map(arn => [arn->Pulumi.Input.make])
|
|
105
|
-
->Option.getOr([])
|
|
106
|
-
->Pulumi.Input.make
|
|
102
|
+
let layers = Lambda.reventlessLayers()
|
|
107
103
|
|
|
108
104
|
let logGroup = Util_LambdaLogging.makeManagedLogGroup(
|
|
109
105
|
~name,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import * as Aws from "@pulumi/aws";
|
|
4
4
|
import * as IAM$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/IAM.res.mjs";
|
|
5
|
-
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
5
|
import * as Pulumi from "@pulumi/pulumi";
|
|
7
6
|
import * as Lambda$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Lambda/Lambda.res.mjs";
|
|
8
7
|
import * as AWS$ReventlessAws from "../AWS.res.mjs";
|
|
@@ -45,7 +44,7 @@ function make(activeRoleTableName, activeRoleTableArn, nameOpt, opts) {
|
|
|
45
44
|
]]);
|
|
46
45
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res.mjs", packageDirs, undefined, false);
|
|
47
46
|
let sourceCodeHash = match.sourceCodeHash;
|
|
48
|
-
let layers =
|
|
47
|
+
let layers = Lambda$PulumiAws.reventlessLayers();
|
|
49
48
|
let logGroup = Util_LambdaLogging$ReventlessAws.makeManagedLogGroup(name, undefined, AWS_Tags$ReventlessAws.make(name + "LogGroup", "Platform", "Logs", "Platform", undefined, undefined, undefined, undefined), opts$1, undefined);
|
|
50
49
|
let lambda = new (Aws.lambda.Function)(name, {
|
|
51
50
|
handler: "index.handler",
|