@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,19 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
4
+
5
+ function make(deadLetterTargetArn, maxReceiveCount) {
6
+ return Stdlib_Option.getOr(JSON.stringify({
7
+ deadLetterTargetArn: deadLetterTargetArn,
8
+ maxReceiveCount: maxReceiveCount
9
+ }), "{}");
10
+ }
11
+
12
+ let RedrivePolicy = {
13
+ make: make
14
+ };
15
+
16
+ export {
17
+ RedrivePolicy,
18
+ }
19
+ /* No side effect */
@@ -0,0 +1,13 @@
1
+ /**ocaml.doc(" @pulumi/aws/sqsqueuepolicy
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/sqs/queuepolicy
3
+ */
4
+ type args = {
5
+ policy: Pulumi.Input.t<string>,
6
+ queueUrl: Pulumi.Input.t<string>,
7
+ }
8
+
9
+ type t = {id: Pulumi.Output.t<string>}
10
+
11
+ @module("@pulumi/aws") @scope("sqs") @new
12
+ external make: (~name: string, ~args: args, ~opts: option<Pulumi.CustomResourceOptions.t>) => t =
13
+ "QueuePolicy"
@@ -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,37 @@
1
+ /** @pulumi/aws/secretsmanager/getsecretversion
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/secretsmanager/getsecretversion
3
+ */
4
+ type args = {
5
+ secretId: string,
6
+ versionId?: string,
7
+ versionStage?: string,
8
+ }
9
+
10
+ type t = {
11
+ arn: string,
12
+ id: string,
13
+ secretId: string,
14
+ secretBinary: string,
15
+ secretString: string,
16
+ versionId: string,
17
+ versionStage: option<string>,
18
+ versionStages: array<string>,
19
+ }
20
+
21
+ @module("@pulumi/aws") @scope("secretsmanager") @val
22
+ external getSecretVersionOutput: (
23
+ ~args: args=?,
24
+ ~opts: Pulumi.CustomResourceOptions.t=?,
25
+ ) => Pulumi.Output.t<t> = "getSecretVersionOutput"
26
+
27
+ let decodeSecret = secret =>
28
+ secret.secretString
29
+ ->JSON.parseOrThrow
30
+ ->JSON.Decode.object
31
+ ->Option.getOr(Dict.make())
32
+ ->Dict.mapValues(_, json => json->JSON.Decode.string->Option.getOr(""))
33
+
34
+ let getSecretNames = arn =>
35
+ getSecretVersionOutput(~args={secretId: arn})->Pulumi.Output.apply(secret =>
36
+ secret->decodeSecret->Dict.keysToArray
37
+ )
@@ -0,0 +1,23 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Aws from "@pulumi/aws";
4
+ import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
5
+ import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
6
+ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
+
8
+ function decodeSecret(secret) {
9
+ let __x = Stdlib_Option.getOr(Stdlib_JSON.Decode.object(JSON.parse(secret.secretString)), {});
10
+ return Stdlib_Dict.mapValues(__x, json => Stdlib_Option.getOr(Stdlib_JSON.Decode.string(json), ""));
11
+ }
12
+
13
+ function getSecretNames(arn) {
14
+ return Aws.secretsmanager.getSecretVersionOutput({
15
+ secretId: arn
16
+ }).apply(secret => Object.keys(decodeSecret(secret)));
17
+ }
18
+
19
+ export {
20
+ decodeSecret,
21
+ getSecretNames,
22
+ }
23
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,71 @@
1
+ // Compile-only smoke for the ACM / Route53 / Provider bindings used by
2
+ // custom-domain provisioning. Not executed at deploy time — its sole job is
3
+ // to keep the four new bindings type-checked together (alt-region provider →
4
+ // cert → DNS validation record → cert validation → Route53 alias on a
5
+ // fictitious distribution domain). See docs/plans/done/host-ui-custom-domain.md.
6
+
7
+ let usEast1 = Aws.Provider.make(
8
+ ~name="example-us-east-1",
9
+ ~args={region: Pulumi.Input.make("us-east-1")},
10
+ )
11
+
12
+ let cert = Acm.Certificate.make(
13
+ ~name="example-cert",
14
+ ~args={
15
+ domainName: Pulumi.Input.make("example.app.reventless.dev"),
16
+ validationMethod: Pulumi.Input.make("DNS"),
17
+ },
18
+ ~opts={provider: usEast1},
19
+ )
20
+
21
+ let firstValidationOption = cert.domainValidationOptions->Pulumi.Output.apply(opts =>
22
+ opts->Array.getUnsafe(0)
23
+ )
24
+
25
+ let validationRecord = Route53.Record.make(
26
+ ~name="example-cert-validation",
27
+ ~args={
28
+ zoneId: Pulumi.Input.make("Z00000000000000000000"),
29
+ name: firstValidationOption
30
+ ->Pulumi.Output.apply(o => o.resourceRecordName)
31
+ ->Pulumi.Output.asInput,
32
+ type_: firstValidationOption
33
+ ->Pulumi.Output.apply(o => o.resourceRecordType)
34
+ ->Pulumi.Output.asInput,
35
+ ttl: Pulumi.Input.make(60),
36
+ records: firstValidationOption
37
+ ->Pulumi.Output.apply(o => [o.resourceRecordValue])
38
+ ->Pulumi.Output.asInput,
39
+ },
40
+ )
41
+
42
+ let validated = Acm.CertificateValidation.make(
43
+ ~name="example-cert-validated",
44
+ ~args={
45
+ certificateArn: cert.arn->Pulumi.Output.asInput,
46
+ validationRecordFqdns: [validationRecord.fqdn]
47
+ ->Pulumi.Output.all
48
+ ->Pulumi.Output.asInput,
49
+ },
50
+ ~opts={provider: usEast1},
51
+ )
52
+
53
+ let _aliasRecord = Route53.Record.make(
54
+ ~name="example-alias",
55
+ ~args={
56
+ zoneId: Pulumi.Input.make("Z00000000000000000000"),
57
+ name: Pulumi.Input.make("example.app.reventless.dev"),
58
+ type_: Pulumi.Input.make("A"),
59
+ aliases: [
60
+ (
61
+ {
62
+ name: Pulumi.Input.make("d123abc.cloudfront.net"),
63
+ zoneId: Pulumi.Input.make("Z2FDTNDATAQYW2"),
64
+ evaluateTargetHealth: Pulumi.Input.make(false),
65
+ }: Route53.Record.alias
66
+ ),
67
+ ]->Pulumi.Input.make,
68
+ },
69
+ )
70
+
71
+ let _certArn = validated.certificateArn
@@ -0,0 +1,57 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Aws from "@pulumi/aws";
4
+ import * as Pulumi from "@pulumi/pulumi";
5
+ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
6
+
7
+ let usEast1 = new Aws.Provider("example-us-east-1", {
8
+ region: "us-east-1"
9
+ });
10
+
11
+ let cert = new (Aws.acm.Certificate)("example-cert", {
12
+ domainName: "example.app.reventless.dev",
13
+ validationMethod: "DNS"
14
+ }, {
15
+ provider: Primitive_option.some(usEast1)
16
+ });
17
+
18
+ let firstValidationOption = cert.domainValidationOptions.apply(opts => opts[0]);
19
+
20
+ let validationRecord = new (Aws.route53.Record)("example-cert-validation", {
21
+ zoneId: "Z00000000000000000000",
22
+ name: firstValidationOption.apply(o => o.resourceRecordName),
23
+ type: firstValidationOption.apply(o => o.resourceRecordType),
24
+ ttl: 60,
25
+ records: firstValidationOption.apply(o => [o.resourceRecordValue])
26
+ });
27
+
28
+ let validated = new (Aws.acm.CertificateValidation)("example-cert-validated", {
29
+ certificateArn: cert.arn,
30
+ validationRecordFqdns: Pulumi.all([validationRecord.fqdn])
31
+ }, {
32
+ provider: Primitive_option.some(usEast1)
33
+ });
34
+
35
+ let _aliasRecord = new (Aws.route53.Record)("example-alias", {
36
+ zoneId: "Z00000000000000000000",
37
+ name: "example.app.reventless.dev",
38
+ type: "A",
39
+ aliases: [{
40
+ name: "d123abc.cloudfront.net",
41
+ zoneId: "Z2FDTNDATAQYW2",
42
+ evaluateTargetHealth: false
43
+ }]
44
+ });
45
+
46
+ let _certArn = validated.certificateArn;
47
+
48
+ export {
49
+ usEast1,
50
+ cert,
51
+ firstValidationOption,
52
+ validationRecord,
53
+ validated,
54
+ _aliasRecord,
55
+ _certArn,
56
+ }
57
+ /* usEast1 Not a pure module */