@reventlessdev/reventless-aws 3.0.0-alpha.343 → 3.0.0-alpha.345
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 +15 -0
- package/package.json +11 -11
- package/scripts/ProvisionIdentity.res +8 -3
- package/src/Platform.res +327 -328
- package/src/Platform.res.mjs +4 -2
- package/src/Platform_Casts.res +13 -4
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res +8 -4
- package/src/adapter/Api/AppSync_EventsApi.res +12 -14
- package/src/adapter/Api/AppSync_Resolver_Native.res +3 -4
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +78 -70
- package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +11 -8
- package/src/adapter/Api/Platform_AdminScan_Ops.res +15 -14
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +10 -2
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +40 -50
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +39 -32
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +5 -2
- package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +0 -1
- package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -2
- package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -4
- package/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res +5 -2
- package/src/adapter/Auth/Auth_Cognito.res +3 -9
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +1 -4
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +3 -1
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +1 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +6 -1
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +24 -18
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +9 -4
- package/src/adapter/CommandTopic/CommandTopicRegistry.res +1 -4
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +15 -15
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +9 -5
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +179 -213
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +5 -5
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +6 -2
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +6 -3
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +6 -1
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +13 -17
- package/src/adapter/EventLog/EventLogStorage_Postgres.res +7 -4
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +12 -7
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +4 -2
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +3 -2
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +20 -12
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +21 -9
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -3
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +6 -3
- package/src/adapter/Mcp/MCP_Lambda.res +31 -46
- package/src/adapter/Messaging/Messaging_Ses_Backend.res +11 -7
- package/src/adapter/Messaging/Messaging_Ses_Backend.res.mjs +2 -4
- package/src/adapter/Monitoring/Monitoring_CloudWatch.res +16 -16
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +5 -10
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +4 -2
- package/src/adapter/Postgres/PgConnection.res +6 -5
- package/src/adapter/Postgres/PgMigration_Builder.res +4 -8
- package/src/adapter/Postgres/PgRuntime.res +4 -7
- package/src/adapter/QueryDb/PgQueryResolver_Builder.res +9 -11
- package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +22 -21
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +114 -111
- package/src/adapter/QueryDb/QueryDbResolvers_Lambda.res +1 -7
- package/src/adapter/QueryDb/QueryDbStorage.res +4 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +23 -24
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +8 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +71 -73
- package/src/adapter/QueryDb/QueryDbStorage_Postgres.res +5 -2
- package/src/adapter/QueryDb/QueryInterceptor_Provisioning.res +1 -4
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +8 -2
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +73 -81
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +72 -78
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +53 -82
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +47 -77
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +18 -11
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +80 -97
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res +2 -7
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -10
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +24 -15
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +17 -37
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +31 -57
- package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +18 -24
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -5
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +4 -3
- package/src/adapter/Runtime/HeartbeatEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +4 -2
- package/src/adapter/Runtime/PgMigrationEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +3 -2
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +1 -2
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +4 -5
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +22 -10
- package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +8 -2
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +14 -31
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -17
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +10 -9
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +46 -52
- package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +36 -41
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +31 -37
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +6 -7
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +4 -6
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +2 -6
- package/src/adapter/StateTopic/StateTopic_AppSync.res +21 -16
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +36 -32
- package/src/adapter/Task/TaskBucket_S3.res +6 -1
- package/src/adapter/Upload/Upload_Claim_S3.res +17 -20
- package/src/adapter/Upload/Upload_Claim_S3_Ops.res +5 -2
- package/src/adapter/Upload/Upload_Presign_S3.res +51 -49
- package/src/capability/Capability_Geocoding_AwsLocation.res +4 -1
- package/src/capability/Capability_Messaging.res +4 -5
- package/src/capability/Capability_Messaging_Ses.res +3 -1
- package/src/capability/Capability_ObjectStore_S3.res +1 -7
- package/src/components/Api/AppSync_Adapter.res +28 -41
- package/src/components/Api/AppSync_SdlDecorate.res +38 -30
- package/src/components/AutomationSlice_Builder.res +6 -4
- package/src/components/ExtensionPoint_Builder.res +9 -10
- package/src/components/InboundTranslationSlice_Builder.res +7 -8
- package/src/components/OutboundTranslationSlice_Builder.res +14 -8
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
- package/src/components/SideEffectHandler_Single.res +4 -4
- package/src/components/StateViewSlice_Builder.res +6 -4
- package/src/components/StateViewSlice_Builder_Stream.res +6 -4
- package/src/components/Task_Builder_PerBucket.res +10 -11
- package/src/plugin/cloner/ClonerRunner_Fargate.res +3 -10
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +1 -4
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +5 -5
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +19 -21
- package/src/plugin/runtime/PluginRuntime_Builder.res +167 -188
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +6 -5
- package/src/plugin/stack/Plugin_Stack.res +104 -103
- package/src/util/Util_AlarmSpec.res +2 -1
- package/src/util/Util_AppSync.res +8 -2
- package/src/util/Util_AppSync_Caller.res +15 -14
- package/src/util/Util_Bundle.res +144 -67
- package/src/util/Util_Bundle.res.mjs +64 -13
- package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
- package/src/util/Util_Cognito_Runtime.res +11 -7
- package/src/util/Util_DeadLetterQueue.res +12 -2
- package/src/util/Util_DynamoDb.res +5 -3
- package/src/util/Util_DynamoDbStream.res +7 -3
- package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
- package/src/util/Util_DynamoDb_Runtime.res +23 -41
- package/src/util/Util_HostUiDomain.res +6 -1
- package/src/util/Util_Kinesis_Runtime.res +10 -11
- package/src/util/Util_Lambda.res +12 -5
- package/src/util/Util_LambdaEnvBudget.res +5 -5
- package/src/util/Util_LambdaLogging.res +1 -2
- package/src/util/Util_LogGroup_Adopting.res +1 -4
- package/src/util/Util_ResourceNaming.res +1 -2
- package/src/util/Util_SNS.res +8 -3
- package/src/util/Util_SNS_FIFO.res +1 -1
- package/src/util/Util_SNS_Runtime.res +11 -10
- package/src/util/Util_SQS.res +4 -2
- package/src/util/Util_SQS_FIFO.res +5 -2
- package/src/util/Util_SQS_Runtime.res +37 -36
- package/src/util/Util_ShellConfig.res +3 -2
- package/src/util/Util_StaticBundle.res +1 -3
- package/src/util/Util_StoreLayout.res +4 -1
- package/tests/AWS_TagsTest.res +16 -5
- package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
- package/tests/AppSync_AdapterTest.res +203 -224
- package/tests/AppSync_Resolver_RetryingTest.res +64 -44
- package/tests/AppSync_RetirementNarrowingTest.res +59 -46
- package/tests/AppSync_SdlDecorateTest.res +22 -20
- package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
- package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
- package/tests/Auth_ActiveRoleStoreTest.res +12 -9
- package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
- package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
- package/tests/Auth_CognitoTest.res +31 -46
- package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
- package/tests/BakeConvergenceTest.res +22 -25
- package/tests/Capability_MessagingTest.res +28 -12
- package/tests/CommandTopicQueuePolicyTest.res +1 -2
- package/tests/CounterEntryPoint_OpsTest.res +3 -7
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
- package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
- package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
- package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
- package/tests/EventCollectorReadyGateTest.res +5 -4
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
- package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
- package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
- package/tests/HandlerFactoryDispatchTest.res +97 -70
- package/tests/MCP_LambdaTest.res +16 -27
- package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
- package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
- package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
- package/tests/PgPipeline_IntegrationTest.res +80 -66
- package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
- package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
- package/tests/PgQueryResolver_LambdaTest.res +41 -24
- package/tests/Platform_AdminScan_OpsTest.res +4 -1
- package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
- package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
- package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
- package/tests/ProvisionIdentityTest.res +2 -6
- package/tests/QueryDbOwnerIndexTableTest.res +6 -4
- package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
- package/tests/QueryInterceptor_LambdaTest.res +11 -13
- package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
- package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
- package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
- package/tests/StateChangeDescriptorParityTest.res +28 -26
- package/tests/StateTopicKeySchemaTest.res +18 -15
- package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
- package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
- package/tests/Upload_ClaimTest.res +3 -3
- package/tests/Util_AwsErrorTest.res +4 -7
- package/tests/Util_BundleDependencyClosureTest.res +41 -3
- package/tests/Util_BundleDependencyClosureTest.res.mjs +11 -0
- package/tests/Util_BundleEsmLoaderTest.res +3 -3
- package/tests/Util_BundleResolveTest.res +4 -6
- package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
- package/tests/Util_DcbMetricsTest.res +6 -6
- package/tests/Util_DynamoDbStreamTest.res +4 -5
- package/tests/Util_DynamoDbTest.res +3 -2
- package/tests/Util_LambdaEnvBudgetTest.res +22 -18
- package/tests/Util_LambdaLoggingTest.res +9 -8
- package/tests/Util_LogGroup_AdoptingTest.res +10 -5
- package/tests/Util_LogRetentionTest.res +6 -2
- package/tests/Util_OwnerScopeEnvTest.res +10 -8
- package/tests/Util_SQS_RuntimeTest.res +5 -7
- package/tests/Util_ShellConfigTest.res +7 -17
- package/tests/Util_StaticBundleTest.res +3 -8
- package/tests/Util_StoreLayoutTest.res +17 -12
- package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
- package/tests/integration/DcbIntegrationHarness.res +8 -8
- package/tests/integration/EpCompositeSlice.res +16 -8
- package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
- package/tests/integration/SvsTestSlice_Projection.res +1 -3
- package/tests/util/Util_AlarmSpecTest.res +62 -49
|
@@ -25,7 +25,10 @@ let defaultIntendedUse = "SingleUse"
|
|
|
25
25
|
|
|
26
26
|
/** Create a place index with framework attribution tags and config-driven
|
|
27
27
|
provider/retention settings. */
|
|
28
|
-
let make = (
|
|
28
|
+
let make = (
|
|
29
|
+
~name: string,
|
|
30
|
+
~opts: option<Pulumi.CustomResourceOptions.t>=?,
|
|
31
|
+
): ReventlessInfra.Platform.geocoderIndex => {
|
|
29
32
|
let dataSource = Util_LocalConfig.get("geocoderDataSource")->Option.getOr(defaultDataSource)
|
|
30
33
|
let intendedUse = Util_LocalConfig.get("geocoderIntendedUse")->Option.getOr(defaultIntendedUse)
|
|
31
34
|
|
|
@@ -80,8 +80,7 @@ let parseEmailProvider = (raw: string): emailProvider =>
|
|
|
80
80
|
| other =>
|
|
81
81
|
JsError.throwWithMessage(
|
|
82
82
|
`platform:${emailProviderKey} is "${other}", which is not an email provider.\n` ++
|
|
83
|
-
` Known values: "ses" (default — a verified SES identity) and "log" ` ++
|
|
84
|
-
`(writes each message to the log, sends nothing).`,
|
|
83
|
+
` Known values: "ses" (default — a verified SES identity) and "log" ` ++ `(writes each message to the log, sends nothing).`,
|
|
85
84
|
)
|
|
86
85
|
}
|
|
87
86
|
|
|
@@ -121,11 +120,11 @@ let make = (
|
|
|
121
120
|
// Asked for SES and named no address. Nothing is provisioned, and the deploy
|
|
122
121
|
// gate refuses this the moment a plugin declares it needs messaging — here
|
|
123
122
|
// rather than there because this module has no view of what the plugins want.
|
|
124
|
-
| (Ses, None) => {emailProvider: providerInput,
|
|
123
|
+
| (Ses, None) => {emailProvider: providerInput, ?smsSender}
|
|
125
124
|
| (Ses, Some(address)) => {
|
|
126
125
|
emailSender: Capability_Messaging_Ses.emailSender(~name, ~address, ~displayName, ~opts?),
|
|
127
126
|
emailProvider: providerInput,
|
|
128
|
-
|
|
127
|
+
?smsSender,
|
|
129
128
|
}
|
|
130
129
|
| (Log, address) => {
|
|
131
130
|
emailSender: Pulumi.Input.make(
|
|
@@ -135,7 +134,7 @@ let make = (
|
|
|
135
134
|
),
|
|
136
135
|
),
|
|
137
136
|
emailProvider: providerInput,
|
|
138
|
-
|
|
137
|
+
?smsSender,
|
|
139
138
|
}
|
|
140
139
|
}
|
|
141
140
|
}
|
|
@@ -39,6 +39,8 @@ let emailSender = (
|
|
|
39
39
|
): Pulumi.Input.t<string> => {
|
|
40
40
|
let identity = SES.EmailIdentity.make(~name, ~args={email: address}, ~opts?)
|
|
41
41
|
identity.email
|
|
42
|
-
->Pulumi.Output.apply(verified =>
|
|
42
|
+
->Pulumi.Output.apply(verified =>
|
|
43
|
+
Reventless.Messaging.fromHeader(~displayName, ~address=verified)
|
|
44
|
+
)
|
|
43
45
|
->Pulumi.Output.asInput
|
|
44
46
|
}
|
|
@@ -138,13 +138,7 @@ let make = (
|
|
|
138
138
|
corsRules: corsRules->Pulumi.Input.make,
|
|
139
139
|
forceDestroy: forceDestroy->Pulumi.Input.make,
|
|
140
140
|
lifecycleRules: lifecycleRules->Pulumi.Input.make,
|
|
141
|
-
tags: AWS.Tags.make(
|
|
142
|
-
~name,
|
|
143
|
-
~kind,
|
|
144
|
-
~role=Other("ObjectStore"),
|
|
145
|
-
~scope,
|
|
146
|
-
~plugin?,
|
|
147
|
-
),
|
|
141
|
+
tags: AWS.Tags.make(~name, ~kind, ~role=Other("ObjectStore"), ~scope, ~plugin?),
|
|
148
142
|
},
|
|
149
143
|
~opts,
|
|
150
144
|
)
|
|
@@ -45,13 +45,11 @@ let startSchemaCreation = (client: appSyncClient, input: startSchemaCreationInpu
|
|
|
45
45
|
// jittered exponential backoff so a losing call can wait for the in-progress
|
|
46
46
|
// schema to finish and try again. Permanent errors (e.g. invalid SDL) are not
|
|
47
47
|
// retried — see AppSync_Error.classify.
|
|
48
|
-
let startSchemaCreationRetrying = (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
~catch=AppSync_Error.classify,
|
|
54
|
-
() => startSchemaCreation(client, input)->Promise.then(_ => Promise.resolve()),
|
|
48
|
+
let startSchemaCreationRetrying = (client: appSyncClient, input: startSchemaCreationInput): promise<
|
|
49
|
+
unit,
|
|
50
|
+
> => {
|
|
51
|
+
Effect.tryPromise(~catch=AppSync_Error.classify, () =>
|
|
52
|
+
startSchemaCreation(client, input)->Promise.then(_ => Promise.resolve())
|
|
55
53
|
)
|
|
56
54
|
->Effect.retry(AppSync_Error.retrySchedule)
|
|
57
55
|
->Effect.runPromise
|
|
@@ -67,13 +65,13 @@ external makeGetSchemaCreationStatusCommand: getSchemaCreationStatusInput => get
|
|
|
67
65
|
"GetSchemaCreationStatusCommand"
|
|
68
66
|
|
|
69
67
|
@send
|
|
70
|
-
external sendGetStatus: (
|
|
71
|
-
|
|
68
|
+
external sendGetStatus: (
|
|
69
|
+
appSyncClient,
|
|
70
|
+
getSchemaCreationStatusCommand,
|
|
71
|
+
) => promise<getSchemaCreationStatusResult> = "send"
|
|
72
72
|
|
|
73
73
|
let rec waitForSchemaActive = async (client, apiId, ~maxAttempts=30, ~attempt=0) => {
|
|
74
|
-
let result = await client->sendGetStatus(
|
|
75
|
-
{apiId: apiId}->makeGetSchemaCreationStatusCommand,
|
|
76
|
-
)
|
|
74
|
+
let result = await client->sendGetStatus({apiId: apiId}->makeGetSchemaCreationStatusCommand)
|
|
77
75
|
switch result.status {
|
|
78
76
|
| "ACTIVE" | "SUCCESS" => ()
|
|
79
77
|
| "FAILED" =>
|
|
@@ -211,9 +209,9 @@ let rec waitForMergeSuccess = async (
|
|
|
211
209
|
// and a least-privilege deploy-role policy — see
|
|
212
210
|
// `docs/guides/appsync-iam-system-caller.md`.
|
|
213
211
|
|
|
214
|
-
let _permissionToCognitoGroups = (
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
let _permissionToCognitoGroups = (permission: Reventless.Authorization.permission): option<
|
|
213
|
+
array<string>,
|
|
214
|
+
> =>
|
|
217
215
|
switch permission {
|
|
218
216
|
| AllowGroups([]) => Some(["__deny_all__"])
|
|
219
217
|
| AllowGroups(groups) => Some(groups)
|
|
@@ -249,7 +247,7 @@ let _formatDualAuthDirective = AppSync_SdlDecorate.formatDualAuthDirective
|
|
|
249
247
|
let _typeDeclName = (decl: string): option<string> =>
|
|
250
248
|
if decl->String.startsWith("type ") {
|
|
251
249
|
let rest = decl->String.slice(~start=5, ~end=decl->String.length)
|
|
252
|
-
let end = switch rest->String.search(
|
|
250
|
+
let end = switch rest->String.search(/[\s{]/) {
|
|
253
251
|
| -1 => rest->String.length
|
|
254
252
|
| i => i
|
|
255
253
|
}
|
|
@@ -308,9 +306,7 @@ let injectAwsAuth = (
|
|
|
308
306
|
}
|
|
309
307
|
switch entry.authorization {
|
|
310
308
|
| Some({group}) =>
|
|
311
|
-
entry.fieldNames->Array.forEach(fieldName =>
|
|
312
|
-
mutationAuthMap->Dict.set(fieldName, [group])
|
|
313
|
-
)
|
|
309
|
+
entry.fieldNames->Array.forEach(fieldName => mutationAuthMap->Dict.set(fieldName, [group]))
|
|
314
310
|
| None => ()
|
|
315
311
|
}
|
|
316
312
|
switch entry.fieldPermissions {
|
|
@@ -507,8 +503,7 @@ let _makeApiResourceWith = (
|
|
|
507
503
|
let iamRole = IAM.Role.make(
|
|
508
504
|
~name=`${name}-appsync-role`,
|
|
509
505
|
~args={
|
|
510
|
-
assumeRolePolicy: `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"appsync.amazonaws.com"},"Action":"sts:AssumeRole"}]}
|
|
511
|
-
->Pulumi.Input.make,
|
|
506
|
+
assumeRolePolicy: `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"appsync.amazonaws.com"},"Action":"sts:AssumeRole"}]}`->Pulumi.Input.make,
|
|
512
507
|
tags: AWS.Tags.make(
|
|
513
508
|
~name=`${name}-appsync-role`,
|
|
514
509
|
~kind=ReventlessCore.ComponentType.Platform,
|
|
@@ -562,15 +557,13 @@ let _makeApiResourceWith = (
|
|
|
562
557
|
let userPoolConfigOut = switch userPoolConfig {
|
|
563
558
|
| Some(config) => config
|
|
564
559
|
| None =>
|
|
565
|
-
Auth_Cognito.make(
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
)
|
|
573
|
-
)
|
|
560
|
+
Auth_Cognito.make(
|
|
561
|
+
~name=`${name}-auth`,
|
|
562
|
+
)->Pulumi.Output.apply((c: Auth_Cognito.authConfig): AppSync.GraphQLApi.userPoolConfig => {
|
|
563
|
+
userPoolId: c.userPoolId,
|
|
564
|
+
awsRegion: c.region,
|
|
565
|
+
defaultAction: AppSync.GraphQLApi.ALLOW,
|
|
566
|
+
})
|
|
574
567
|
}
|
|
575
568
|
|
|
576
569
|
// Cognito as primary auth, AWS_IAM as additional provider for
|
|
@@ -588,12 +581,7 @@ let _makeApiResourceWith = (
|
|
|
588
581
|
]->Pulumi.Input.make,
|
|
589
582
|
schema: ?(schema->Option.map(Pulumi.Input.make)),
|
|
590
583
|
logConfig: appsyncLogConfig->Pulumi.Input.make,
|
|
591
|
-
tags: AWS.Tags.make(
|
|
592
|
-
~name,
|
|
593
|
-
~kind=ReventlessCore.ComponentType.Plugin,
|
|
594
|
-
~role=Api,
|
|
595
|
-
~scope=Plugin,
|
|
596
|
-
),
|
|
584
|
+
tags: AWS.Tags.make(~name, ~kind=ReventlessCore.ComponentType.Plugin, ~role=Api, ~scope=Plugin),
|
|
597
585
|
}
|
|
598
586
|
let graphQLApi = AppSync.GraphQLApi.make(~name, ~args=apiArgs, ~opts=Some(customOpts))
|
|
599
587
|
|
|
@@ -640,11 +628,10 @@ let _makeApiResourceWith = (
|
|
|
640
628
|
(graphQLApi->Pulumi.Output.make, iamRole->Pulumi.Output.make)
|
|
641
629
|
}
|
|
642
630
|
|
|
643
|
-
let makeApiResource = (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
)
|
|
647
|
-
_makeApiResourceWith(~name, ~schema=None, ~userPoolConfig=None, ~opts)
|
|
631
|
+
let makeApiResource = (~name: string, ~opts: Pulumi.ComponentResource.options): (
|
|
632
|
+
Pulumi.Output.t<api>,
|
|
633
|
+
Pulumi.Output.t<role>,
|
|
634
|
+
) => _makeApiResourceWith(~name, ~schema=None, ~userPoolConfig=None, ~opts)
|
|
648
635
|
|
|
649
636
|
// Merged-mode source API: same auth shape as makeApiResource but with a
|
|
650
637
|
// DECLARATIVE inline schema — the provider runs StartSchemaCreation + poll
|
|
@@ -44,9 +44,10 @@ let injectAwsSubscribe = (
|
|
|
44
44
|
// leaves a trailing colon on the token — drop it (same rule as
|
|
45
45
|
// GraphQL_Stitcher.rootTypeFieldNames).
|
|
46
46
|
let name = ReventlessCore.GraphQL_Stitcher.extractLeadingName(line)
|
|
47
|
-
let name =
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
let name =
|
|
48
|
+
name->String.endsWith(":")
|
|
49
|
+
? name->String.slice(~start=0, ~end=name->String.length - 1)
|
|
50
|
+
: name
|
|
50
51
|
switch sourceByField->Dict.get(name) {
|
|
51
52
|
| Some(mutations) =>
|
|
52
53
|
let list = mutations->Array.map(m => `"${m}"`)->Array.join(", ")
|
|
@@ -126,17 +127,20 @@ let injectAwsAuthAll = (
|
|
|
126
127
|
iamFieldNames->Array.includes(ReventlessCore.GraphQL_Stitcher.extractLeadingName(field))
|
|
127
128
|
let cognitoOnly = formatCognitoGroupsDirective([group])
|
|
128
129
|
|
|
129
|
-
let augmentedMutations =
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
let augmentedMutations =
|
|
131
|
+
parts.mutations->Array.map(field =>
|
|
132
|
+
isIam(field)
|
|
133
|
+
? `${field}\n ${formatDualAuthDirective(Some([group]))}`
|
|
134
|
+
: `${field}\n ${cognitoOnly}`
|
|
135
|
+
)
|
|
136
|
+
let augmentedQueries =
|
|
137
|
+
parts.queries->Array.map(field =>
|
|
138
|
+
isIam(field)
|
|
139
|
+
? `${field} ${formatDualAuthDirective(Some([group]))}`
|
|
140
|
+
: `${field} ${cognitoOnly}`
|
|
141
|
+
)
|
|
142
|
+
let augmentedSubscriptions =
|
|
143
|
+
parts.subscriptions->Array.map(field => `${field}\n ${cognitoOnly}`)
|
|
140
144
|
|
|
141
145
|
ReventlessCore.GraphQL_Stitcher.encode({
|
|
142
146
|
...parts,
|
|
@@ -150,12 +154,7 @@ let injectAwsAuthAll = (
|
|
|
150
154
|
// connections, injected by the stitcher) and the `CommandResult` members
|
|
151
155
|
// (mutation returns). Stamped once on the ASSEMBLED SDL so an IAM system
|
|
152
156
|
// caller (`@@reventless.systemCallable` fields) can traverse them.
|
|
153
|
-
let sharedIamTypeNames = [
|
|
154
|
-
"PageInfo",
|
|
155
|
-
"CommandAccepted",
|
|
156
|
-
"CommandRejected",
|
|
157
|
-
"CommandPending",
|
|
158
|
-
]
|
|
157
|
+
let sharedIamTypeNames = ["PageInfo", "CommandAccepted", "CommandRejected", "CommandPending"]
|
|
159
158
|
|
|
160
159
|
let stampSharedIamTypes = (sdl: string): string =>
|
|
161
160
|
sharedIamTypeNames->Array.reduce(sdl, (acc, name) =>
|
|
@@ -260,7 +259,7 @@ let rootOperationTypes = ["Query", "Mutation", "Subscription"]
|
|
|
260
259
|
let typeDeclNameOf = (line: string): option<string> =>
|
|
261
260
|
if line->String.startsWith("type ") {
|
|
262
261
|
let rest = line->String.slice(~start=5, ~end=line->String.length)
|
|
263
|
-
switch rest->String.search(
|
|
262
|
+
switch rest->String.search(/[\s{]/) {
|
|
264
263
|
| -1 => Some(rest)
|
|
265
264
|
| i => Some(rest->String.slice(~start=0, ~end=i))
|
|
266
265
|
}
|
|
@@ -271,7 +270,7 @@ let typeDeclNameOf = (line: string): option<string> =>
|
|
|
271
270
|
// A root-operation field line: exactly two spaces of indent then a name. Deeper
|
|
272
271
|
// indents are directive continuations of the field above.
|
|
273
272
|
let fieldNameOf = (line: string): option<string> =>
|
|
274
|
-
switch line->String.match(
|
|
273
|
+
switch line->String.match(/^ {2}(\w+)/) {
|
|
275
274
|
| Some(groups) => groups->Array.get(1)->Option.flatMap(x => x)
|
|
276
275
|
| None => None
|
|
277
276
|
}
|
|
@@ -388,7 +387,9 @@ let assertGateable = (sdl: string): string => {
|
|
|
388
387
|
let problems = []
|
|
389
388
|
if inertDirectives->Array.length > 0 {
|
|
390
389
|
problems->Array.push(
|
|
391
|
-
` ${inertDirectives
|
|
390
|
+
` ${inertDirectives
|
|
391
|
+
->Array.length
|
|
392
|
+
->Int.toString} field(s) carry @aws_auth, which AppSync IGNORES on a\n` ++
|
|
392
393
|
` multi-auth API (this adapter always adds AWS_IAM as an additional provider).\n` ++
|
|
393
394
|
` They are gated by nothing. Emit @aws_cognito_user_pools(cognito_groups: [...])\n` ++
|
|
394
395
|
` instead — see AppSync_SdlDecorate.formatCognitoGroupsDirective.\n` ++
|
|
@@ -397,14 +398,18 @@ let assertGateable = (sdl: string): string => {
|
|
|
397
398
|
}
|
|
398
399
|
if bareFields->Array.length > 0 {
|
|
399
400
|
problems->Array.push(
|
|
400
|
-
` ${bareFields
|
|
401
|
+
` ${bareFields
|
|
402
|
+
->Array.length
|
|
403
|
+
->Int.toString} root field(s) carry no enforced auth directive, so they are\n` ++
|
|
401
404
|
` reachable by ANY authenticated Cognito caller:\n` ++
|
|
402
405
|
` ${bareFields->Array.join(", ")}`,
|
|
403
406
|
)
|
|
404
407
|
}
|
|
405
408
|
if bareTypes->Array.length > 0 {
|
|
406
409
|
problems->Array.push(
|
|
407
|
-
` ${bareTypes
|
|
410
|
+
` ${bareTypes
|
|
411
|
+
->Array.length
|
|
412
|
+
->Int.toString} object type(s) carry no enforced auth directive:\n` ++
|
|
408
413
|
` ${bareTypes->Array.join(", ")}`,
|
|
409
414
|
)
|
|
410
415
|
}
|
|
@@ -416,8 +421,7 @@ let assertGateable = (sdl: string): string => {
|
|
|
416
421
|
`\n\nEvery field and type must carry @aws_cognito_user_pools (optionally with\n` ++
|
|
417
422
|
`cognito_groups) and/or @aws_iam. The sweep in stampUndirectivedFields /\n` ++
|
|
418
423
|
`stampAllTypesCognito should have covered this — a failure here means a schema\n` ++
|
|
419
|
-
`reached assembly by a path that bypasses them.\n` ++
|
|
420
|
-
`See docs/plans/appsync-group-authorization-unenforced.md.`,
|
|
424
|
+
`reached assembly by a path that bypasses them.\n` ++ `See docs/plans/appsync-group-authorization-unenforced.md.`,
|
|
421
425
|
)
|
|
422
426
|
}
|
|
423
427
|
sdl
|
|
@@ -441,9 +445,13 @@ let stampCanonicalTypes = (sdl: string): string =>
|
|
|
441
445
|
sdl
|
|
442
446
|
->String.split("\n")
|
|
443
447
|
->Array.map(line => {
|
|
444
|
-
let isObjectDef =
|
|
445
|
-
|
|
446
|
-
let
|
|
448
|
+
let isObjectDef =
|
|
449
|
+
canonicalTypeNames->Array.some(name => line->String.startsWith(`type ${name} `))
|
|
450
|
+
let isNodeDef =
|
|
451
|
+
line->String.startsWith("interface Node ") || line->String.startsWith("interface Node{")
|
|
452
|
+
let isUnionDef =
|
|
453
|
+
line->String.startsWith("union CommandResult ") ||
|
|
454
|
+
line->String.startsWith("union CommandResult=")
|
|
447
455
|
if line->String.includes("@canonical") {
|
|
448
456
|
line
|
|
449
457
|
} else if isObjectDef || isNodeDef {
|
|
@@ -5,10 +5,12 @@ module EventCollectorChannel = EventCollectorChannel.DynamoDbStream
|
|
|
5
5
|
module RuntimeEnvironment = RuntimeEnvironment.Lambda
|
|
6
6
|
module EventCollectorRuntimeBuilder = AutomationSliceRuntime_Builder_Single
|
|
7
7
|
|
|
8
|
-
module Make = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
module Make = (
|
|
9
|
+
Api: {
|
|
10
|
+
let api: unit => Types.AppSync.api
|
|
11
|
+
let apiRole: unit => Types.AppSync.role
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
12
14
|
module Inner = ReventlessCore.AutomationSlice_Builder.Make(
|
|
13
15
|
RuntimeEnvironment,
|
|
14
16
|
QueryDbStorage.DynamoDb,
|
|
@@ -12,13 +12,12 @@ module Defaults: ReventlessInfra.RuntimeDefaults.T = {
|
|
|
12
12
|
module Make = (
|
|
13
13
|
Spec: ReventlessInfra.ExtensionPointMapping.Spec,
|
|
14
14
|
Mappings: ReventlessInfra.ExtensionPoint.Mappings with module Spec := Spec,
|
|
15
|
-
): ReventlessInfra.ExtensionPoint.T =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
15
|
+
): ReventlessInfra.ExtensionPoint.T => ReventlessCore.ExtensionPoint_Builder.Make(
|
|
16
|
+
Spec,
|
|
17
|
+
Mappings,
|
|
18
|
+
RuntimeEnvironment,
|
|
19
|
+
CommandTopicChannel,
|
|
20
|
+
EventTopicPublisher.SNS,
|
|
21
|
+
ExtensionPointRuntimeBuilder,
|
|
22
|
+
Defaults,
|
|
23
|
+
)
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// InboundTranslationSlice_Builder (AWS)
|
|
2
2
|
// Wires AWS adapters and delegates to the core ReventlessCore.InboundTranslationSlice_Builder.
|
|
3
3
|
|
|
4
|
-
module Make = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
module Make = (
|
|
5
|
+
Api: {
|
|
6
|
+
let api: unit => Types.AppSync.api
|
|
7
|
+
let apiRole: unit => Types.AppSync.role
|
|
8
|
+
},
|
|
9
|
+
) => {
|
|
8
10
|
module Inner = ReventlessCore.InboundTranslationSlice_Builder.Make(
|
|
9
11
|
QueryDbStorage.DynamoDb,
|
|
10
12
|
QueryDbResolvers.AppSync,
|
|
@@ -39,10 +41,7 @@ module Make = (Api: {
|
|
|
39
41
|
component->ReventlessCore.Component.outputs
|
|
40
42
|
switch outputs.queryDb.resources->Array.get(0) {
|
|
41
43
|
| Some(tableResource) =>
|
|
42
|
-
PluginRuntime_Builder.registerInboundAuditTableName(
|
|
43
|
-
~specName=Spec.name,
|
|
44
|
-
tableResource.name,
|
|
45
|
-
)
|
|
44
|
+
PluginRuntime_Builder.registerInboundAuditTableName(~specName=Spec.name, tableResource.name)
|
|
46
45
|
| None => ()
|
|
47
46
|
}
|
|
48
47
|
component
|
|
@@ -28,10 +28,12 @@ module DeployTimeCapabilities = {
|
|
|
28
28
|
let capabilities = () => Reventless.Capabilities.none
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
module Make = (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
module Make = (
|
|
32
|
+
Api: {
|
|
33
|
+
let api: unit => Types.AppSync.api
|
|
34
|
+
let apiRole: unit => Types.AppSync.role
|
|
35
|
+
},
|
|
36
|
+
) => {
|
|
35
37
|
module Inner = ReventlessCore.OutboundTranslationSlice_Builder.Make(
|
|
36
38
|
RuntimeEnvironment,
|
|
37
39
|
QueryDbStorage.DynamoDb,
|
|
@@ -53,7 +55,13 @@ module Make = (Api: {
|
|
|
53
55
|
type component = InnerMake.component
|
|
54
56
|
let queryDbName = InnerMake.queryDbName
|
|
55
57
|
|
|
56
|
-
let make = (
|
|
58
|
+
let make = (
|
|
59
|
+
~dcbEventLog,
|
|
60
|
+
~allEventTopics=Dict.make(),
|
|
61
|
+
~publishJsons,
|
|
62
|
+
~runtime=?,
|
|
63
|
+
~opts=?,
|
|
64
|
+
): component => {
|
|
57
65
|
let ots = InnerMake.make(~dcbEventLog, ~allEventTopics, ~publishJsons, ~runtime?, ~opts?)
|
|
58
66
|
|
|
59
67
|
let queryDbOutputs = (ots->ReventlessCore.Component.outputs).queryDb
|
|
@@ -67,9 +75,7 @@ module Make = (Api: {
|
|
|
67
75
|
// not carry.
|
|
68
76
|
let declaredSources = Spec.sourceNames
|
|
69
77
|
let sourceTopics =
|
|
70
|
-
allEventTopics->ReventlessCore.EventTopic.filter(
|
|
71
|
-
declaredSources->Belt.Set.String.fromArray,
|
|
72
|
-
)
|
|
78
|
+
allEventTopics->ReventlessCore.EventTopic.filter(declaredSources->Belt.Set.String.fromArray)
|
|
73
79
|
let consumesDcbLog =
|
|
74
80
|
declaredSources->Array.length == 0 ||
|
|
75
81
|
declaredSources->Array.some(name => !(allEventTopics->Dict.has(name)))
|
|
@@ -40,10 +40,10 @@ module Make = (): ReventlessCore.SideEffectHandler.T => {
|
|
|
40
40
|
)
|
|
41
41
|
|
|
42
42
|
// Derive npm specifiers from moduleUrl on each SideEffect module
|
|
43
|
-
let sideEffectModulePaths =
|
|
44
|
-
(module(SE: Reventless.SideEffect.T)) =>
|
|
45
|
-
Util_Bundle.getModuleSpecifier(SE.moduleUrl)
|
|
46
|
-
|
|
43
|
+
let sideEffectModulePaths =
|
|
44
|
+
sideEffects->Array.map((module(SE: Reventless.SideEffect.T)) =>
|
|
45
|
+
Util_Bundle.getModuleSpecifier(SE.moduleUrl)
|
|
46
|
+
)
|
|
47
47
|
|
|
48
48
|
EventCollectorRuntimeBuilder.registerSideEffectHandler(
|
|
49
49
|
~sideEffectHandlerName=name,
|
|
@@ -5,10 +5,12 @@ module EventCollectorChannel = EventCollectorChannel.DynamoDbStream
|
|
|
5
5
|
module RuntimeEnvironment = RuntimeEnvironment.Lambda
|
|
6
6
|
module EventCollectorRuntimeBuilder = StateViewSliceRuntime_Builder_Single
|
|
7
7
|
|
|
8
|
-
module Make = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
module Make = (
|
|
9
|
+
Api: {
|
|
10
|
+
let api: unit => Types.AppSync.api
|
|
11
|
+
let apiRole: unit => Types.AppSync.role
|
|
12
|
+
},
|
|
13
|
+
) => {
|
|
12
14
|
module Inner = ReventlessCore.StateViewSlice_Builder.Make(
|
|
13
15
|
RuntimeEnvironment,
|
|
14
16
|
QueryDbStorage.Selectable,
|
|
@@ -9,10 +9,12 @@ module EventCollectorChannel = EventCollectorChannel.DynamoDbStream
|
|
|
9
9
|
module RuntimeEnvironment = RuntimeEnvironment.Lambda
|
|
10
10
|
module EventCollectorRuntimeBuilder = StateViewSliceRuntime_Builder_Single
|
|
11
11
|
|
|
12
|
-
module Make = (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
module Make = (
|
|
13
|
+
Api: {
|
|
14
|
+
let api: unit => Types.AppSync.api
|
|
15
|
+
let apiRole: unit => Types.AppSync.role
|
|
16
|
+
},
|
|
17
|
+
) => {
|
|
16
18
|
module Inner = ReventlessCore.StateViewSlice_Builder.Make(
|
|
17
19
|
RuntimeEnvironment,
|
|
18
20
|
QueryDbStorage.SelectableStream,
|
|
@@ -17,14 +17,13 @@ module Defaults: ReventlessInfra.RuntimeDefaults.T = {
|
|
|
17
17
|
|
|
18
18
|
module Make = (Spec: ReventlessCore.Task.Spec): (
|
|
19
19
|
ReventlessCore.Task.T with module Spec = Spec
|
|
20
|
-
) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
20
|
+
) => ReventlessCore.Task_Builder.Make(
|
|
21
|
+
Spec,
|
|
22
|
+
RuntimeEnvironment,
|
|
23
|
+
EventCollectorChannel,
|
|
24
|
+
EventCollectorRuntimeBuilder,
|
|
25
|
+
TaskRuntimeBuilder,
|
|
26
|
+
TaskBucket,
|
|
27
|
+
SideEffectHandler,
|
|
28
|
+
Defaults,
|
|
29
|
+
)
|
|
@@ -243,14 +243,8 @@ export const handler = async (event) => {
|
|
|
243
243
|
Lambda.Function.variables: Dict.fromArray([
|
|
244
244
|
("TASK_DEFINITION_ARN", taskDefinition.arn->Pulumi.Output.asInput),
|
|
245
245
|
("CLUSTER_ARN", cluster.arn->Pulumi.Output.asInput),
|
|
246
|
-
(
|
|
247
|
-
|
|
248
|
-
fullQualifiedStackName.organization->Pulumi.Input.make,
|
|
249
|
-
),
|
|
250
|
-
(
|
|
251
|
-
"STACK_PROJECT",
|
|
252
|
-
fullQualifiedStackName.project->Pulumi.Input.make,
|
|
253
|
-
),
|
|
246
|
+
("STACK_ORG", fullQualifiedStackName.organization->Pulumi.Input.make),
|
|
247
|
+
("STACK_PROJECT", fullQualifiedStackName.project->Pulumi.Input.make),
|
|
254
248
|
("STACK_STACK", fullQualifiedStackName.stack->Pulumi.Input.make),
|
|
255
249
|
(
|
|
256
250
|
"SUBNETS",
|
|
@@ -361,8 +355,7 @@ export const handler = async (event) => {
|
|
|
361
355
|
~opts,
|
|
362
356
|
)
|
|
363
357
|
|
|
364
|
-
let invokeCloneCode =
|
|
365
|
-
`import { util } from '@aws-appsync/utils';
|
|
358
|
+
let invokeCloneCode = `import { util } from '@aws-appsync/utils';
|
|
366
359
|
export function request(ctx) {
|
|
367
360
|
return {
|
|
368
361
|
operation: 'Invoke',
|
|
@@ -14,10 +14,7 @@ let clone = async (~taskDefinition, ~cluster, ~fullQualifiedStackName, ~subnets,
|
|
|
14
14
|
|
|
15
15
|
log.info(
|
|
16
16
|
~comp="ClonerRunner",
|
|
17
|
-
"clone: requested by user " ++
|
|
18
|
-
payload["meta"]["user"] ++
|
|
19
|
-
" from ip " ++
|
|
20
|
-
payload["meta"]["ip"],
|
|
17
|
+
"clone: requested by user " ++ payload["meta"]["user"] ++ " from ip " ++ payload["meta"]["ip"],
|
|
21
18
|
)
|
|
22
19
|
|
|
23
20
|
let _ = await {
|
|
@@ -57,10 +57,7 @@ let make: ReventlessCore.Heartbeat_Adapter.runnerMaker<runtimeParts> = (
|
|
|
57
57
|
~args={
|
|
58
58
|
policy: PulumiAws.PolicyDocument.mergePolicyDocuments(
|
|
59
59
|
name ++ "Policy",
|
|
60
|
-
[
|
|
61
|
-
PulumiAws.Lambda.defaultLoggingPolicyDocument,
|
|
62
|
-
heartbeatLambdaSendMessagePolicyDocument,
|
|
63
|
-
],
|
|
60
|
+
[PulumiAws.Lambda.defaultLoggingPolicyDocument, heartbeatLambdaSendMessagePolicyDocument],
|
|
64
61
|
)->Pulumi.Output.asInput,
|
|
65
62
|
role: lambdaRole.id->Pulumi.Output.asInput,
|
|
66
63
|
},
|
|
@@ -70,7 +67,10 @@ let make: ReventlessCore.Heartbeat_Adapter.runnerMaker<runtimeParts> = (
|
|
|
70
67
|
// The Lambda permission and CloudWatch event target genuinely need the
|
|
71
68
|
// Lambda's resolved arn/name, so they stay inside an apply.
|
|
72
69
|
let _permissionAndEventTarget =
|
|
73
|
-
(
|
|
70
|
+
(
|
|
71
|
+
lambda->Pulumi.Output.flatMap(lambda => lambda.arn),
|
|
72
|
+
lambda->Pulumi.Output.flatMap(lambda => lambda.name),
|
|
73
|
+
)
|
|
74
74
|
->Pulumi.Output.all2
|
|
75
75
|
->Pulumi.Output.apply(((lambdaArn, lambdaName)) => {
|
|
76
76
|
let _addHeartbeatLambdaPermission = PulumiAws.Lambda.Permission.make(
|