@reventlessdev/rescript-pulumi-aws 2.4.0-alpha.43

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.
Files changed (169) hide show
  1. package/CHANGELOG.md +366 -0
  2. package/LICENSE +202 -0
  3. package/README.md +19 -0
  4. package/package.json +52 -0
  5. package/rescript.json +27 -0
  6. package/scripts/bundle-resolvers.mjs +77 -0
  7. package/src/AWS/Aws_AvailabilityZone.res +9 -0
  8. package/src/AWS/Aws_AvailabilityZone.res.mjs +9 -0
  9. package/src/AWS/Aws_AvailabilityZone.resi +9 -0
  10. package/src/AWS/Aws_Aws.res +29 -0
  11. package/src/AWS/Aws_Aws.res.mjs +32 -0
  12. package/src/AWS/Aws_Common.res +2 -0
  13. package/src/AWS/Aws_Common.res.mjs +2 -0
  14. package/src/AWS/Aws_Provider.res +10 -0
  15. package/src/AWS/Aws_Provider.res.mjs +2 -0
  16. package/src/Acm/Acm.res +5 -0
  17. package/src/Acm/Acm.res.mjs +12 -0
  18. package/src/Acm/Acm_Certificate.res +27 -0
  19. package/src/Acm/Acm_Certificate.res.mjs +2 -0
  20. package/src/Acm/Acm_CertificateValidation.res +22 -0
  21. package/src/Acm/Acm_CertificateValidation.res.mjs +2 -0
  22. package/src/AppSync/AppSync.res +7 -0
  23. package/src/AppSync/AppSync.res.mjs +18 -0
  24. package/src/AppSync/AppSync_DataSource.res +93 -0
  25. package/src/AppSync/AppSync_DataSource.res.mjs +42 -0
  26. package/src/AppSync/AppSync_Function.res +75 -0
  27. package/src/AppSync/AppSync_Function.res.mjs +36 -0
  28. package/src/AppSync/AppSync_GraphQLApi.res +65 -0
  29. package/src/AppSync/AppSync_GraphQLApi.res.mjs +20 -0
  30. package/src/AppSync/AppSync_Resolver.res +229 -0
  31. package/src/AppSync/AppSync_Resolver.res.mjs +113 -0
  32. package/src/AppSync/AppSync_ResolverRuntime.res +214 -0
  33. package/src/AppSync/AppSync_ResolverRuntime.res.mjs +15 -0
  34. package/src/AppSync/AppSync_Resolver_Functions.res +998 -0
  35. package/src/AppSync/AppSync_Resolver_Functions.res.mjs +913 -0
  36. package/src/Aws.res +5 -0
  37. package/src/Aws.res.mjs +16 -0
  38. package/src/AwsNative/AppSync/AwsNative_AppSync_Api.res +92 -0
  39. package/src/AwsNative/AppSync/AwsNative_AppSync_Api.res.mjs +12 -0
  40. package/src/AwsNative/AppSync/AwsNative_AppSync_ChannelNamespace.res +81 -0
  41. package/src/AwsNative/AppSync/AwsNative_AppSync_ChannelNamespace.res.mjs +18 -0
  42. package/src/AwsNative/AppSync/AwsNative_AppSync_Resolver.res +39 -0
  43. package/src/AwsNative/AppSync/AwsNative_AppSync_Resolver.res.mjs +12 -0
  44. package/src/AwsNative/AwsNative.res +10 -0
  45. package/src/AwsNative/AwsNative.res.mjs +13 -0
  46. package/src/CloudFront/CloudFront.res +5 -0
  47. package/src/CloudFront/CloudFront.res.mjs +12 -0
  48. package/src/CloudFront/CloudFront_Distribution.res +81 -0
  49. package/src/CloudFront/CloudFront_Distribution.res.mjs +2 -0
  50. package/src/CloudFront/CloudFront_OriginAccessControl.res +20 -0
  51. package/src/CloudFront/CloudFront_OriginAccessControl.res.mjs +2 -0
  52. package/src/Cloudwatch/Cloudwatch.res +7 -0
  53. package/src/Cloudwatch/Cloudwatch.res.mjs +18 -0
  54. package/src/Cloudwatch/Cloudwatch_EventRule.res +52 -0
  55. package/src/Cloudwatch/Cloudwatch_EventRule.res.mjs +37 -0
  56. package/src/Cloudwatch/Cloudwatch_EventTarget.res +28 -0
  57. package/src/Cloudwatch/Cloudwatch_EventTarget.res.mjs +25 -0
  58. package/src/Cloudwatch/Cloudwatch_LogGroup.res +14 -0
  59. package/src/Cloudwatch/Cloudwatch_LogGroup.res.mjs +2 -0
  60. package/src/Cloudwatch/Cloudwatch_LogMetricFilter.res +28 -0
  61. package/src/Cloudwatch/Cloudwatch_LogMetricFilter.res.mjs +2 -0
  62. package/src/Cognito/Cognito.res +8 -0
  63. package/src/Cognito/Cognito.res.mjs +21 -0
  64. package/src/Cognito/Cognito_IdentityPool.res +148 -0
  65. package/src/Cognito/Cognito_IdentityPool.res.mjs +65 -0
  66. package/src/Cognito/Cognito_IdentityPoolRoleAttachment.res +18 -0
  67. package/src/Cognito/Cognito_IdentityPoolRoleAttachment.res.mjs +2 -0
  68. package/src/Cognito/Cognito_UserGroup.res +16 -0
  69. package/src/Cognito/Cognito_UserGroup.res.mjs +2 -0
  70. package/src/Cognito/Cognito_UserPool.res +125 -0
  71. package/src/Cognito/Cognito_UserPool.res.mjs +44 -0
  72. package/src/Cognito/Cognito_UserPoolClient.res +33 -0
  73. package/src/Cognito/Cognito_UserPoolClient.res.mjs +2 -0
  74. package/src/DynamoDb/DynamoDb.res +5 -0
  75. package/src/DynamoDb/DynamoDb.res.mjs +12 -0
  76. package/src/DynamoDb/DynamoDb_Stream.res +41 -0
  77. package/src/DynamoDb/DynamoDb_Stream.res.mjs +2 -0
  78. package/src/DynamoDb/DynamoDb_Table.res +66 -0
  79. package/src/DynamoDb/DynamoDb_Table.res.mjs +2 -0
  80. package/src/EC2/EC2.res +13 -0
  81. package/src/EC2/EC2.res.mjs +36 -0
  82. package/src/EC2/EC2_Common.res +13 -0
  83. package/src/EC2/EC2_Common.res.mjs +22 -0
  84. package/src/EC2/EC2_DefaultSecurityGroup.res +22 -0
  85. package/src/EC2/EC2_DefaultSecurityGroup.res.mjs +19 -0
  86. package/src/EC2/EC2_Eip.res +24 -0
  87. package/src/EC2/EC2_Eip.res.mjs +18 -0
  88. package/src/EC2/EC2_InternetGateway.res +25 -0
  89. package/src/EC2/EC2_InternetGateway.res.mjs +18 -0
  90. package/src/EC2/EC2_NatGateway.res +30 -0
  91. package/src/EC2/EC2_NatGateway.res.mjs +18 -0
  92. package/src/EC2/EC2_RouteTable.res +49 -0
  93. package/src/EC2/EC2_RouteTable.res.mjs +38 -0
  94. package/src/EC2/EC2_RouteTableAssociation.res +30 -0
  95. package/src/EC2/EC2_RouteTableAssociation.res.mjs +18 -0
  96. package/src/EC2/EC2_SecurityGroup.res +44 -0
  97. package/src/EC2/EC2_SecurityGroup.res.mjs +49 -0
  98. package/src/EC2/EC2_Subnet.res +31 -0
  99. package/src/EC2/EC2_Subnet.res.mjs +19 -0
  100. package/src/EC2/EC2_Vpc.res +25 -0
  101. package/src/EC2/EC2_Vpc.res.mjs +18 -0
  102. package/src/EC2/EC2_VpcEndpoint.res +43 -0
  103. package/src/EC2/EC2_VpcEndpoint.res.mjs +22 -0
  104. package/src/ECS/ECS.res +6 -0
  105. package/src/ECS/ECS.res.mjs +15 -0
  106. package/src/ECS/ECS_Cluster.res +10 -0
  107. package/src/ECS/ECS_Cluster.res.mjs +2 -0
  108. package/src/ECS/ECS_Container.res +58 -0
  109. package/src/ECS/ECS_Container.res.mjs +2 -0
  110. package/src/ECS/ECS_TaskDefinition.res +31 -0
  111. package/src/ECS/ECS_TaskDefinition.res.mjs +2 -0
  112. package/src/IAM/IAM.res +148 -0
  113. package/src/IAM/IAM.res.mjs +61 -0
  114. package/src/IAM/IAM_ManagedPolicies.res +32 -0
  115. package/src/IAM/IAM_ManagedPolicies.res.mjs +2 -0
  116. package/src/IAM/PolicyDocument.res +163 -0
  117. package/src/IAM/PolicyDocument.res.mjs +164 -0
  118. package/src/Kinesis/Kinesis.res +4 -0
  119. package/src/Kinesis/Kinesis.res.mjs +9 -0
  120. package/src/Kinesis/Kinesis_Stream.res +70 -0
  121. package/src/Kinesis/Kinesis_Stream.res.mjs +9 -0
  122. package/src/Lambda/EventSourceMapping.res +78 -0
  123. package/src/Lambda/EventSourceMapping.res.mjs +2 -0
  124. package/src/Lambda/FunctionUrl.res +41 -0
  125. package/src/Lambda/FunctionUrl.res.mjs +2 -0
  126. package/src/Lambda/Lambda.res +270 -0
  127. package/src/Lambda/Lambda.res.mjs +94 -0
  128. package/src/Route53/Route53.res +4 -0
  129. package/src/Route53/Route53.res.mjs +9 -0
  130. package/src/Route53/Route53_Record.res +36 -0
  131. package/src/Route53/Route53_Record.res.mjs +2 -0
  132. package/src/S3/S3.res +10 -0
  133. package/src/S3/S3.res.mjs +27 -0
  134. package/src/S3/S3_Bucket.res +236 -0
  135. package/src/S3/S3_Bucket.res.mjs +2 -0
  136. package/src/S3/S3_BucketAclV2.res +24 -0
  137. package/src/S3/S3_BucketAclV2.res.mjs +2 -0
  138. package/src/S3/S3_BucketObject.res +22 -0
  139. package/src/S3/S3_BucketObject.res.mjs +2 -0
  140. package/src/S3/S3_BucketOwnershipControls.res +19 -0
  141. package/src/S3/S3_BucketOwnershipControls.res.mjs +2 -0
  142. package/src/S3/S3_BucketPolicy.res +13 -0
  143. package/src/S3/S3_BucketPolicy.res.mjs +2 -0
  144. package/src/S3/S3_BucketPublicAccessBlock.res +16 -0
  145. package/src/S3/S3_BucketPublicAccessBlock.res.mjs +2 -0
  146. package/src/S3/S3_BucketV2.res +11 -0
  147. package/src/S3/S3_BucketV2.res.mjs +2 -0
  148. package/src/SES/SES.bs.js +11 -0
  149. package/src/SES/SES.res +25 -0
  150. package/src/SES/SES.res.mjs +12 -0
  151. package/src/SNS/SNS.res +5 -0
  152. package/src/SNS/SNS.res.mjs +12 -0
  153. package/src/SNS/SNS_Topic.res +71 -0
  154. package/src/SNS/SNS_Topic.res.mjs +2 -0
  155. package/src/SNS/SNS_TopicSubscription.res +21 -0
  156. package/src/SNS/SNS_TopicSubscription.res.mjs +2 -0
  157. package/src/SQS/SQS.res +5 -0
  158. package/src/SQS/SQS.res.mjs +12 -0
  159. package/src/SQS/SQS_Queue.res +92 -0
  160. package/src/SQS/SQS_Queue.res.mjs +19 -0
  161. package/src/SQS/SQS_QueuePolicy.res +13 -0
  162. package/src/SQS/SQS_QueuePolicy.res.mjs +2 -0
  163. package/src/SecretsManager/GetSecretVersion.res +37 -0
  164. package/src/SecretsManager/GetSecretVersion.res.mjs +23 -0
  165. package/src/example/CustomDomainExample.res +71 -0
  166. package/src/example/CustomDomainExample.res.mjs +57 -0
  167. package/tests/AppSync_Resolver_FunctionsTest.mjs +597 -0
  168. package/tests/__mocks__/appsync-utils.mjs +26 -0
  169. package/tests/resolverTestHelper.mjs +46 -0
@@ -0,0 +1,4 @@
1
+ /** @pulumi/aws/kinesis
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/kinesis
3
+ */
4
+ module Stream = Kinesis_Stream
@@ -0,0 +1,9 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let Stream;
5
+
6
+ export {
7
+ Stream,
8
+ }
9
+ /* No side effect */
@@ -0,0 +1,70 @@
1
+ /** @pulumi/aws/kinesis/Stream
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/kinesis/stream
3
+ */
4
+ type t = {arn: Pulumi.Output.t<string>, name: Pulumi.Output.t<string>}
5
+ type stream = t
6
+
7
+ type args = {
8
+ arn?: Pulumi.Input.t<string>,
9
+ encryptionType?: Pulumi.Input.t<string>,
10
+ kmsKeyId?: Pulumi.Input.t<string>,
11
+ name?: Pulumi.Input.t<string>,
12
+ retentionPeriod?: Pulumi.Input.t<int>,
13
+ shardCount?: Pulumi.Input.t<int>,
14
+ shardLevelMetrics?: Pulumi.Input.t<array<string>>,
15
+ tags?: Pulumi.Input.t<Aws.tags>,
16
+ }
17
+
18
+ type info = {
19
+ data: string,
20
+ kinesisSchemaVersion: string,
21
+ partitionKey: string,
22
+ sequenceNumber: string,
23
+ }
24
+
25
+ type record = {
26
+ awsRegion: string,
27
+ eventID: string,
28
+ eventName: string,
29
+ eventSource: string,
30
+ eventSourceARN: string,
31
+ eventVersion: string,
32
+ invokeIdentityArn: string,
33
+ kinesis: info,
34
+ }
35
+
36
+ type event = {@as("Records") records: array<record>}
37
+
38
+ type handler = Lambda.eventHandlerNoResult<event>
39
+
40
+ type subscriptionArgs = {
41
+ startingPosition: Pulumi.Input.t<string>, //TODO enums
42
+ batchSize?: Pulumi.Input.t<int>,
43
+ startingPositionTimestamp?: Pulumi.Input.t<string>,
44
+ }
45
+
46
+ module EventSubscription = {
47
+ type t = {
48
+ name: string,
49
+ stream: stream,
50
+ handler: handler,
51
+ args: subscriptionArgs,
52
+ opts?: Pulumi.CustomResourceOptions.t,
53
+ }
54
+ }
55
+
56
+ @module("@pulumi/aws") @scope("kinesis") @new
57
+ external make: (
58
+ ~name: string,
59
+ ~args: args=?,
60
+ ~opts: Pulumi.CustomResourceOptions.t=?
61
+ ) => stream = "Stream"
62
+
63
+ @send
64
+ external onEvent: (
65
+ stream,
66
+ ~name: string,
67
+ ~handler: Lambda.eventHandlerNoResult<event>,
68
+ ~args: subscriptionArgs=?,
69
+ ~opts: Pulumi.CustomResourceOptions.t=?
70
+ ) => EventSubscription.t = "onEvent"
@@ -0,0 +1,9 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let EventSubscription = {};
5
+
6
+ export {
7
+ EventSubscription,
8
+ }
9
+ /* No side effect */
@@ -0,0 +1,78 @@
1
+ /** @pulumi/aws/lambda/eventsourcemapping
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/lambda/eventsourcemapping/
3
+ */
4
+ type onFailure = {destinationArn: Pulumi.Input.t<string>}
5
+
6
+ type destinationConfig = {onFailure: onFailure}
7
+
8
+ type functionResponseType = ReportBatchItemFailures
9
+
10
+ type startingPosition = AT_TIMESTAMP | LATEST | TRIM_HORIZON
11
+
12
+ /** construct an eventSourceMappingsArgs object
13
+
14
+ functionName: The name or the ARN of the Lambda function that will be subscribing to events.
15
+
16
+ batchSize: The largest number of records that Lambda will retrieve from your event source at the time of invocation.
17
+ Defaults to 100 for DynamoDB, Kinesis, MQ and MSK, 10 for SQS.
18
+
19
+ bisectBatchOnFunctionError: If the function returns an error, split the batch in two and retry.
20
+ Only available for stream sources (DynamoDB and Kinesis). Defaults to false.
21
+
22
+ enabled: Determines if the mapping will be enabled on creation. Defaults to true.
23
+
24
+ eventSourceArn: The event source ARN - this is required for Kinesis stream, DynamoDB stream, SQS queue, MQ broker or MSK cluster.
25
+ It is incompatible with a Self Managed Kafka source.
26
+
27
+ functionResponseTypes: A list of current response type enums applied to the event source mapping for AWS Lambda checkpointing.
28
+ Only available for stream sources (DynamoDB and Kinesis). Valid values: ReportBatchItemFailures.
29
+
30
+ maximumBatchingWindowInSeconds: The maximum amount of time to gather records before invoking the function, in seconds (between 0 and 300).
31
+ Records will continue to buffer (or accumulate in the case of an SQS queue event source) until either maximumBatchingWindowInSeconds expires or batchSize has been met.
32
+
33
+ maximumRecordAgeInSeconds: The maximum age of a record that Lambda sends to a function for processing.
34
+ Only available for stream sources (DynamoDB and Kinesis). Must be either -1 (forever, and the default value) or between 60 and 604800 (inclusive).
35
+
36
+ maximumRetryAttempts: The maximum number of times to retry when the function returns an error.
37
+ Only available for stream sources (DynamoDB and Kinesis). Minimum and default of -1 (forever), maximum of 10000.
38
+
39
+ parallelizationFactor: The number of batches to process from each shard concurrently.
40
+ Only available for stream sources (DynamoDB and Kinesis). Minimum and default of 1, maximum of 10.
41
+
42
+ startingPosition: The position in the stream where AWS Lambda should start reading.
43
+ Must be one of AT_TIMESTAMP (Kinesis only), LATEST or TRIM_HORIZON if getting events from Kinesis, DynamoDB or MSK. Must not be provided if getting events from SQS.
44
+
45
+ startingPositionTimestamp: A timestamp in RFC3339 format of the data record which to start reading when using starting_position set to AT_TIMESTAMP.
46
+ If a record with this exact timestamp does not exist, the next later record is chosen.
47
+ If the timestamp is older than the current trim horizon, the oldest available record is chosen.
48
+
49
+ tumblingWindowInSeconds: The duration in seconds of a processing window for AWS Lambda streaming analytics.
50
+ The range is between 1 second up to 900 seconds. Only available for stream sources (DynamoDB and Kinesis).
51
+ */
52
+ type args = {
53
+ functionName: Pulumi.Input.t<string>,
54
+ batchSize?: int,
55
+ bisectBatchOnFunctionError?: bool,
56
+ destinationConfig?: destinationConfig,
57
+ enabled?: bool,
58
+ eventSourceArn?: Pulumi.Input.t<string>,
59
+ functionResponseTypes?: array<functionResponseType>,
60
+ maximumBatchingWindowInSeconds?: int,
61
+ maximumRecordAgeInSeconds?: int,
62
+ maximumRetryAttempts?: int,
63
+ parallelizationFactor?: int,
64
+ startingPosition?: startingPosition,
65
+ startingPositionTimestamp?: Pulumi.Input.t<string>,
66
+ tumblingWindowInSeconds?: int,
67
+ }
68
+
69
+ type t = {
70
+ id: Pulumi.Output.t<string>,
71
+ arn: Pulumi.Output.t<string>,
72
+ batchSize: Pulumi.Output.t<int>,
73
+ enabled: Pulumi.Output.t<bool>,
74
+ }
75
+
76
+ @module("@pulumi/aws") @scope("lambda") @new
77
+ external make: (~name: string, ~args: args, ~opts: option<Pulumi.CustomResourceOptions.t>) => t =
78
+ "EventSourceMapping"
@@ -0,0 +1,2 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
@@ -0,0 +1,41 @@
1
+ /** @pulumi/aws/lambda/functionurl
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/lambda/functionurl/
3
+ */
4
+ type authorizationType =
5
+ | @as("AWS_IAM") AwsIam
6
+ | @as("NONE") None
7
+
8
+ type invokeMode =
9
+ | @as("BUFFERED") Buffered
10
+ | @as("RESPONSE_STREAM") ResponseStream
11
+
12
+ type cors = {
13
+ allowCredentials?: Pulumi.Input.t<bool>,
14
+ allowHeaders?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
15
+ allowMethods?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
16
+ allowOrigins?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
17
+ exposeHeaders?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
18
+ maxAge?: Pulumi.Input.t<int>,
19
+ }
20
+
21
+ type args = {
22
+ authorizationType: authorizationType,
23
+ functionName: Pulumi.Input.t<string>,
24
+ cors?: Pulumi.Input.t<cors>,
25
+ invokeMode?: invokeMode,
26
+ qualifier?: Pulumi.Input.t<string>,
27
+ }
28
+
29
+ type t = {
30
+ functionArn: Pulumi.Output.t<string>,
31
+ functionUrl: Pulumi.Output.t<string>,
32
+ urlId: Pulumi.Output.t<string>,
33
+ }
34
+
35
+ @module("@pulumi/aws") @scope("lambda") @new
36
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
37
+ "FunctionUrl"
38
+
39
+ @module("@pulumi/aws") @scope(("lambda", "FunctionUrl"))
40
+ external get: (~name: string, ~id: Pulumi.Input.t<string>, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
41
+ "get"
@@ -0,0 +1,2 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
@@ -0,0 +1,270 @@
1
+ /** @pulumi/aws/lambda
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/lambda
3
+ */
4
+ type cognitoIdentity = {cognitoIdentityId: string, cognitoIdentityPoolId: string}
5
+
6
+ type clientContextClient = {
7
+ installationId: string,
8
+ appTitle: string,
9
+ appVersionName: string,
10
+ appVersionCode: string,
11
+ appPackageName: string,
12
+ }
13
+
14
+ type clientContextEnv = {
15
+ platformVersion: string,
16
+ platform: string,
17
+ make: string,
18
+ model: string,
19
+ locale: string,
20
+ }
21
+
22
+ type clientContext = {
23
+ client: clientContextClient,
24
+ @as("Custom") custom: option<JSON.t>,
25
+ env: clientContextEnv,
26
+ }
27
+
28
+ type context = {
29
+ callbackWaitsForEmptyEventLoop: bool,
30
+ functionName: string,
31
+ functionVersion: string,
32
+ invokedFunctionArn: string,
33
+ memoryLimitInMB: int,
34
+ awsRequestId: string,
35
+ logGroupName: string,
36
+ logStreamName: string,
37
+ identity?: cognitoIdentity,
38
+ clientContext?: clientContext,
39
+ }
40
+
41
+ type userIdentity = {principalId: string}
42
+
43
+ type eventHandler<'event, 'result> = ('event, context) => promise<'result>
44
+ type eventHandlerNoResult<'event> = eventHandler<'event, unit>
45
+
46
+ @send
47
+ external getRemainingTimeInMillis: context => int = "getRemainingTimeInMillis"
48
+
49
+ @val @scope(("process", "env")) external _layerArnEnv: option<string> = "REVENTLESS_LAYER_ARN"
50
+ @val @scope(("process", "env")) external _pulumiNodejsStack: option<string> = "PULUMI_NODEJS_STACK"
51
+ @module("child_process") external _execSync: (string, {..}) => string = "execSync"
52
+
53
+ // SSM fallback for local `pulumi up`. CI exports `REVENTLESS_LAYER_ARN`
54
+ // directly (deploy-reventless-aws.yml reads `/reventless/layer-arn/{stack}`
55
+ // via the AWS CLI and injects it as an env var); local devs typically don't.
56
+ // When the env var is unset, shell out to the same SSM parameter from the
57
+ // dev's `aws` CLI so local deploys attach the freshest layer automatically.
58
+ //
59
+ // Failures are swallowed (no `aws` on PATH, missing IAM `ssm:GetParameter`,
60
+ // parameter absent, etc.) — Lambdas then deploy without the layer, which is
61
+ // the same outcome as before this fallback existed.
62
+ let _resolveLayerArnFromSsm = (): option<string> =>
63
+ switch _pulumiNodejsStack {
64
+ | None | Some("") => None
65
+ | Some(stack) =>
66
+ try {
67
+ let cmd = `aws ssm get-parameter --name /reventless/layer-arn/${stack} --query Parameter.Value --output text 2>/dev/null`
68
+ let raw = _execSync(cmd, {"encoding": "utf8"})
69
+ let trimmed = raw->String.trim
70
+ if trimmed === "" || trimmed === "None" {
71
+ None
72
+ } else {
73
+ Some(trimmed)
74
+ }
75
+ } catch {
76
+ | _ => None
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Reventless Lambda layer ARN for the current Pulumi stack.
82
+ *
83
+ * Resolution order:
84
+ * 1. `REVENTLESS_LAYER_ARN` env var — fast path, used by CI
85
+ * (deploy-reventless-aws.yml reads SSM and exports it).
86
+ * 2. AWS CLI SSM lookup at `/reventless/layer-arn/${PULUMI_NODEJS_STACK}` —
87
+ * local-deploy convenience so devs don't need to export the env var
88
+ * manually.
89
+ * 3. `None` when both fail — Lambdas deploy without the layer.
90
+ */
91
+ let reventlessLayerArn: option<string> =
92
+ switch _layerArnEnv {
93
+ | Some(arn) if arn->String.trim->String.length > 0 => Some(arn->String.trim)
94
+ | _ => _resolveLayerArnFromSsm()
95
+ }
96
+
97
+ @val
98
+ external environment: option<string> = "process.env.Environment"
99
+
100
+ module CallbackFunction = {
101
+ module Args = {
102
+ type deadLetterConfig = {targetArn: string}
103
+
104
+ type mode = Active | PassThrough
105
+ type tracingConfig = {mode: mode}
106
+
107
+ type vpcConfig = {
108
+ securityGroupIds: array<string>,
109
+ subnetIds: array<string>,
110
+ vpcId?: string,
111
+ }
112
+
113
+ type functionEnvironment = {variables?: dict<string>}
114
+
115
+ /**
116
+ Default node runtime: 22
117
+ */
118
+ type runtime =
119
+ | @as("nodejs20.x") NodeJs20
120
+ | @as("nodejs22.x") NodeJs22
121
+
122
+ type t<'event, 'result> = {
123
+ callback: eventHandler<'event, 'result>,
124
+ runtime?: runtime,
125
+ role?: IAM.Role.t,
126
+ policies?: string,
127
+ deadLetterConfig?: Pulumi.Input.t<deadLetterConfig>,
128
+ tracingConfig?: Pulumi.Input.t<tracingConfig>,
129
+ memorySize?: Pulumi.Input.t<int>,
130
+ timeout?: Pulumi.Input.t<int>,
131
+ layers?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
132
+ vpcConfig?: Pulumi.Input.t<vpcConfig>,
133
+ tags?: Pulumi.Input.t<Aws.tags>,
134
+ environment?: functionEnvironment,
135
+ }
136
+
137
+ /**
138
+ defaults: memorySize=1024, timeout=180, runtime=NodeJs22
139
+
140
+ The 1024MB memory default is optimal for Node.js Lambdas with AWS SDK v3,
141
+ balancing cost and performance. Lower values cause slow cold starts when
142
+ loading multiple AWS SDK clients; higher values increase cost without
143
+ significant benefit for most workloads.
144
+ */
145
+ let make = (
146
+ ~callback,
147
+ ~role=?,
148
+ ~policies=?,
149
+ ~deadLetterConfig=?,
150
+ ~tracingConfig=?,
151
+ ~memorySize=1024->Pulumi.Input.make,
152
+ ~timeout=180->Pulumi.Input.make,
153
+ ~runtime=NodeJs22,
154
+ ~layers=reventlessLayerArn
155
+ ->Option.map(arn => [arn->Pulumi.Input.make])
156
+ ->Option.getOr([])
157
+ ->Pulumi.Input.make,
158
+ ~vpcConfig=?,
159
+ ~tags=?,
160
+ ~environment={
161
+ variables: [("Environment", Pulumi.Pulumi.getStackName())]->Dict.fromArray,
162
+ },
163
+ ) => {
164
+ callback,
165
+ runtime,
166
+ ?policies,
167
+ ?deadLetterConfig,
168
+ ?tracingConfig,
169
+ ?role,
170
+ memorySize,
171
+ timeout,
172
+ layers,
173
+ ?vpcConfig,
174
+ ?tags,
175
+ environment,
176
+ }
177
+ }
178
+
179
+ type record = {eventSource: string, eventSourceARN: string}
180
+ type event = {@as("Records") records: array<record>}
181
+ type eventHandler = eventHandler<event, unit>
182
+
183
+ type t = {
184
+ arn: Pulumi.Output.t<string>,
185
+ id: Pulumi.Output.t<string>,
186
+ name: Pulumi.Output.t<string>,
187
+ }
188
+
189
+ @module("@pulumi/aws") @scope("lambda") @new
190
+ external make: (
191
+ ~name: string,
192
+ ~args: Args.t<'event, 'result>,
193
+ ~opts: Pulumi.CustomResourceOptions.t=?,
194
+ ) => t = "CallbackFunction"
195
+
196
+ @module("@pulumi/aws") @scope(("lambda", "Function"))
197
+ external get: (
198
+ ~name: string,
199
+ ~id: Pulumi.Input.t<string>,
200
+ ~opts: Pulumi.CustomResourceOptions.t=?,
201
+ ) => t = "get"
202
+ }
203
+
204
+ module Function = {
205
+ type functionEnvironment = {variables?: dict<Pulumi.Input.t<string>>}
206
+
207
+ type ephemeralStorage = {size: Pulumi.Input.t<int>}
208
+
209
+ type args = {
210
+ handler?: Pulumi.Input.t<string>,
211
+ runtime?: Pulumi.Input.t<string>,
212
+ code?: Pulumi.Input.t<Pulumi.Archive.t>,
213
+ role: Pulumi.Input.t<string>,
214
+ memorySize?: Pulumi.Input.t<int>,
215
+ timeout?: Pulumi.Input.t<int>,
216
+ layers?: Pulumi.Input.t<array<Pulumi.Input.t<string>>>,
217
+ tags?: Pulumi.Input.t<Aws.tags>,
218
+ environment?: Pulumi.Input.t<functionEnvironment>,
219
+ sourceCodeHash?: Pulumi.Input.t<string>,
220
+ reservedConcurrentExecutions?: Pulumi.Input.t<int>,
221
+ ephemeralStorage?: Pulumi.Input.t<ephemeralStorage>,
222
+ }
223
+
224
+ type t = {
225
+ arn: Pulumi.Output.t<string>,
226
+ id: Pulumi.Output.t<string>,
227
+ name: Pulumi.Output.t<string>,
228
+ invokeArn: Pulumi.Output.t<string>,
229
+ }
230
+
231
+ @module("@pulumi/aws") @scope("lambda") @new
232
+ external make: (
233
+ ~name: string,
234
+ ~args: args,
235
+ ~opts: Pulumi.CustomResourceOptions.t=?,
236
+ ) => t = "Function"
237
+
238
+ @module("@pulumi/aws") @scope(("lambda", "Function"))
239
+ external get: (
240
+ ~name: string,
241
+ ~id: Pulumi.Input.t<string>,
242
+ ~opts: Pulumi.CustomResourceOptions.t=?,
243
+ ) => t = "get"
244
+ }
245
+
246
+ module Permission = {
247
+ type args = {
248
+ action: string,
249
+ function: Pulumi.Input.t<string>,
250
+ principal: string,
251
+ statementId?: string,
252
+ sourceArn?: Pulumi.Input.t<string>,
253
+ }
254
+
255
+ type t = {"arn": Pulumi.Output.t<string>, "id": Pulumi.Output.t<string>}
256
+ @module("@pulumi/aws") @scope("lambda") @new
257
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
258
+ "Permission"
259
+ }
260
+
261
+ let defaultLoggingPolicyDocument = PolicyDocument.make(
262
+ ~statements=[
263
+ {
264
+ sid: "DefaultLambdaLoggingPolicy",
265
+ effect: Allow,
266
+ actions: Actions(["logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents"]),
267
+ resources: Resource("arn:aws:logs:*:*:*"),
268
+ },
269
+ ],
270
+ )
@@ -0,0 +1,94 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
4
+ import * as Child_process from "child_process";
5
+ import * as Pulumi from "@pulumi/pulumi";
6
+ import * as PolicyDocument$PulumiAws from "../IAM/PolicyDocument.res.mjs";
7
+
8
+ function _resolveLayerArnFromSsm() {
9
+ let stack = process.env.PULUMI_NODEJS_STACK;
10
+ if (stack === undefined) {
11
+ return;
12
+ }
13
+ if (stack === "") {
14
+ return;
15
+ }
16
+ try {
17
+ let cmd = `aws ssm get-parameter --name /reventless/layer-arn/` + stack + ` --query Parameter.Value --output text 2>/dev/null`;
18
+ let raw = Child_process.execSync(cmd, {
19
+ encoding: "utf8"
20
+ });
21
+ let trimmed = raw.trim();
22
+ if (trimmed === "" || trimmed === "None") {
23
+ return;
24
+ } else {
25
+ return trimmed;
26
+ }
27
+ } catch (exn) {
28
+ return;
29
+ }
30
+ }
31
+
32
+ let arn = process.env.REVENTLESS_LAYER_ARN;
33
+
34
+ let reventlessLayerArn = arn !== undefined && arn.trim().length > 0 ? arn.trim() : _resolveLayerArnFromSsm();
35
+
36
+ function make(callback, role, policies, deadLetterConfig, tracingConfig, memorySizeOpt, timeoutOpt, runtimeOpt, layersOpt, vpcConfig, tags, environmentOpt) {
37
+ let memorySize = memorySizeOpt !== undefined ? memorySizeOpt : 1024;
38
+ let timeout = timeoutOpt !== undefined ? timeoutOpt : 180;
39
+ let runtime = runtimeOpt !== undefined ? runtimeOpt : "nodejs22.x";
40
+ let layers = layersOpt !== undefined ? layersOpt : Stdlib_Option.getOr(Stdlib_Option.map(reventlessLayerArn, arn => [arn]), []);
41
+ let environment = environmentOpt !== undefined ? environmentOpt : ({
42
+ variables: Object.fromEntries([[
43
+ "Environment",
44
+ Pulumi.getStack()
45
+ ]])
46
+ });
47
+ return {
48
+ callback: callback,
49
+ runtime: runtime,
50
+ role: role,
51
+ policies: policies,
52
+ deadLetterConfig: deadLetterConfig,
53
+ tracingConfig: tracingConfig,
54
+ memorySize: memorySize,
55
+ timeout: timeout,
56
+ layers: layers,
57
+ vpcConfig: vpcConfig,
58
+ tags: tags,
59
+ environment: environment
60
+ };
61
+ }
62
+
63
+ let Args = {
64
+ make: make
65
+ };
66
+
67
+ let CallbackFunction = {
68
+ Args: Args
69
+ };
70
+
71
+ let $$Function = {};
72
+
73
+ let Permission = {};
74
+
75
+ let defaultLoggingPolicyDocument = PolicyDocument$PulumiAws.make(undefined, undefined, [{
76
+ Sid: "DefaultLambdaLoggingPolicy",
77
+ Effect: "Allow",
78
+ Action: [
79
+ "logs:CreateLogGroup",
80
+ "logs:CreateLogStream",
81
+ "logs:PutLogEvents"
82
+ ],
83
+ Resource: "arn:aws:logs:*:*:*"
84
+ }]);
85
+
86
+ export {
87
+ _resolveLayerArnFromSsm,
88
+ reventlessLayerArn,
89
+ CallbackFunction,
90
+ $$Function,
91
+ Permission,
92
+ defaultLoggingPolicyDocument,
93
+ }
94
+ /* arn Not a pure module */
@@ -0,0 +1,4 @@
1
+ /** @pulumi/aws/route53
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/route53/
3
+ */
4
+ module Record = Route53_Record
@@ -0,0 +1,9 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let Record;
5
+
6
+ export {
7
+ Record,
8
+ }
9
+ /* No side effect */
@@ -0,0 +1,36 @@
1
+ /** @pulumi/aws/route53/Record
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/route53/record
3
+
4
+ Two shapes are supported on the Route53 wire:
5
+ - **Plain DNS record**: set `records` (and `ttl`); leave `aliases` unset.
6
+ Used for cert validation (CNAME) and any vanilla A/AAAA/TXT record.
7
+ - **Alias record**: set `aliases`; leave `records` and `ttl` unset.
8
+ Used to point a name at a CloudFront distribution / ALB / etc.
9
+ The two are mutually exclusive in the AWS API; expressed here as two
10
+ optional fields on a single ReScript type to match the wire shape.
11
+ */
12
+ type alias = {
13
+ name: Pulumi.Input.t<string>,
14
+ zoneId: Pulumi.Input.t<string>,
15
+ evaluateTargetHealth: Pulumi.Input.t<bool>,
16
+ }
17
+
18
+ type args = {
19
+ zoneId: Pulumi.Input.t<string>,
20
+ name: Pulumi.Input.t<string>,
21
+ @as("type") type_: Pulumi.Input.t<string>,
22
+ ttl?: Pulumi.Input.t<int>,
23
+ records?: Pulumi.Input.t<array<string>>,
24
+ aliases?: Pulumi.Input.t<array<alias>>,
25
+ allowOverwrite?: Pulumi.Input.t<bool>,
26
+ }
27
+
28
+ type t = {
29
+ id: Pulumi.Output.t<string>,
30
+ name: Pulumi.Output.t<string>,
31
+ fqdn: Pulumi.Output.t<string>,
32
+ zoneId: Pulumi.Output.t<string>,
33
+ }
34
+
35
+ @module("@pulumi/aws") @scope("route53") @new
36
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t = "Record"
@@ -0,0 +1,2 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
package/src/S3/S3.res ADDED
@@ -0,0 +1,10 @@
1
+ /** @pulumi/aws/s3
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/s3/
3
+ */
4
+ module Bucket = S3_Bucket
5
+ module BucketV2 = S3_BucketV2
6
+ module BucketAclV2 = S3_BucketAclV2
7
+ module BucketObject = S3_BucketObject
8
+ module BucketOwnershipControls = S3_BucketOwnershipControls
9
+ module BucketPublicAccessBlock = S3_BucketPublicAccessBlock
10
+ module BucketPolicy = S3_BucketPolicy
@@ -0,0 +1,27 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let Bucket;
5
+
6
+ let BucketV2;
7
+
8
+ let BucketAclV2;
9
+
10
+ let BucketObject;
11
+
12
+ let BucketOwnershipControls;
13
+
14
+ let BucketPublicAccessBlock;
15
+
16
+ let BucketPolicy;
17
+
18
+ export {
19
+ Bucket,
20
+ BucketV2,
21
+ BucketAclV2,
22
+ BucketObject,
23
+ BucketOwnershipControls,
24
+ BucketPublicAccessBlock,
25
+ BucketPolicy,
26
+ }
27
+ /* No side effect */