@reventlessdev/reventless-aws 3.0.0-alpha.167
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 +1564 -0
- package/README.md +62 -0
- package/__mocks__/emptyModule.js +1 -0
- package/all-licenses.csv +565 -0
- package/docker-compose.dynamodb-local.yml +12 -0
- package/jest.setup.cjs +5 -0
- package/licenses-analysis.ods +0 -0
- package/package.json +73 -0
- package/rescript.json +39 -0
- package/reventless-licenses-analysis.xls +0 -0
- package/scripts/run-integration-tests.sh +43 -0
- package/src/Platform.res +1940 -0
- package/src/Platform.res.mjs +2281 -0
- package/src/Platform_Casts.res +106 -0
- package/src/Platform_Casts.res.mjs +13 -0
- package/src/Platform_Stack.res +153 -0
- package/src/Platform_Stack.res.mjs +121 -0
- package/src/Types.res +39 -0
- package/src/Types.res.mjs +21 -0
- package/src/adapter/AWS.res +96 -0
- package/src/adapter/AWS.res.mjs +186 -0
- package/src/adapter/AWS_Tags.res +16 -0
- package/src/adapter/AWS_Tags.res.mjs +48 -0
- package/src/adapter/Adapter_Helpers.res +19 -0
- package/src/adapter/Adapter_Helpers.res.mjs +37 -0
- package/src/adapter/Api/AppSync_EventsApi.res +172 -0
- package/src/adapter/Api/AppSync_EventsApi.res.mjs +96 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res +93 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res.mjs +67 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +653 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res.mjs +462 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res +29 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res.mjs +15 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +238 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +179 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +229 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res.mjs +245 -0
- package/src/adapter/Auth/Auth_Cognito.res +209 -0
- package/src/adapter/Auth/Auth_Cognito.res.mjs +135 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res +2 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res.mjs +12 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +251 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res.mjs +126 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +20 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res.mjs +23 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res +1 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res.mjs +11 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +95 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res.mjs +50 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res +6 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res.mjs +21 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res +196 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res.mjs +145 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +91 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res.mjs +74 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +69 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res.mjs +62 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +60 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res.mjs +56 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +73 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res.mjs +65 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +88 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res.mjs +76 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res +1 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res.mjs +9 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res +7 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res.mjs +17 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +103 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res.mjs +68 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res +107 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res.mjs +145 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res +1 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res.mjs +9 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +84 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res.mjs +52 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +1436 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res.mjs +1143 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res +6 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res.mjs +21 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +63 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res.mjs +56 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res +20 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res.mjs +32 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +266 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res.mjs +166 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +81 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res.mjs +54 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +59 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res.mjs +45 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +91 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res.mjs +89 -0
- package/src/adapter/EventLog/EventLogStorage.res +3 -0
- package/src/adapter/EventLog/EventLogStorage.res.mjs +15 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res +25 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res.mjs +34 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +26 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res.mjs +35 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +121 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res.mjs +137 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +265 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs +185 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res +6 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res.mjs +21 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +25 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res.mjs +28 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +40 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res.mjs +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res.mjs +38 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res.mjs +18 -0
- package/src/adapter/Mcp/MCP_Lambda.res +502 -0
- package/src/adapter/Mcp/MCP_Lambda.res.mjs +289 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res +71 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res.mjs +44 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res +2 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res.mjs +12 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +434 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res.mjs +243 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbStorage.res +5 -0
- package/src/adapter/QueryDb/QueryDbStorage.res.mjs +18 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +115 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res.mjs +100 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +52 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res.mjs +38 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +271 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res.mjs +306 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res +20 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res.mjs +22 -0
- package/src/adapter/QueryEngine/QueryEngine.res +3 -0
- package/src/adapter/QueryEngine/QueryEngine.res.mjs +12 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +184 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res.mjs +221 -0
- package/src/adapter/Runtime/AdminEventCollectorEntryPoint.mjs +879 -0
- package/src/adapter/Runtime/AggregateEntryPoint.mjs +313 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +327 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +239 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +331 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res.mjs +240 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +247 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +347 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +285 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res.mjs +212 -0
- package/src/adapter/Runtime/AutomationSliceEntryPoint.mjs +124 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +187 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res.mjs +147 -0
- package/src/adapter/Runtime/CounterEntryPoint.mjs +91 -0
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +265 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +122 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res.mjs +89 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +193 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +137 -0
- package/src/adapter/Runtime/EventMapperEntryPoint.mjs +97 -0
- package/src/adapter/Runtime/ExtensionPointEntryPoint.mjs +101 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +83 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res.mjs +59 -0
- package/src/adapter/Runtime/HandlerFactoryHelpers.mjs +142 -0
- package/src/adapter/Runtime/HeartbeatEntryPoint.mjs +38 -0
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.mjs +137 -0
- package/src/adapter/Runtime/ReadModelEntryPoint.mjs +143 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res +1 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res.mjs +9 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +254 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +169 -0
- package/src/adapter/Runtime/SideEffectEntryPoint.mjs +81 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +178 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res.mjs +129 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +166 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +87 -0
- package/src/adapter/Runtime/StateViewSliceEntryPoint.mjs +136 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +344 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res.mjs +242 -0
- package/src/adapter/Runtime/TaskBucketEntryPoint.mjs +150 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +123 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res.mjs +74 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res +2 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res.mjs +12 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +54 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res.mjs +41 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +97 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res.mjs +85 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res +418 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +295 -0
- package/src/adapter/Task/TaskBucket.res +1 -0
- package/src/adapter/Task/TaskBucket.res.mjs +9 -0
- package/src/adapter/Task/TaskBucket_S3.res +157 -0
- package/src/adapter/Task/TaskBucket_S3.res.mjs +108 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res +11 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res.mjs +15 -0
- package/src/components/Aggregate_Builder.res +1 -0
- package/src/components/Aggregate_Builder.res.mjs +25 -0
- package/src/components/Aggregate_Builder_Micro.res +63 -0
- package/src/components/Aggregate_Builder_Micro.res.mjs +80 -0
- package/src/components/Aggregate_Builder_NoResolver.res +61 -0
- package/src/components/Aggregate_Builder_NoResolver.res.mjs +80 -0
- package/src/components/Aggregate_Builder_PerAggregate.res +57 -0
- package/src/components/Aggregate_Builder_PerAggregate.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single.res +59 -0
- package/src/components/Aggregate_Builder_Single.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single_Async.res +59 -0
- package/src/components/Aggregate_Builder_Single_Async.res.mjs +80 -0
- package/src/components/Api/AppSync_Adapter.res +500 -0
- package/src/components/Api/AppSync_Adapter.res.mjs +396 -0
- package/src/components/AutomationSlice_Builder.res +52 -0
- package/src/components/AutomationSlice_Builder.res.mjs +72 -0
- package/src/components/AutomationSlice_Builder_Bundled.res.mjs +70 -0
- package/src/components/Counter_Builder.res +10 -0
- package/src/components/Counter_Builder.res.mjs +16 -0
- package/src/components/DataCleaner.res +170 -0
- package/src/components/DataCleaner.res.mjs +2 -0
- package/src/components/DcbEventLog_Builder.res +8 -0
- package/src/components/DcbEventLog_Builder.res.mjs +14 -0
- package/src/components/ExtensionPoint_Builder.res +16 -0
- package/src/components/ExtensionPoint_Builder.res.mjs +37 -0
- package/src/components/ForeignReadModel_Builder.res +19 -0
- package/src/components/ForeignReadModel_Builder.res.mjs +48 -0
- package/src/components/InboundTranslationSlice_Builder.res +25 -0
- package/src/components/InboundTranslationSlice_Builder.res.mjs +31 -0
- package/src/components/OutboundTranslationSlice_Builder.res +60 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +76 -0
- package/src/components/OutboundTranslationSlice_Builder_Bundled.res.mjs +75 -0
- package/src/components/Plugin.res +29 -0
- package/src/components/Plugin.res.mjs +63 -0
- package/src/components/ReadModel_Builder.res +1 -0
- package/src/components/ReadModel_Builder.res.mjs +19 -0
- package/src/components/ReadModel_Builder_NoResolver.res +55 -0
- package/src/components/ReadModel_Builder_NoResolver.res.mjs +64 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res +60 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res.mjs +64 -0
- package/src/components/ReadModel_Builder_PerReadModel.res +53 -0
- package/src/components/ReadModel_Builder_PerReadModel.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single.res +52 -0
- package/src/components/ReadModel_Builder_Single.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single_Stream.res +60 -0
- package/src/components/ReadModel_Builder_Single_Stream.res.mjs +66 -0
- package/src/components/Scheduler.res +1 -0
- package/src/components/Scheduler.res.mjs +13 -0
- package/src/components/SideEffectHandler.res +1 -0
- package/src/components/SideEffectHandler.res.mjs +19 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res +13 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res.mjs +52 -0
- package/src/components/SideEffectHandler_Single.res +54 -0
- package/src/components/SideEffectHandler_Single.res.mjs +60 -0
- package/src/components/StateChangeSlice_Builder.res +17 -0
- package/src/components/StateChangeSlice_Builder.res.mjs +23 -0
- package/src/components/StateViewSlice_Builder.res +46 -0
- package/src/components/StateViewSlice_Builder.res.mjs +68 -0
- package/src/components/StateViewSlice_Builder_Bundled.res.mjs +69 -0
- package/src/components/StateViewSlice_Builder_Stream.res +50 -0
- package/src/components/StateViewSlice_Builder_Stream.res.mjs +68 -0
- package/src/components/Task_Builder.res +1 -0
- package/src/components/Task_Builder.res.mjs +28 -0
- package/src/components/Task_Builder_PerBucket.res +22 -0
- package/src/components/Task_Builder_PerBucket.res.mjs +63 -0
- package/src/components/Vpc.res +214 -0
- package/src/components/Vpc.res.mjs +117 -0
- package/src/components/Vpc.resi +22 -0
- package/src/errors/AppSync_Error.res +36 -0
- package/src/errors/AppSync_Error.res.mjs +38 -0
- package/src/errors/Cognito_Error.res +36 -0
- package/src/errors/Cognito_Error.res.mjs +38 -0
- package/src/errors/DynamoDb_Error.res +75 -0
- package/src/errors/DynamoDb_Error.res.mjs +86 -0
- package/src/errors/Kinesis_Error.res +36 -0
- package/src/errors/Kinesis_Error.res.mjs +38 -0
- package/src/errors/SNS_Error.res +34 -0
- package/src/errors/SNS_Error.res.mjs +38 -0
- package/src/errors/SQS_Error.res +40 -0
- package/src/errors/SQS_Error.res.mjs +41 -0
- package/src/plugin/cloner/ClonerRunner.res +1 -0
- package/src/plugin/cloner/ClonerRunner.res.mjs +9 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res +362 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res.mjs +246 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +42 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res.mjs +45 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res +1 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res.mjs +9 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +96 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res.mjs +69 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +115 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res.mjs +88 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res +5 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res.mjs +14 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res +769 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res.mjs +464 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +13 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res.mjs +19 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res +28 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res.mjs +67 -0
- package/src/plugin/stack/Plugin_Stack.res +439 -0
- package/src/plugin/stack/Plugin_Stack.res.mjs +263 -0
- package/src/util/Util.res +29 -0
- package/src/util/Util.res.mjs +93 -0
- package/src/util/Util_AppSync.res +36 -0
- package/src/util/Util_AppSync.res.mjs +35 -0
- package/src/util/Util_AppSync_Caller.res +213 -0
- package/src/util/Util_AppSync_Caller.res.mjs +170 -0
- package/src/util/Util_Bundle.res +255 -0
- package/src/util/Util_Bundle.res.mjs +179 -0
- package/src/util/Util_Cloudwatch.res +14 -0
- package/src/util/Util_Cloudwatch.res.mjs +19 -0
- package/src/util/Util_CognitoGroupUser.res +39 -0
- package/src/util/Util_CognitoGroupUser.res.mjs +32 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res +65 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res.mjs +50 -0
- package/src/util/Util_Cognito_Runtime.res +52 -0
- package/src/util/Util_Cognito_Runtime.res.mjs +35 -0
- package/src/util/Util_DeadLetterQueue.res +154 -0
- package/src/util/Util_DeadLetterQueue.res.mjs +158 -0
- package/src/util/Util_DynamoDb.res +210 -0
- package/src/util/Util_DynamoDb.res.mjs +218 -0
- package/src/util/Util_DynamoDbStream.res +138 -0
- package/src/util/Util_DynamoDbStream.res.mjs +134 -0
- package/src/util/Util_DynamoDbStream_Runtime.res +94 -0
- package/src/util/Util_DynamoDbStream_Runtime.res.mjs +131 -0
- package/src/util/Util_DynamoDb_Runtime.res +216 -0
- package/src/util/Util_DynamoDb_Runtime.res.mjs +257 -0
- package/src/util/Util_DynamoDb_TableManager.res +23 -0
- package/src/util/Util_DynamoDb_TableManager.res.mjs +35 -0
- package/src/util/Util_DynamoDb_TableManager.resi +3 -0
- package/src/util/Util_Env.res +5 -0
- package/src/util/Util_Env.res.mjs +2 -0
- package/src/util/Util_EventSourceMapping.res +49 -0
- package/src/util/Util_EventSourceMapping.res.mjs +32 -0
- package/src/util/Util_HostUiDomain.res +28 -0
- package/src/util/Util_HostUiDomain.res.mjs +26 -0
- package/src/util/Util_IAM_Role.res +14 -0
- package/src/util/Util_IAM_Role.res.mjs +28 -0
- package/src/util/Util_Kinesis_Runtime.res +20 -0
- package/src/util/Util_Kinesis_Runtime.res.mjs +24 -0
- package/src/util/Util_Lambda.res +39 -0
- package/src/util/Util_Lambda.res.mjs +45 -0
- package/src/util/Util_LocalConfig.res +119 -0
- package/src/util/Util_LocalConfig.res.mjs +112 -0
- package/src/util/Util_ResourceNaming.res +15 -0
- package/src/util/Util_ResourceNaming.res.mjs +26 -0
- package/src/util/Util_S3.res +17 -0
- package/src/util/Util_S3.res.mjs +30 -0
- package/src/util/Util_S3_Runtime.res +11 -0
- package/src/util/Util_S3_Runtime.res.mjs +15 -0
- package/src/util/Util_SNS.res +33 -0
- package/src/util/Util_SNS.res.mjs +50 -0
- package/src/util/Util_SNS_FIFO.res +21 -0
- package/src/util/Util_SNS_FIFO.res.mjs +27 -0
- package/src/util/Util_SNS_Runtime.res +33 -0
- package/src/util/Util_SNS_Runtime.res.mjs +27 -0
- package/src/util/Util_SQS.res +70 -0
- package/src/util/Util_SQS.res.mjs +83 -0
- package/src/util/Util_SQS_FIFO.res +16 -0
- package/src/util/Util_SQS_FIFO.res.mjs +28 -0
- package/src/util/Util_SQS_Runtime.res +169 -0
- package/src/util/Util_SQS_Runtime.res.mjs +150 -0
- package/src/util/Util_SesPolicy_Runtime.res +54 -0
- package/src/util/Util_SesPolicy_Runtime.res.mjs +55 -0
- package/src/util/Util_StaticBundle.res +124 -0
- package/src/util/Util_StaticBundle.res.mjs +132 -0
- package/src/util/Util_Vpc.res +22 -0
- package/src/util/Util_Vpc.res.mjs +27 -0
- package/tests/AppSync_AdapterTest.res +396 -0
- package/tests/AppSync_AdapterTest.res.mjs +326 -0
- package/tests/AppSync_Resolver_RetryingTest.res +59 -0
- package/tests/AppSync_Resolver_RetryingTest.res.mjs +66 -0
- package/tests/Auth_CognitoTest.res +203 -0
- package/tests/Auth_CognitoTest.res.mjs +248 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +602 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res.mjs +742 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +57 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res.mjs +68 -0
- package/tests/MCP_LambdaTest.res +101 -0
- package/tests/MCP_LambdaTest.res.mjs +56 -0
- package/tests/Util_HostUiDomainTest.res +90 -0
- package/tests/Util_HostUiDomainTest.res.mjs +50 -0
- package/tests/Util_SQS_RuntimeTest.res +46 -0
- package/tests/Util_SQS_RuntimeTest.res.mjs +45 -0
- package/tests/Util_StaticBundleTest.res +136 -0
- package/tests/Util_StaticBundleTest.res.mjs +149 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +101 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res.mjs +91 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +315 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res.mjs +435 -0
- package/tests/integration/DcbIntegrationHarness.res +102 -0
- package/tests/integration/DcbIntegrationHarness.res.mjs +163 -0
- package/tests/integration/EpTestSlice.res +28 -0
- package/tests/integration/EpTestSlice.res.mjs +43 -0
- package/tests/integration/EpTestSliceBehavior.res +18 -0
- package/tests/integration/EpTestSliceBehavior.res.mjs +35 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as IAM$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/IAM.res.mjs";
|
|
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
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
8
|
+
import * as Lambda$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Lambda/Lambda.res.mjs";
|
|
9
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
10
|
+
import * as AWS$ReventlessAws from "../../adapter/AWS.res.mjs";
|
|
11
|
+
import * as Cloner$ReventlessCore from "@reventlessdev/reventless-core/src/components/Cloner.res.mjs";
|
|
12
|
+
import * as AWS_Tags$ReventlessAws from "../../adapter/AWS_Tags.res.mjs";
|
|
13
|
+
import * as Util_Vpc$ReventlessAws from "../../util/Util_Vpc.res.mjs";
|
|
14
|
+
import * as AdminApi$ReventlessCore from "@reventlessdev/reventless-core/src/admin/AdminApi.res.mjs";
|
|
15
|
+
import * as PolicyDocument$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/PolicyDocument.res.mjs";
|
|
16
|
+
import * as Util_Bundle$ReventlessAws from "../../util/Util_Bundle.res.mjs";
|
|
17
|
+
import * as GetSecretVersion$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/SecretsManager/GetSecretVersion.res.mjs";
|
|
18
|
+
import * as Util_AppSync$ReventlessAws from "../../util/Util_AppSync.res.mjs";
|
|
19
|
+
import * as AppSync_Resolver_Retrying$ReventlessAws from "../../adapter/Api/AppSync_Resolver_Retrying.res.mjs";
|
|
20
|
+
|
|
21
|
+
function make(name, api, fullQualifiedStackName, reventlessCiSecretUrn, secretUrns, opts) {
|
|
22
|
+
let cluster = new (Aws.ecs.Cluster)(name, undefined, opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
|
|
23
|
+
let taskExecutionRole = new (Aws.iam.Role)(name + "TaskExecution", {
|
|
24
|
+
assumeRolePolicy: IAM$PulumiAws.Policy.assumeRolePolicy(name, "ecs-tasks.amazonaws.com"),
|
|
25
|
+
inlinePolicies: [IAM$PulumiAws.InlinePolicy.makeForActions("clonerTask", [
|
|
26
|
+
"logs:PutLogEvents",
|
|
27
|
+
"logs:CreateLogGroup",
|
|
28
|
+
"logs:CreateLogStream"
|
|
29
|
+
])]
|
|
30
|
+
});
|
|
31
|
+
let secretsManagerPolicyDocument = PolicyDocument$PulumiAws.make(undefined, name + "SecretsManagerPolicy", [{
|
|
32
|
+
Sid: "AllowManageSecrets",
|
|
33
|
+
Effect: "Allow",
|
|
34
|
+
Action: [
|
|
35
|
+
"secretsmanager:GetRandomPassword",
|
|
36
|
+
"secretsmanager:GetResourcePolicy",
|
|
37
|
+
"secretsmanager:GetSecretValue",
|
|
38
|
+
"secretsmanager:DescribeSecret",
|
|
39
|
+
"secretsmanager:ListSecretVersionIds"
|
|
40
|
+
]
|
|
41
|
+
}]);
|
|
42
|
+
let secretsManagerAccessPolicy = new (Aws.iam.Policy)("secretsManagerAccess", {
|
|
43
|
+
policy: PolicyDocument$PulumiAws.toJsonString(secretsManagerPolicyDocument)
|
|
44
|
+
});
|
|
45
|
+
let taskRunnerPolicyDocument = PolicyDocument$PulumiAws.make(undefined, name + "TaskRunnerPolicy", [{
|
|
46
|
+
Sid: "AllowRunTask",
|
|
47
|
+
Effect: "Allow",
|
|
48
|
+
Action: [
|
|
49
|
+
"ecs:RunTask",
|
|
50
|
+
"iam:PassRole"
|
|
51
|
+
]
|
|
52
|
+
}]);
|
|
53
|
+
let taskRunnerPolicy = new (Aws.iam.Policy)("taskRunner", {
|
|
54
|
+
policy: PolicyDocument$PulumiAws.toJsonString(taskRunnerPolicyDocument)
|
|
55
|
+
});
|
|
56
|
+
new (Aws.iam.RolePolicyAttachment)("ClonerTaskExecutionSecretsManagerAccess", {
|
|
57
|
+
policyArn: secretsManagerAccessPolicy.arn,
|
|
58
|
+
role: taskExecutionRole.id
|
|
59
|
+
}, opts);
|
|
60
|
+
let entryPointCode = `import { ECSClient, RunTaskCommand } from "@aws-sdk/client-ecs";
|
|
61
|
+
const client = new ECSClient();
|
|
62
|
+
export const handler = async (event) => {
|
|
63
|
+
const environment = Object.fromEntries([
|
|
64
|
+
["REVENTLESS_CORE_STACK", process.env.STACK_ORG + "/" + process.env.STACK_PROJECT + "/" + process.env.STACK_STACK],
|
|
65
|
+
["RESTORE_DATE_TIME", event.restoreDateTime],
|
|
66
|
+
]);
|
|
67
|
+
console.log("clone: requested by user " + event.meta.user + " from ip " + event.meta.ip);
|
|
68
|
+
await client.send(new RunTaskCommand({
|
|
69
|
+
taskDefinition: process.env.TASK_DEFINITION_ARN,
|
|
70
|
+
cluster: process.env.CLUSTER_ARN,
|
|
71
|
+
launchType: "FARGATE",
|
|
72
|
+
networkConfiguration: { awsvpcConfiguration: { subnets: JSON.parse(process.env.SUBNETS) } },
|
|
73
|
+
overrides: {
|
|
74
|
+
containerOverrides: [{
|
|
75
|
+
name: "reventless-ci",
|
|
76
|
+
command: ["reventless-ci", "clone-environment"],
|
|
77
|
+
environment: environment,
|
|
78
|
+
}],
|
|
79
|
+
},
|
|
80
|
+
}));
|
|
81
|
+
};`;
|
|
82
|
+
let clonerArchiveContents = {};
|
|
83
|
+
clonerArchiveContents["index.mjs"] = new (Pulumi.asset.StringAsset)(entryPointCode);
|
|
84
|
+
let code = new (Pulumi.asset.AssetArchive)(clonerArchiveContents);
|
|
85
|
+
let sourceCodeHash = Util_Bundle$ReventlessAws.hashString(entryPointCode);
|
|
86
|
+
let layers = Stdlib_Option.getOr(Stdlib_Option.map(Lambda$PulumiAws.reventlessLayerArn, arn => [arn]), []);
|
|
87
|
+
let vpcStackName = Stdlib_Option.getOrThrow(new Pulumi.Config("vpc").get("stack"), undefined);
|
|
88
|
+
let vpcConfig = Util_Vpc$ReventlessAws.getVpcConfig(vpcStackName, "vpc");
|
|
89
|
+
let secrets = Pulumi.all(secretUrns.map(urn => GetSecretVersion$PulumiAws.getSecretNames(urn).apply(names => names.map(name => ({
|
|
90
|
+
name: name,
|
|
91
|
+
valueFrom: urn + `:` + name + `::`
|
|
92
|
+
}))))).apply(s => s.flat());
|
|
93
|
+
let resources = Pulumi.all([
|
|
94
|
+
secretsManagerAccessPolicy.arn,
|
|
95
|
+
taskRunnerPolicy.arn,
|
|
96
|
+
vpcConfig,
|
|
97
|
+
secrets
|
|
98
|
+
]).apply(param => {
|
|
99
|
+
let containerDefinitions = [{
|
|
100
|
+
name: "reventless-ci",
|
|
101
|
+
cpu: 1024,
|
|
102
|
+
image: new Pulumi.Config("ci").require("image"),
|
|
103
|
+
logConfiguration: {
|
|
104
|
+
logDriver: "awslogs",
|
|
105
|
+
options: {
|
|
106
|
+
"awslogs-create-group": true,
|
|
107
|
+
"awslogs-group": "/aws/ecs/reventless-cloner",
|
|
108
|
+
"awslogs-region": new Pulumi.Config("aws").require("region"),
|
|
109
|
+
"awslogs-stream-prefix": "reventless-cloner"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
memory: 4096,
|
|
113
|
+
repositoryCredentials: {
|
|
114
|
+
credentialsParameter: reventlessCiSecretUrn
|
|
115
|
+
},
|
|
116
|
+
secrets: param[3],
|
|
117
|
+
ulimits: [{
|
|
118
|
+
name: "nofile",
|
|
119
|
+
hardLimit: 1048576,
|
|
120
|
+
softLimit: 1048576
|
|
121
|
+
}]
|
|
122
|
+
}];
|
|
123
|
+
let taskDefinition = new (Aws.ecs.TaskDefinition)(name, {
|
|
124
|
+
family: name,
|
|
125
|
+
containerDefinitions: Stdlib_Option.getOrThrow(JSON.stringify(containerDefinitions), undefined),
|
|
126
|
+
cpu: "1024",
|
|
127
|
+
memory: "4096",
|
|
128
|
+
networkMode: "awsvpc",
|
|
129
|
+
requiresCompatibilities: ["FARGATE"],
|
|
130
|
+
executionRoleArn: taskExecutionRole.arn
|
|
131
|
+
}, opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
|
|
132
|
+
let lambdaRole = IAM$PulumiAws.Role.makeWithDefaultPolicy(name, Pulumi.output(AWS$ReventlessAws.AppSync.principal), opts);
|
|
133
|
+
let lambda = new (Aws.lambda.Function)(name, {
|
|
134
|
+
handler: "index.handler",
|
|
135
|
+
runtime: "nodejs22.x",
|
|
136
|
+
code: code,
|
|
137
|
+
role: lambdaRole.arn,
|
|
138
|
+
memorySize: 1024,
|
|
139
|
+
timeout: 180,
|
|
140
|
+
layers: layers,
|
|
141
|
+
tags: AWS_Tags$ReventlessAws.make(name, Cloner$ReventlessCore.componentType),
|
|
142
|
+
environment: {
|
|
143
|
+
variables: Object.fromEntries([
|
|
144
|
+
[
|
|
145
|
+
"TASK_DEFINITION_ARN",
|
|
146
|
+
taskDefinition.arn
|
|
147
|
+
],
|
|
148
|
+
[
|
|
149
|
+
"CLUSTER_ARN",
|
|
150
|
+
cluster.arn
|
|
151
|
+
],
|
|
152
|
+
[
|
|
153
|
+
"STACK_ORG",
|
|
154
|
+
fullQualifiedStackName.organization
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"STACK_PROJECT",
|
|
158
|
+
fullQualifiedStackName.project
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
"STACK_STACK",
|
|
162
|
+
fullQualifiedStackName.stack
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"SUBNETS",
|
|
166
|
+
Stdlib_Option.getOr(JSON.stringify(param[2].subnetIds), "[]")
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
"Environment",
|
|
170
|
+
Pulumi.getStack()
|
|
171
|
+
]
|
|
172
|
+
])
|
|
173
|
+
},
|
|
174
|
+
sourceCodeHash: sourceCodeHash
|
|
175
|
+
}, opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
|
|
176
|
+
lambda.arn.apply(arn => {
|
|
177
|
+
let appsyncInvokeLambdaPolicyDocument = PolicyDocument$PulumiAws.make(undefined, name + "AppSyncInvokePolicy", [{
|
|
178
|
+
Sid: "AllowAppSyncInvoke",
|
|
179
|
+
Principal: {
|
|
180
|
+
Service: AWS$ReventlessAws.AppSync.principal
|
|
181
|
+
},
|
|
182
|
+
Effect: "Allow",
|
|
183
|
+
Action: "lambda:InvokeFunction",
|
|
184
|
+
Resource: arn
|
|
185
|
+
}]);
|
|
186
|
+
let lambdaPolicyDocument = PolicyDocument$PulumiAws.mergePolicyDocuments(name + "LambdaPolicy", [
|
|
187
|
+
Lambda$PulumiAws.defaultLoggingPolicyDocument,
|
|
188
|
+
appsyncInvokeLambdaPolicyDocument,
|
|
189
|
+
secretsManagerPolicyDocument,
|
|
190
|
+
taskRunnerPolicyDocument
|
|
191
|
+
]);
|
|
192
|
+
return lambdaRole.id.apply(lambdaRoleId => {
|
|
193
|
+
new (Aws.iam.RolePolicy)(name + "LambdaRolePolicy", {
|
|
194
|
+
policy: lambdaPolicyDocument.apply(lambdaPolicyDocument => lambdaPolicyDocument),
|
|
195
|
+
role: lambdaRoleId
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
let dataSourceRole = IAM$PulumiAws.Role.makeWithDefaultPolicy(name + "DS", Pulumi.output(AWS$ReventlessAws.AppSync.principal), opts);
|
|
200
|
+
new (Aws.iam.RolePolicy)(name + "DS", {
|
|
201
|
+
policy: lambda.arn.apply(lambdaArn => PolicyDocument$PulumiAws.toJsonString(PolicyDocument$PulumiAws.make(undefined, name + "LambdaPolicy", [{
|
|
202
|
+
Sid: "AllowInvokeLambda",
|
|
203
|
+
Effect: "Allow",
|
|
204
|
+
Action: "lambda:InvokeFunction",
|
|
205
|
+
Resource: lambdaArn
|
|
206
|
+
}]))),
|
|
207
|
+
role: dataSourceRole.id
|
|
208
|
+
}, opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
|
|
209
|
+
let dataSource = new (Aws.appsync.DataSource)(name, {
|
|
210
|
+
type: "AWS_LAMBDA",
|
|
211
|
+
apiId: Output$Pulumi.flatMap(api, api => api.id),
|
|
212
|
+
lambdaConfig: {
|
|
213
|
+
functionArn: lambda.arn
|
|
214
|
+
},
|
|
215
|
+
serviceRoleArn: dataSourceRole.arn
|
|
216
|
+
}, opts);
|
|
217
|
+
let field = AdminApi$ReventlessCore.cloneMutationEntry.fieldNames[0];
|
|
218
|
+
let resolver = AppSync_Resolver_Retrying$ReventlessAws.makeUnitJsResolver(field, api, dataSource.name, "Mutation", field, `import { util } from '@aws-appsync/utils';
|
|
219
|
+
export function request(ctx) {
|
|
220
|
+
return {
|
|
221
|
+
operation: 'Invoke',
|
|
222
|
+
payload: {
|
|
223
|
+
restoreDateTime: ctx.args.restoreDateTime,
|
|
224
|
+
meta: {
|
|
225
|
+
ip: ctx.identity.sourceIp,
|
|
226
|
+
user: ctx.identity.username
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
export function response(ctx) {
|
|
232
|
+
if (ctx.error) util.error(ctx.error.message, ctx.error.type);
|
|
233
|
+
return ctx.result;
|
|
234
|
+
}
|
|
235
|
+
`, opts);
|
|
236
|
+
return [Util_AppSync$ReventlessAws.toResourceNative(resolver)];
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
resources: resources
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export {
|
|
244
|
+
make,
|
|
245
|
+
}
|
|
246
|
+
/* @pulumi/aws Not a pure module */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
open ReventlessCore.Cloner
|
|
2
|
+
|
|
3
|
+
let log = ReventlessCore.Logger.fromEnv()
|
|
4
|
+
|
|
5
|
+
let clone = async (~taskDefinition, ~cluster, ~fullQualifiedStackName, ~subnets, payload, _) => {
|
|
6
|
+
let {organization, project, stack} = fullQualifiedStackName
|
|
7
|
+
|
|
8
|
+
let environment = {
|
|
9
|
+
[
|
|
10
|
+
("REVENTLESS_CORE_STACK", `${organization}/${project}/${stack}`),
|
|
11
|
+
("RESTORE_DATE_TIME", payload["restoreDateTime"]),
|
|
12
|
+
]->Dict.fromArray
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
log.info(
|
|
16
|
+
~comp="ClonerRunner",
|
|
17
|
+
"clone: requested by user " ++
|
|
18
|
+
payload["meta"]["user"] ++
|
|
19
|
+
" from ip " ++
|
|
20
|
+
payload["meta"]["ip"],
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
let _ = await {
|
|
24
|
+
taskDefinition: taskDefinition->Pulumi.Output.get,
|
|
25
|
+
cluster: cluster->Pulumi.Output.get,
|
|
26
|
+
networkConfiguration: {
|
|
27
|
+
awsvpcConfiguration: {subnets},
|
|
28
|
+
},
|
|
29
|
+
launchType: #FARGATE,
|
|
30
|
+
overrides: {
|
|
31
|
+
containerOverrides: [
|
|
32
|
+
{
|
|
33
|
+
name: "reventless-ci",
|
|
34
|
+
environment,
|
|
35
|
+
command: ["reventless-ci", "clone-environment"],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
->AwsSdk.ECS.RunTaskCommand.make
|
|
41
|
+
->AwsSdk.ECS.RunTaskCommand.send
|
|
42
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as ECS$AwsSdk from "@reventlessdev/rescript-aws-sdk/src/ECS.res.mjs";
|
|
4
|
+
import * as ClientEcs from "@aws-sdk/client-ecs";
|
|
5
|
+
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
6
|
+
|
|
7
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
8
|
+
|
|
9
|
+
async function clone(taskDefinition, cluster, fullQualifiedStackName, subnets, payload, param) {
|
|
10
|
+
let environment = Object.fromEntries([
|
|
11
|
+
[
|
|
12
|
+
"REVENTLESS_CORE_STACK",
|
|
13
|
+
fullQualifiedStackName.organization + `/` + fullQualifiedStackName.project + `/` + fullQualifiedStackName.stack
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"RESTORE_DATE_TIME",
|
|
17
|
+
payload.restoreDateTime
|
|
18
|
+
]
|
|
19
|
+
]);
|
|
20
|
+
log.info("ClonerRunner", undefined, "clone: requested by user " + payload.meta.user + " from ip " + payload.meta.ip);
|
|
21
|
+
await ECS$AwsSdk.RunTaskCommand.send(new ClientEcs.RunTaskCommand({
|
|
22
|
+
taskDefinition: taskDefinition.get(),
|
|
23
|
+
launchType: "FARGATE",
|
|
24
|
+
cluster: cluster.get(),
|
|
25
|
+
networkConfiguration: {
|
|
26
|
+
awsvpcConfiguration: subnets
|
|
27
|
+
},
|
|
28
|
+
overrides: {
|
|
29
|
+
containerOverrides: [{
|
|
30
|
+
name: "reventless-ci",
|
|
31
|
+
command: [
|
|
32
|
+
"reventless-ci",
|
|
33
|
+
"clone-environment"
|
|
34
|
+
],
|
|
35
|
+
environment: environment
|
|
36
|
+
}]
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
log,
|
|
43
|
+
clone,
|
|
44
|
+
}
|
|
45
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module CloudwatchEvents = HeartbeatRunner_CloudWatchEvents
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
type runtimeParts = Util.Lambda.runtimeParts
|
|
2
|
+
|
|
3
|
+
let make: ReventlessCore.Heartbeat_Adapter.runnerMaker<runtimeParts> = (
|
|
4
|
+
~name,
|
|
5
|
+
~remoteChannel,
|
|
6
|
+
~timeout,
|
|
7
|
+
~runtime,
|
|
8
|
+
~opts,
|
|
9
|
+
) => {
|
|
10
|
+
let opts = opts->ReventlessCore.Util.Pulumi.ComponentResourceOptions.toCustomResourceOptions
|
|
11
|
+
|
|
12
|
+
let cloudwatchEventRule = {
|
|
13
|
+
open PulumiAws.Cloudwatch
|
|
14
|
+
EventRule.make(
|
|
15
|
+
~name=Pulumi.Pulumi.getStackName() ++ ("-" ++ name),
|
|
16
|
+
~args={
|
|
17
|
+
description: "Send a heartbeat to the Core Plugin ExtensionPoint"->Pulumi.Input.make,
|
|
18
|
+
scheduleExpression: EventRule.ScheduleExpression.every(timeout->Minutes),
|
|
19
|
+
},
|
|
20
|
+
~opts,
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let lambda = runtime.parts.lambda
|
|
25
|
+
let lambdaRole = runtime.parts.lambdaRole
|
|
26
|
+
let coreSqsQueue = remoteChannel.resources->Util_SQS.findResolvedResource
|
|
27
|
+
|
|
28
|
+
let _attachPoliciesAndSetEventTarget =
|
|
29
|
+
(
|
|
30
|
+
lambda->Pulumi.Output.flatMap(lambda => lambda.arn),
|
|
31
|
+
lambda->Pulumi.Output.flatMap(lambda => lambda.name),
|
|
32
|
+
lambdaRole.id,
|
|
33
|
+
)
|
|
34
|
+
->Pulumi.Output.all3
|
|
35
|
+
->Pulumi.Output.apply(((lambdaArn, lambdaName, heartbeatRoleId)) => {
|
|
36
|
+
open PulumiAws.PolicyDocument
|
|
37
|
+
|
|
38
|
+
let _addHeartbeatLambdaPermission = PulumiAws.Lambda.Permission.make(
|
|
39
|
+
~name,
|
|
40
|
+
~args={
|
|
41
|
+
action: "lambda:InvokeFunction",
|
|
42
|
+
function: lambdaName->Pulumi.Input.make,
|
|
43
|
+
principal: AWS.CloudwatchEventRule.principal,
|
|
44
|
+
},
|
|
45
|
+
~opts,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
let heartbeatLambdaSendMessagePolicyDocument = {
|
|
49
|
+
PulumiAws.PolicyDocument.make(
|
|
50
|
+
~statements=[
|
|
51
|
+
{
|
|
52
|
+
sid: "AllowLambdaToSendSQS",
|
|
53
|
+
effect: Allow,
|
|
54
|
+
actions: Action("sqs:SendMessage"),
|
|
55
|
+
resources: Resource(coreSqsQueue.urn),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
let _attachHeartbeatLambdaPolicy = PulumiAws.IAM.RolePolicy.make(
|
|
62
|
+
~name=name ++ "RolePolicy",
|
|
63
|
+
~args={
|
|
64
|
+
policy: PulumiAws.PolicyDocument.mergePolicyDocuments(
|
|
65
|
+
name ++ "Policy",
|
|
66
|
+
[
|
|
67
|
+
PulumiAws.Lambda.defaultLoggingPolicyDocument,
|
|
68
|
+
heartbeatLambdaSendMessagePolicyDocument,
|
|
69
|
+
],
|
|
70
|
+
)->Pulumi.Output.asInput,
|
|
71
|
+
role: heartbeatRoleId->Pulumi.Input.make,
|
|
72
|
+
},
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
let _cloudwatchEventTarget = {
|
|
76
|
+
open PulumiAws.Cloudwatch
|
|
77
|
+
EventTarget.make(
|
|
78
|
+
~name,
|
|
79
|
+
~args={
|
|
80
|
+
rule: EventTarget.Rule.ofEventRule(cloudwatchEventRule),
|
|
81
|
+
arn: lambdaArn->Pulumi.Input.make,
|
|
82
|
+
},
|
|
83
|
+
~opts,
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
{
|
|
89
|
+
resources: [
|
|
90
|
+
lambda
|
|
91
|
+
->Pulumi.Output.apply(lambda => lambda->Util_Lambda.toResource)
|
|
92
|
+
->ReventlessCore.Adapter.outputToResource,
|
|
93
|
+
cloudwatchEventRule->Util_Cloudwatch.EventRule.toResource,
|
|
94
|
+
],
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Aws from "@pulumi/aws";
|
|
4
|
+
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
5
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
6
|
+
import * as Lambda$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Lambda/Lambda.res.mjs";
|
|
7
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
8
|
+
import * as AWS$ReventlessAws from "../../adapter/AWS.res.mjs";
|
|
9
|
+
import * as Adapter$ReventlessCore from "@reventlessdev/reventless-core/src/adapter/Adapter.res.mjs";
|
|
10
|
+
import * as Util_SQS$ReventlessAws from "../../util/Util_SQS.res.mjs";
|
|
11
|
+
import * as PolicyDocument$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/IAM/PolicyDocument.res.mjs";
|
|
12
|
+
import * as Util_Lambda$ReventlessAws from "../../util/Util_Lambda.res.mjs";
|
|
13
|
+
import * as Util_Pulumi$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Pulumi.res.mjs";
|
|
14
|
+
import * as Util_Cloudwatch$ReventlessAws from "../../util/Util_Cloudwatch.res.mjs";
|
|
15
|
+
import * as Cloudwatch_EventRule$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Cloudwatch/Cloudwatch_EventRule.res.mjs";
|
|
16
|
+
import * as Cloudwatch_EventTarget$PulumiAws from "@reventlessdev/rescript-pulumi-aws/src/Cloudwatch/Cloudwatch_EventTarget.res.mjs";
|
|
17
|
+
|
|
18
|
+
function make(name, remoteChannel, timeout, runtime, opts) {
|
|
19
|
+
let opts$1 = Util_Pulumi$ReventlessCore.ComponentResourceOptions.toCustomResourceOptions(opts);
|
|
20
|
+
let cloudwatchEventRule = new (Aws.cloudwatch.EventRule)(Pulumi.getStack() + ("-" + name), {
|
|
21
|
+
description: "Send a heartbeat to the Core Plugin ExtensionPoint",
|
|
22
|
+
scheduleExpression: Primitive_option.some(Cloudwatch_EventRule$PulumiAws.ScheduleExpression.every({
|
|
23
|
+
TAG: "Minutes",
|
|
24
|
+
_0: timeout
|
|
25
|
+
}))
|
|
26
|
+
}, opts$1);
|
|
27
|
+
let lambda = runtime.parts.lambda;
|
|
28
|
+
let lambdaRole = runtime.parts.lambdaRole;
|
|
29
|
+
let coreSqsQueue = Util_SQS$ReventlessAws.findResolvedResource(remoteChannel.resources);
|
|
30
|
+
Pulumi.all([
|
|
31
|
+
Output$Pulumi.flatMap(lambda, lambda => lambda.arn),
|
|
32
|
+
Output$Pulumi.flatMap(lambda, lambda => lambda.name),
|
|
33
|
+
lambdaRole.id
|
|
34
|
+
]).apply(param => {
|
|
35
|
+
new (Aws.lambda.Permission)(name, {
|
|
36
|
+
action: "lambda:InvokeFunction",
|
|
37
|
+
function: param[1],
|
|
38
|
+
principal: AWS$ReventlessAws.CloudwatchEventRule.principal
|
|
39
|
+
}, opts$1);
|
|
40
|
+
let heartbeatLambdaSendMessagePolicyDocument = PolicyDocument$PulumiAws.make(undefined, undefined, [{
|
|
41
|
+
Sid: "AllowLambdaToSendSQS",
|
|
42
|
+
Effect: "Allow",
|
|
43
|
+
Action: "sqs:SendMessage",
|
|
44
|
+
Resource: coreSqsQueue.urn
|
|
45
|
+
}]);
|
|
46
|
+
new (Aws.iam.RolePolicy)(name + "RolePolicy", {
|
|
47
|
+
policy: PolicyDocument$PulumiAws.mergePolicyDocuments(name + "Policy", [
|
|
48
|
+
Lambda$PulumiAws.defaultLoggingPolicyDocument,
|
|
49
|
+
heartbeatLambdaSendMessagePolicyDocument
|
|
50
|
+
]),
|
|
51
|
+
role: param[2]
|
|
52
|
+
});
|
|
53
|
+
new (Aws.cloudwatch.EventTarget)(name, {
|
|
54
|
+
rule: Cloudwatch_EventTarget$PulumiAws.Rule.ofEventRule(cloudwatchEventRule),
|
|
55
|
+
arn: param[0]
|
|
56
|
+
}, opts$1);
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
resources: [
|
|
60
|
+
Adapter$ReventlessCore.outputToResource(lambda.apply(lambda => Util_Lambda$ReventlessAws.toResource(undefined, lambda))),
|
|
61
|
+
Util_Cloudwatch$ReventlessAws.EventRule.toResource(cloudwatchEventRule)
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
make,
|
|
68
|
+
}
|
|
69
|
+
/* @pulumi/aws Not a pure module */
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
module CommandTopicChannel = CommandTopicChannel.SQS_Sync
|
|
2
|
+
module RuntimeEnvironment = RuntimeEnvironment.Lambda
|
|
3
|
+
|
|
4
|
+
type context = PulumiAws.Lambda.context
|
|
5
|
+
type runtimeParts = Util.Lambda.runtimeParts
|
|
6
|
+
|
|
7
|
+
// Admin-specific data that the Plugin extension point Lambda needs but that
|
|
8
|
+
// the generic ExtensionPointRuntime_Builder.T params don't carry. Wired in
|
|
9
|
+
// from `Platform.res` after `Admin.construct()` exposes the read model and
|
|
10
|
+
// scheduler resources; consumed lazily at deploy-resolve time when
|
|
11
|
+
// `forCommandTopic` runs inside its `Pulumi.Output.apply`.
|
|
12
|
+
type adminExtras = {
|
|
13
|
+
pluginReadModelTableName: option<Pulumi.Output.t<string>>,
|
|
14
|
+
schedulerRoleArn: option<Pulumi.Output.t<string>>,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let adminExtras: ref<adminExtras> = ref({
|
|
18
|
+
pluginReadModelTableName: None,
|
|
19
|
+
schedulerRoleArn: None,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
let registerPluginExtensionPoint = (~pluginReadModelTableName=?, ~schedulerRoleArn=?, ()) =>
|
|
23
|
+
adminExtras := {pluginReadModelTableName, schedulerRoleArn}
|
|
24
|
+
|
|
25
|
+
let forCommandTopic = (
|
|
26
|
+
~handler as _,
|
|
27
|
+
~connect,
|
|
28
|
+
~memorySize=1024,
|
|
29
|
+
~timeout=30,
|
|
30
|
+
~specModulePath as _,
|
|
31
|
+
~mappingsModulePath as _,
|
|
32
|
+
~publishToAggregatesQueueUrls,
|
|
33
|
+
commandTopic,
|
|
34
|
+
) => {
|
|
35
|
+
let commandTopicResource = commandTopic->ReventlessCore.Component.toPulumiResource
|
|
36
|
+
let extras = adminExtras.contents
|
|
37
|
+
|
|
38
|
+
let channel = commandTopic->ReventlessCore.CommandTopic_Adapter.channel
|
|
39
|
+
let channelParts: Util.SQS.channelParts = Obj.magic(channel.parts)
|
|
40
|
+
let queue = channelParts.queue
|
|
41
|
+
|
|
42
|
+
// The EP command-handler Lambda inherits the bare EP CommandTopic resource
|
|
43
|
+
// name (`<EP>ExtPoint`) and appends the unified `CmdHandler` kind so it is
|
|
44
|
+
// greppable alongside the aggregate/DCB command handlers (analysis §8.2).
|
|
45
|
+
// Mirrors ExtensionPointRuntime_Builder_PerExtensionPoint.
|
|
46
|
+
let name = commandTopicResource.name->Option.getOr("UnnamedExtPoint") ++ "CmdHandler"
|
|
47
|
+
let opts = {Pulumi.ComponentResource.parent: commandTopicResource}
|
|
48
|
+
|
|
49
|
+
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
50
|
+
|
|
51
|
+
let outputOrPlaceholder = opt =>
|
|
52
|
+
switch opt {
|
|
53
|
+
| Some(v) => v->Pulumi.Output.asInput
|
|
54
|
+
| None => "NOT_AVAILABLE"->Pulumi.Output.make->Pulumi.Output.asInput
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Build publishToAggregates env var mapping
|
|
58
|
+
let publishToAggregatesEnvVars: dict<string> = Dict.make()
|
|
59
|
+
publishToAggregatesQueueUrls->Dict.forEachWithKey((queueUrlOutput, aggName) => {
|
|
60
|
+
let envVar = `PTA_${aggName}_QUEUE_URL`
|
|
61
|
+
envVars->Dict.set(envVar, queueUrlOutput->Pulumi.Output.asInput)
|
|
62
|
+
publishToAggregatesEnvVars->Dict.set(aggName, envVar)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
let publishToAggregatesJson =
|
|
66
|
+
publishToAggregatesEnvVars
|
|
67
|
+
->Dict.toArray
|
|
68
|
+
->Array.map(((aggName, envVar)) =>
|
|
69
|
+
`${aggName->JSON.stringifyAny->Option.getOr(`""`)}: ${envVar->JSON.stringifyAny->Option.getOr(`""`)}`
|
|
70
|
+
)
|
|
71
|
+
->Array.join(",")
|
|
72
|
+
|
|
73
|
+
// Build HANDLER_CONFIG JSON
|
|
74
|
+
let queueName =
|
|
75
|
+
queue.id->Pulumi.Output.apply(id =>
|
|
76
|
+
id->String.split("/")->Array.at(-1)->Option.getOr(id)
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
let handlerConfigJson =
|
|
80
|
+
Pulumi.Output.all([
|
|
81
|
+
queue.id,
|
|
82
|
+
extras.pluginReadModelTableName->outputOrPlaceholder->Obj.magic,
|
|
83
|
+
extras.schedulerRoleArn->outputOrPlaceholder->Obj.magic,
|
|
84
|
+
queue.arn,
|
|
85
|
+
queueName,
|
|
86
|
+
])
|
|
87
|
+
->Pulumi.Output.apply(values => {
|
|
88
|
+
let queueUrl = values->Array.getUnsafe(0)
|
|
89
|
+
let rmTable = values->Array.getUnsafe(1)
|
|
90
|
+
let schedRoleArn = values->Array.getUnsafe(2)
|
|
91
|
+
let schedQueueArn = values->Array.getUnsafe(3)
|
|
92
|
+
let schedQueueName = values->Array.getUnsafe(4)
|
|
93
|
+
`{"queueUrl":"${queueUrl}","pluginReadModelTableName":"${rmTable}","schedulerRoleArn":"${schedRoleArn}","schedulerQueueArn":"${schedQueueArn}","schedulerQueueName":"${schedQueueName}","publishToAggregates":{${publishToAggregatesJson}}}`
|
|
94
|
+
})
|
|
95
|
+
envVars->Dict.set("HANDLER_CONFIG", handlerConfigJson->Pulumi.Output.asInput)
|
|
96
|
+
|
|
97
|
+
// No user packages — all framework imports are in the Layer
|
|
98
|
+
let {code, sourceCodeHash} = Util_Bundle.buildCodeArchive(
|
|
99
|
+
~entryPointModule="@reventlessdev/reventless-aws/src/adapter/Runtime/PluginExtensionPointEntryPoint.mjs",
|
|
100
|
+
~packageDirs=Dict.make(),
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
let runtime = RuntimeEnvironment_Lambda.makeFromCodeAsset(
|
|
104
|
+
~name,
|
|
105
|
+
~code,
|
|
106
|
+
~sourceCodeHash,
|
|
107
|
+
~envVars,
|
|
108
|
+
~memorySize,
|
|
109
|
+
~timeout,
|
|
110
|
+
~opts,
|
|
111
|
+
)
|
|
112
|
+
connect(~runtime)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
let finish = () => ()
|