@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,77 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Bundle AppSync JS resolver source files for the APPSYNC_JS runtime.
4
+ *
5
+ * Pipeline:
6
+ * 1. ReScript compiles resolver-source/*.res to resolver-source/*.res.mjs
7
+ * 2. This script bundles each .res.mjs with esbuild into a single self-contained file
8
+ * 3. Writes bundled code strings into resolver-bundles/index.mjs as named exports
9
+ * 4. AppSync_Resolver_Code.res binds to those exports as Pulumi.Input.t<string> values
10
+ *
11
+ * esbuild flags:
12
+ * --external:@aws-appsync/utils keep this import — AppSync provides it at runtime
13
+ * --format=esm AppSync APPSYNC_JS runtime requires ES modules
14
+ * --platform=neutral no Node.js built-ins
15
+ */
16
+
17
+ import { build } from 'esbuild'
18
+ import { readdir, writeFile, mkdir } from 'fs/promises'
19
+ import { join, basename, dirname } from 'path'
20
+ import { fileURLToPath } from 'url'
21
+ import { existsSync } from 'fs'
22
+
23
+ const __dirname = dirname(fileURLToPath(import.meta.url))
24
+ const ROOT = join(__dirname, '..')
25
+ const SOURCE_DIR = join(ROOT, 'src', 'AppSync', 'resolver-source')
26
+ const BUNDLE_DIR = join(ROOT, 'src', 'AppSync', 'resolver-bundles')
27
+ const INDEX_FILE = join(BUNDLE_DIR, 'index.mjs')
28
+
29
+ await mkdir(BUNDLE_DIR, { recursive: true })
30
+
31
+ if (!existsSync(SOURCE_DIR)) {
32
+ console.log('No resolver-source directory found — nothing to bundle.')
33
+ process.exit(0)
34
+ }
35
+
36
+ const files = await readdir(SOURCE_DIR)
37
+ const sourceMjs = files.filter(f => f.endsWith('.res.mjs'))
38
+
39
+ if (sourceMjs.length === 0) {
40
+ console.log('No resolver .res.mjs files found — writing empty index.')
41
+ await writeFile(INDEX_FILE, '// No resolver bundles generated yet.\n')
42
+ process.exit(0)
43
+ }
44
+
45
+ const exports = []
46
+
47
+ for (const file of sourceMjs) {
48
+ const name = basename(file, '.res.mjs')
49
+ const entryPoint = join(SOURCE_DIR, file)
50
+
51
+ const result = await build({
52
+ entryPoints: [entryPoint],
53
+ bundle: true,
54
+ write: false,
55
+ format: 'esm',
56
+ platform: 'neutral',
57
+ external: ['@aws-appsync/utils'],
58
+ minify: false,
59
+ })
60
+
61
+ const bundledCode = result.outputFiles[0].text
62
+ // Escape backticks so we can embed as a template literal
63
+ const escaped = bundledCode.replace(/`/g, '\\`').replace(/\${/g, '\\${')
64
+ exports.push(`export const ${name} = \`${escaped}\``)
65
+ console.log(` bundled: ${name}`)
66
+ }
67
+
68
+ const indexContent = [
69
+ '// Generated by scripts/bundle-resolvers.mjs — do not edit by hand.',
70
+ '// Re-run `npm run bundle` after changing resolver source files.',
71
+ '',
72
+ ...exports,
73
+ '',
74
+ ].join('\n')
75
+
76
+ await writeFile(INDEX_FILE, indexContent)
77
+ console.log(`Wrote ${exports.length} resolver bundle(s) to resolver-bundles/index.mjs`)
@@ -0,0 +1,9 @@
1
+ type t = string
2
+ module EUWest1 = {
3
+ @inline
4
+ let euWest1a = "eu-west-1a"
5
+ @inline
6
+ let euWest1b = "eu-west-1b"
7
+ @inline
8
+ let euWest1c = "eu-west-1c"
9
+ }
@@ -0,0 +1,9 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let EUWest1 = {};
5
+
6
+ export {
7
+ EUWest1,
8
+ }
9
+ /* No side effect */
@@ -0,0 +1,9 @@
1
+ type t = private string
2
+ module EUWest1: {
3
+ @inline("eu-west-1a")
4
+ let euWest1a: t
5
+ @inline("eu-west-1b")
6
+ let euWest1b: t
7
+ @inline("eu-west-1c")
8
+ let euWest1c: t
9
+ }
@@ -0,0 +1,29 @@
1
+ type getRegionArgs = {endpoint?: string, name?: string}
2
+
3
+ type getRegionResult = {description: string, endpoint: string, id: string, name: string}
4
+
5
+ @module("@pulumi/aws")
6
+ external getRegion: (
7
+ ~args: getRegionArgs=?,
8
+ ~opts: Pulumi.InvokeOptions.t=?,
9
+ ) => promise<getRegionResult> = "getRegion"
10
+
11
+ @module("@pulumi/aws")
12
+ external getRegionSync: (
13
+ ~args: getRegionArgs=?,
14
+ ~opts: Pulumi.InvokeOptions.t=?,
15
+ ) => getRegionResult = "getRegion"
16
+
17
+ let getRegionSync: (~args: getRegionArgs=?, ~opts: Pulumi.InvokeOptions.t=?) => getRegionResult = (
18
+ ~args=?,
19
+ ~opts=?,
20
+ ) => {
21
+ let (parent, provider, version) = switch opts {
22
+ | Some(opts) => (opts.parent, opts.provider, opts.version)
23
+ | None => (None, None, None)
24
+ }
25
+
26
+ let opts = {?Pulumi.InvokeOptions.parent, ?provider, ?version, async: false}
27
+
28
+ getRegionSync(~args?, ~opts)
29
+ }
@@ -0,0 +1,32 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Aws from "@pulumi/aws";
4
+ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
5
+
6
+ function getRegionSync(args, opts) {
7
+ let match = opts !== undefined ? [
8
+ opts.parent,
9
+ opts.provider,
10
+ opts.version
11
+ ] : [
12
+ undefined,
13
+ undefined,
14
+ undefined
15
+ ];
16
+ let opts_parent = match[0];
17
+ let opts_provider = match[1];
18
+ let opts_version = match[2];
19
+ let opts_async = false;
20
+ let opts$1 = {
21
+ parent: opts_parent,
22
+ provider: opts_provider,
23
+ version: opts_version,
24
+ async: opts_async
25
+ };
26
+ return Aws.getRegion(args !== undefined ? Primitive_option.valFromOption(args) : undefined, opts$1);
27
+ }
28
+
29
+ export {
30
+ getRegionSync,
31
+ }
32
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,2 @@
1
+ type arn = string
2
+ type tags = dict<string>
@@ -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,10 @@
1
+ /** @pulumi/aws/Provider
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/provider
3
+ */
4
+ type args = {region: Pulumi.Input.t<string>}
5
+
6
+ type t = Pulumi.ProviderResource.t
7
+
8
+ @module("@pulumi/aws") @new
9
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
10
+ "Provider"
@@ -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,5 @@
1
+ /** @pulumi/aws/acm
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/acm/
3
+ */
4
+ module Certificate = Acm_Certificate
5
+ module CertificateValidation = Acm_CertificateValidation
@@ -0,0 +1,12 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let Certificate;
5
+
6
+ let CertificateValidation;
7
+
8
+ export {
9
+ Certificate,
10
+ CertificateValidation,
11
+ }
12
+ /* No side effect */
@@ -0,0 +1,27 @@
1
+ /** @pulumi/aws/acm/Certificate
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/acm/certificate
3
+ */
4
+ type domainValidationOption = {
5
+ domainName: string,
6
+ resourceRecordName: string,
7
+ resourceRecordType: string,
8
+ resourceRecordValue: string,
9
+ }
10
+
11
+ type args = {
12
+ domainName: Pulumi.Input.t<string>,
13
+ validationMethod: Pulumi.Input.t<string>,
14
+ subjectAlternativeNames?: Pulumi.Input.t<array<string>>,
15
+ tags?: Pulumi.Input.t<Aws.tags>,
16
+ }
17
+
18
+ type t = {
19
+ id: Pulumi.Output.t<string>,
20
+ arn: Pulumi.Output.t<string>,
21
+ domainName: Pulumi.Output.t<string>,
22
+ domainValidationOptions: Pulumi.Output.t<array<domainValidationOption>>,
23
+ }
24
+
25
+ @module("@pulumi/aws") @scope("acm") @new
26
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
27
+ "Certificate"
@@ -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,22 @@
1
+ /** @pulumi/aws/acm/CertificateValidation
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/acm/certificatevalidation
3
+
4
+ Synthetic resource that blocks until ACM marks the referenced certificate
5
+ ISSUED. Downstream resources that consume the validated cert ARN (e.g. a
6
+ CloudFront distribution with `viewerCertificate.acmCertificateArn`) should
7
+ reference `t.certificateArn` from this resource — not the cert's own ARN —
8
+ so Pulumi waits for issuance before wiring them up.
9
+ */
10
+ type args = {
11
+ certificateArn: Pulumi.Input.t<string>,
12
+ validationRecordFqdns?: Pulumi.Input.t<array<string>>,
13
+ }
14
+
15
+ type t = {
16
+ id: Pulumi.Output.t<string>,
17
+ certificateArn: Pulumi.Output.t<string>,
18
+ }
19
+
20
+ @module("@pulumi/aws") @scope("acm") @new
21
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
22
+ "CertificateValidation"
@@ -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,7 @@
1
+ /** @pulumi/aws/appsync
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/appsync
3
+ */
4
+ module GraphQLApi = AppSync_GraphQLApi
5
+ module DataSource = AppSync_DataSource
6
+ module Function = AppSync_Function
7
+ module Resolver = AppSync_Resolver
@@ -0,0 +1,18 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let GraphQLApi;
5
+
6
+ let DataSource;
7
+
8
+ let $$Function;
9
+
10
+ let Resolver;
11
+
12
+ export {
13
+ GraphQLApi,
14
+ DataSource,
15
+ $$Function,
16
+ Resolver,
17
+ }
18
+ /* No side effect */
@@ -0,0 +1,93 @@
1
+ /** @pulumi/aws/appsync/DataSource
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/appsync/datasource
3
+ */
4
+ type t = {
5
+ id: Pulumi.Output.t<string>,
6
+ arn: Pulumi.Output.t<string>,
7
+ name: Pulumi.Output.t<string>,
8
+ }
9
+
10
+ type dynamoDBConfig = {
11
+ tableName: Pulumi.Input.t<string>,
12
+ region?: Pulumi.Input.t<string>,
13
+ useCallerCredentials?: Pulumi.Input.t<bool>,
14
+ opts?: Pulumi.CustomResourceOptions.t,
15
+ }
16
+
17
+ type elasticSearchConfig = {endpoint: Pulumi.Input.t<string>, region?: Pulumi.Input.t<string>}
18
+ type httpConfig = {endpoint: Pulumi.Input.t<string>}
19
+ type lambdaConfig = {functionArn: Pulumi.Input.t<string>}
20
+
21
+ type type_ =
22
+ | AWS_LAMBDA
23
+ | AMAZON_DYNAMODB
24
+ | AMAZON_ELASTICSEARCH
25
+ | HTTP
26
+ | NONE
27
+
28
+ type args = {
29
+ @as("type") type_: type_,
30
+ apiId: Pulumi.Input.t<string>,
31
+ name?: Pulumi.Input.t<string>,
32
+ description?: Pulumi.Input.t<string>,
33
+ dynamodbConfig?: dynamoDBConfig,
34
+ elasticsearchConfig?: Pulumi.Input.t<elasticSearchConfig>,
35
+ httpConfig?: Pulumi.Input.t<httpConfig>,
36
+ lambdaConfig?: Pulumi.Input.t<lambdaConfig>,
37
+ serviceRoleArn?: Pulumi.Input.t<string>,
38
+ }
39
+
40
+ @module("@pulumi/aws") @scope("appsync") @new
41
+ external make: (~name: string, ~args: args=?, ~opts: option<Pulumi.CustomResourceOptions.t>) => t =
42
+ "DataSource"
43
+
44
+ let makeDynamoDBDataSourceWithTableName: (
45
+ ~name: string,
46
+ ~api: Pulumi.Output.t<AppSync_GraphQLApi.t>,
47
+ ~tableName: Pulumi.Output.t<string>,
48
+ ~serviceRole: Pulumi.Output.t<IAM.Role.t>,
49
+ ~opts: Pulumi.CustomResourceOptions.t=?,
50
+ ) => t = (~name, ~api, ~tableName, ~serviceRole, ~opts=?) =>
51
+ make(
52
+ ~name,
53
+ ~args={
54
+ type_: AMAZON_DYNAMODB,
55
+ apiId: api->Pulumi.Output.flatMap(api => api.id)->Pulumi.Output.asInput,
56
+ dynamodbConfig: {
57
+ tableName: tableName->Pulumi.Output.asInput,
58
+ },
59
+ serviceRoleArn: serviceRole
60
+ ->Pulumi.Output.flatMap(role => role.arn)
61
+ ->Pulumi.Output.asInput,
62
+ },
63
+ ~opts=opts->Option.map(opts => {
64
+ ...opts,
65
+ deleteBeforeReplace: true,
66
+ }),
67
+ )
68
+
69
+ let makeNoneDataSource: (
70
+ ~name: string,
71
+ ~api: Pulumi.Output.t<AppSync_GraphQLApi.t>,
72
+ ~opts: Pulumi.CustomResourceOptions.t=?,
73
+ ) => t = (~name, ~api, ~opts=?) =>
74
+ make(
75
+ ~name,
76
+ ~args={
77
+ type_: NONE,
78
+ apiId: api->Pulumi.Output.flatMap(api => api.id)->Pulumi.Output.asInput,
79
+ },
80
+ ~opts=opts->Option.map(opts => {
81
+ ...opts,
82
+ deleteBeforeReplace: true,
83
+ }),
84
+ )
85
+
86
+ let makeDynamoDBDataSource: (
87
+ ~name: string,
88
+ ~api: Pulumi.Output.t<AppSync_GraphQLApi.t>,
89
+ ~table: DynamoDb.Table.t,
90
+ ~serviceRole: Pulumi.Output.t<IAM.Role.t>,
91
+ ~opts: Pulumi.CustomResourceOptions.t=?,
92
+ ) => t = (~name, ~api, ~table, ~serviceRole, ~opts=?) =>
93
+ makeDynamoDBDataSourceWithTableName(~api, ~tableName=table.name, ~name, ~serviceRole, ~opts?)
@@ -0,0 +1,42 @@
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 Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
+
7
+ function makeDynamoDBDataSourceWithTableName(name, api, tableName, serviceRole, opts) {
8
+ return new (Aws.appsync.DataSource)(name, {
9
+ type: "AMAZON_DYNAMODB",
10
+ apiId: Output$Pulumi.flatMap(api, api => api.id),
11
+ dynamodbConfig: {
12
+ tableName: tableName
13
+ },
14
+ serviceRoleArn: Output$Pulumi.flatMap(serviceRole, role => role.arn)
15
+ }, Stdlib_Option.map(opts, opts => {
16
+ let newrecord = {...opts};
17
+ newrecord.deleteBeforeReplace = true;
18
+ return newrecord;
19
+ }));
20
+ }
21
+
22
+ function makeNoneDataSource(name, api, opts) {
23
+ return new (Aws.appsync.DataSource)(name, {
24
+ type: "NONE",
25
+ apiId: Output$Pulumi.flatMap(api, api => api.id)
26
+ }, Stdlib_Option.map(opts, opts => {
27
+ let newrecord = {...opts};
28
+ newrecord.deleteBeforeReplace = true;
29
+ return newrecord;
30
+ }));
31
+ }
32
+
33
+ function makeDynamoDBDataSource(name, api, table, serviceRole, opts) {
34
+ return makeDynamoDBDataSourceWithTableName(name, api, table.name, serviceRole, opts);
35
+ }
36
+
37
+ export {
38
+ makeDynamoDBDataSourceWithTableName,
39
+ makeNoneDataSource,
40
+ makeDynamoDBDataSource,
41
+ }
42
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,75 @@
1
+ /** @pulumi/aws/appsync/Function
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/appsync/function
3
+ */
4
+ type t = {
5
+ id: Pulumi.Output.t<string>,
6
+ functionId: Pulumi.Output.t<string>,
7
+ arn: Pulumi.Output.t<string>,
8
+ name: Pulumi.Output.t<string>,
9
+ }
10
+
11
+ type runtime = {
12
+ name: string,
13
+ runtimeVersion: string,
14
+ }
15
+
16
+ /** APPSYNC_JS runtime v1.0.0 — use with `code` instead of VTL templates. */
17
+ let appsyncJs: runtime = {name: "APPSYNC_JS", runtimeVersion: "1.0.0"}
18
+
19
+ type args = {
20
+ apiId: Pulumi.Input.t<string>,
21
+ name?: Pulumi.Input.t<string>,
22
+ description?: Pulumi.Input.t<string>,
23
+ dataSource: Pulumi.Input.t<string>,
24
+ requestMappingTemplate?: Pulumi.Input.t<string>,
25
+ responseMappingTemplate?: Pulumi.Input.t<string>,
26
+ /** Bundled JS function code (APPSYNC_JS runtime). Replaces requestMappingTemplate/responseMappingTemplate. */
27
+ code?: Pulumi.Input.t<string>,
28
+ /** Runtime config — set to appsyncJs when using code. */
29
+ runtime?: Pulumi.Input.t<runtime>,
30
+ }
31
+
32
+ @module("@pulumi/aws") @scope("appsync") @new
33
+ external _make: (~name: string, ~args: args, ~opts: option<Pulumi.CustomResourceOptions.t>) => t =
34
+ "Function"
35
+
36
+ let make = (
37
+ ~name,
38
+ ~api: Pulumi.Output.t<AppSync_GraphQLApi.t>,
39
+ ~dataSource,
40
+ ~requestMappingTemplate,
41
+ ~responseMappingTemplate,
42
+ ~opts=?,
43
+ ) =>
44
+ _make(
45
+ ~name,
46
+ ~args={
47
+ name: name->Pulumi.Input.make, // This has to be provided for AppSync.Function
48
+ apiId: api->Pulumi.Output.flatMap(api => api.id)->Pulumi.Output.asInput,
49
+ dataSource,
50
+ requestMappingTemplate,
51
+ responseMappingTemplate,
52
+ },
53
+ ~opts,
54
+ )
55
+
56
+ /** Create a pipeline function using the APPSYNC_JS runtime.
57
+ Pass bundled JS code via `~code` instead of VTL mapping templates. */
58
+ let makeJs = (
59
+ ~name,
60
+ ~api: Pulumi.Output.t<AppSync_GraphQLApi.t>,
61
+ ~dataSource,
62
+ ~code: Pulumi.Input.t<string>,
63
+ ~opts=?,
64
+ ) =>
65
+ _make(
66
+ ~name,
67
+ ~args={
68
+ name: name->Pulumi.Input.make, // This has to be provided for AppSync.Function
69
+ apiId: api->Pulumi.Output.flatMap(api => api.id)->Pulumi.Output.asInput,
70
+ dataSource,
71
+ code,
72
+ runtime: appsyncJs->Pulumi.Input.make,
73
+ },
74
+ ~opts,
75
+ )
@@ -0,0 +1,36 @@
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
+
6
+ let appsyncJs = {
7
+ name: "APPSYNC_JS",
8
+ runtimeVersion: "1.0.0"
9
+ };
10
+
11
+ function make(name, api, dataSource, requestMappingTemplate, responseMappingTemplate, opts) {
12
+ return new (Aws.appsync.Function)(name, {
13
+ apiId: Output$Pulumi.flatMap(api, api => api.id),
14
+ name: name,
15
+ dataSource: dataSource,
16
+ requestMappingTemplate: requestMappingTemplate,
17
+ responseMappingTemplate: responseMappingTemplate
18
+ }, opts);
19
+ }
20
+
21
+ function makeJs(name, api, dataSource, code, opts) {
22
+ return new (Aws.appsync.Function)(name, {
23
+ apiId: Output$Pulumi.flatMap(api, api => api.id),
24
+ name: name,
25
+ dataSource: dataSource,
26
+ code: code,
27
+ runtime: appsyncJs
28
+ }, opts);
29
+ }
30
+
31
+ export {
32
+ appsyncJs,
33
+ make,
34
+ makeJs,
35
+ }
36
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,65 @@
1
+ /** @pulumi/aws/appsync/GraphQLApi
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/appsync/graphqlapi
3
+ */
4
+ type uris = {@as("GRAPHQL") graphQL: string, @as("REALTIME") realtime: string}
5
+
6
+ type t = {
7
+ id: Pulumi.Output.t<string>,
8
+ arn: Pulumi.Output.t<string>,
9
+ name: Pulumi.Output.t<string>,
10
+ uris: Pulumi.Output.t<uris>,
11
+ }
12
+ type graphQLApi = t
13
+
14
+ type defaultAction = ALLOW | DENY
15
+ type userPoolConfig = {
16
+ userPoolId: string,
17
+ defaultAction: defaultAction,
18
+ awsRegion?: string,
19
+ appIdClientRegex?: string,
20
+ }
21
+
22
+ type authenticationType =
23
+ | API_KEY
24
+ | AWS_IAM
25
+ | AMAZON_COGNITO_USER_POOLS
26
+ | OPENID_CONNECT
27
+
28
+ /** Entry of the `additionalAuthenticationProviders` array — minimal shape
29
+ covering the IAM and Cognito cases used by the Reventless platform.
30
+ Extend with `openidConnectConfig` / `lambdaAuthorizerConfig` if needed. */
31
+ type additionalAuthenticationProvider = {
32
+ authenticationType: Pulumi.Input.t<authenticationType>,
33
+ userPoolConfig?: Pulumi.Input.t<userPoolConfig>,
34
+ }
35
+
36
+ type args = {
37
+ authenticationType: Pulumi.Input.t<authenticationType>,
38
+ name?: Pulumi.Input.t<string>,
39
+ schema?: Pulumi.Input.t<string>,
40
+ userPoolConfig?: Pulumi.Input.t<userPoolConfig>,
41
+ additionalAuthenticationProviders?: Pulumi.Input.t<
42
+ array<Pulumi.Input.t<additionalAuthenticationProvider>>,
43
+ >,
44
+ }
45
+
46
+ @module("@pulumi/aws") @scope("appsync") @new
47
+ external make: (
48
+ ~name: string,
49
+ ~args: args=?,
50
+ ~opts: option<Pulumi.CustomResourceOptions.t>=?,
51
+ ) => graphQLApi = "GraphQLApi"
52
+
53
+ @deprecated("use bare make instead")
54
+ let makeUnnecessarilyConvenient = (~name, ~userPoolId, ~schema, ~opts=?) =>
55
+ make(
56
+ ~name,
57
+ ~args={
58
+ authenticationType: AMAZON_COGNITO_USER_POOLS->Pulumi.Input.make,
59
+ userPoolConfig: userPoolId
60
+ ->Pulumi.Output.apply(userPoolId => {userPoolId, defaultAction: ALLOW})
61
+ ->Pulumi.Output.asInput,
62
+ schema,
63
+ },
64
+ ~opts?,
65
+ )
@@ -0,0 +1,20 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Aws from "@pulumi/aws";
4
+ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
5
+
6
+ function makeUnnecessarilyConvenient(name, userPoolId, schema, opts) {
7
+ return new (Aws.appsync.GraphQLApi)(name, {
8
+ authenticationType: "AMAZON_COGNITO_USER_POOLS",
9
+ schema: schema,
10
+ userPoolConfig: userPoolId.apply(userPoolId => ({
11
+ userPoolId: userPoolId,
12
+ defaultAction: "ALLOW"
13
+ }))
14
+ }, opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
15
+ }
16
+
17
+ export {
18
+ makeUnnecessarilyConvenient,
19
+ }
20
+ /* @pulumi/aws Not a pure module */