@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,8 @@
1
+ /** @pulumi/aws/cognito
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito
3
+ */
4
+ module IdentityPool = Cognito_IdentityPool
5
+ module IdentityPoolRoleAttachment = Cognito_IdentityPoolRoleAttachment
6
+ module UserGroup = Cognito_UserGroup
7
+ module UserPool = Cognito_UserPool
8
+ module UserPoolClient = Cognito_UserPoolClient
@@ -0,0 +1,21 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let IdentityPool;
5
+
6
+ let IdentityPoolRoleAttachment;
7
+
8
+ let UserGroup;
9
+
10
+ let UserPool;
11
+
12
+ let UserPoolClient;
13
+
14
+ export {
15
+ IdentityPool,
16
+ IdentityPoolRoleAttachment,
17
+ UserGroup,
18
+ UserPool,
19
+ UserPoolClient,
20
+ }
21
+ /* No side effect */
@@ -0,0 +1,148 @@
1
+ /** @pulumi/aws/cognito/IdentityPool
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito/identitypool
3
+ */
4
+ type t = {
5
+ arn: Pulumi.Output.t<string>,
6
+ name: Pulumi.Output.t<string>,
7
+ id: Pulumi.Output.t<string>,
8
+ endpoint: Pulumi.Output.t<string>,
9
+ }
10
+
11
+ type cognitoIdentityProvider = {
12
+ clientId: Pulumi.Input.t<string>,
13
+ providerName: Pulumi.Input.t<string>,
14
+ serverSideTokenCheck: Pulumi.Input.t<bool>,
15
+ }
16
+
17
+ type args = {
18
+ allowUnauthenticatedIdentities?: Pulumi.Input.t<bool>,
19
+ cognitoIdentityProviders?: Pulumi.Input.t<array<Pulumi.Input.t<cognitoIdentityProvider>>>,
20
+ identityPoolName: Pulumi.Input.t<string>,
21
+ }
22
+
23
+ @module("@pulumi/aws") @scope("cognito") @new
24
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
25
+ "IdentityPool"
26
+
27
+ // FIXME: This is very application Specific and should be split up into generic- and application parts
28
+ let make = (
29
+ ~userPoolId: Pulumi.Output.t<string>,
30
+ ~userPoolClientId: Pulumi.Input.t<string>,
31
+ ~name: string /* name of identity pool (pulumi context) */,
32
+ ~bucketArns: array<Pulumi.Output.t<PulumiAws.Aws.arn>>,
33
+ ~allowUnauthenticatedIdentities: bool,
34
+ ) => {
35
+ /*
36
+ NOTE:
37
+ -) function only supports a single CognitoIdentityProvider
38
+ -) serverSideTokenCheck (for that single CognitoIdentityProvider) is always 'false'
39
+ TODO: for multi CognitoIdentityProvider support:
40
+ -) Output.allx must support multi UserPool.t AND for each UserPool.t also UserPoolClient.t
41
+ -) apply must be adapted to support multi UserPool.t (another structure maybe)
42
+ -) generation of CognitoIdentityProvider for each UserPool.t
43
+ -) identityPoolName generation must be changed/adapted
44
+ WARNING:
45
+ -) importerBucket is not implemented yet!
46
+ */
47
+ let identityPool = make(
48
+ ~name,
49
+ ~args={
50
+ allowUnauthenticatedIdentities: allowUnauthenticatedIdentities->Pulumi.Input.make,
51
+ cognitoIdentityProviders: [
52
+ {
53
+ clientId: userPoolClientId,
54
+ providerName: userPoolId
55
+ ->Pulumi.Output.apply(userPoolId =>
56
+ "cognito-idp" ++
57
+ ("." ++
58
+ (Pulumi.Config.make(Some("aws"))->Pulumi.Config.require("region") ++
59
+ ("." ++
60
+ ("amazonaws.com" ++ ("/" ++ userPoolId)))))
61
+ )
62
+ ->Pulumi.Output.asInput,
63
+ serverSideTokenCheck: false->Pulumi.Input.make,
64
+ }->Pulumi.Input.make,
65
+ ]->Pulumi.Input.make,
66
+ identityPoolName: userPoolId
67
+ ->Pulumi.Output.apply(userPoolId => "IdentityPool for " ++ userPoolId)
68
+ ->Pulumi.Output.asInput,
69
+ },
70
+ )
71
+
72
+ let role = IAM.Role.make(
73
+ ~name="IdentityPoolAuthRole",
74
+ ~args={
75
+ IAM.Role.assumeRolePolicy: identityPool.id
76
+ ->Pulumi.Output.apply(identityPoolId =>
77
+ `{
78
+ "Version": "2012-10-17",
79
+ "Statement": [
80
+ {
81
+ "Effect": "Allow",
82
+ "Principal": {
83
+ "Federated": "cognito-identity.amazonaws.com"
84
+ },
85
+ "Action": "sts:AssumeRoleWithWebIdentity",
86
+ "Condition": {
87
+ "ForAnyValue:StringEquals": {
88
+ "cognito-identity.amazonaws.com:aud": [
89
+ "${identityPoolId}"
90
+ ]
91
+ },
92
+ "ForAnyValue:StringLike": {
93
+ "cognito-identity.amazonaws.com:amr": "authenticated"
94
+ }
95
+ }
96
+ }
97
+ ]
98
+ }`
99
+ )
100
+ ->Pulumi.Output.asInput,
101
+ },
102
+ )
103
+
104
+ let _roleAttachment = Cognito_IdentityPoolRoleAttachment.make(
105
+ ~name="IdentityPool",
106
+ ~args={
107
+ Cognito_IdentityPoolRoleAttachment.identityPoolId: identityPool.id->Pulumi.Output.asInput,
108
+ roles: {
109
+ Cognito_IdentityPoolRoleAttachment.authenticated: role.arn->Pulumi.Output.asInput,
110
+ }->Pulumi.Input.make,
111
+ },
112
+ )
113
+ ()
114
+
115
+ let toResource = arn => arn->Pulumi.Output.apply(arn => arn ++ "/*")
116
+
117
+ let _rolePolicy = if bucketArns->Array.length > 0 {
118
+ {
119
+ IAM.RolePolicy.make(
120
+ ~name="IdentityPool",
121
+ ~args={
122
+ IAM.RolePolicy.policy: bucketArns
123
+ ->Array.map(toResource)
124
+ ->Pulumi.Output.all
125
+ ->Pulumi.Output.apply(resourceArns =>
126
+ PolicyDocument.make(
127
+ ~id=name ++ "Policy",
128
+ ~statements=[
129
+ {
130
+ sid: "AllowGetObject",
131
+ effect: PolicyDocument.Allow,
132
+ actions: PolicyDocument.Actions(["s3:GetObject"]),
133
+ resources: PolicyDocument.Resources(resourceArns),
134
+ },
135
+ ],
136
+ )->PolicyDocument.toJsonString
137
+ )
138
+ ->Pulumi.Output.asInput,
139
+ role: role.id->Pulumi.Output.asInput,
140
+ },
141
+ )
142
+ }->Some
143
+ } else {
144
+ None
145
+ }
146
+
147
+ identityPool
148
+ }
@@ -0,0 +1,65 @@
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 PolicyDocument$PulumiAws from "../IAM/PolicyDocument.res.mjs";
6
+
7
+ function make(userPoolId, userPoolClientId, name, bucketArns, allowUnauthenticatedIdentities) {
8
+ let identityPool = new (Aws.cognito.IdentityPool)(name, {
9
+ allowUnauthenticatedIdentities: allowUnauthenticatedIdentities,
10
+ cognitoIdentityProviders: [{
11
+ clientId: userPoolClientId,
12
+ providerName: userPoolId.apply(userPoolId => "cognito-idp." + (new Pulumi.Config("aws").require("region") + (".amazonaws.com/" + userPoolId))),
13
+ serverSideTokenCheck: false
14
+ }],
15
+ identityPoolName: userPoolId.apply(userPoolId => "IdentityPool for " + userPoolId)
16
+ });
17
+ let role = new (Aws.iam.Role)("IdentityPoolAuthRole", {
18
+ assumeRolePolicy: identityPool.id.apply(identityPoolId => `{
19
+ "Version": "2012-10-17",
20
+ "Statement": [
21
+ {
22
+ "Effect": "Allow",
23
+ "Principal": {
24
+ "Federated": "cognito-identity.amazonaws.com"
25
+ },
26
+ "Action": "sts:AssumeRoleWithWebIdentity",
27
+ "Condition": {
28
+ "ForAnyValue:StringEquals": {
29
+ "cognito-identity.amazonaws.com:aud": [
30
+ "` + identityPoolId + `"
31
+ ]
32
+ },
33
+ "ForAnyValue:StringLike": {
34
+ "cognito-identity.amazonaws.com:amr": "authenticated"
35
+ }
36
+ }
37
+ }
38
+ ]
39
+ }`)
40
+ });
41
+ new (Aws.cognito.IdentityPoolRoleAttachment)("IdentityPool", {
42
+ identityPoolId: identityPool.id,
43
+ roles: {
44
+ authenticated: role.arn
45
+ }
46
+ });
47
+ let toResource = arn => arn.apply(arn => arn + "/*");
48
+ if (bucketArns.length !== 0) {
49
+ new (Aws.iam.RolePolicy)("IdentityPool", {
50
+ policy: Pulumi.all(bucketArns.map(toResource)).apply(resourceArns => PolicyDocument$PulumiAws.toJsonString(PolicyDocument$PulumiAws.make(undefined, name + "Policy", [{
51
+ Sid: "AllowGetObject",
52
+ Effect: "Allow",
53
+ Action: ["s3:GetObject"],
54
+ Resource: resourceArns
55
+ }]))),
56
+ role: role.id
57
+ });
58
+ }
59
+ return identityPool;
60
+ }
61
+
62
+ export {
63
+ make,
64
+ }
65
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,18 @@
1
+ /** @pulumi/aws/cognito/IdentityPoolRoleAttachment
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito/identitypoolroleattachment
3
+ */
4
+ type t
5
+
6
+ type roles = {
7
+ authenticated?: Pulumi.Input.t<string>,
8
+ unauthenticated?: Pulumi.Input.t<string>,
9
+ }
10
+
11
+ type args = {
12
+ identityPoolId?: Pulumi.Input.t<string>,
13
+ roles: Pulumi.Input.t<roles>,
14
+ }
15
+
16
+ @module("@pulumi/aws") @scope("cognito") @new
17
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
18
+ "IdentityPoolRoleAttachment"
@@ -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,16 @@
1
+ /** @pulumi/aws/cognito/UserGroup
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito/usergroup
3
+ */
4
+ type t
5
+
6
+ type args = {
7
+ description?: Pulumi.Input.t<string>,
8
+ name?: Pulumi.Input.t<string>,
9
+ precedence?: Pulumi.Input.t<string>,
10
+ roleArn?: Pulumi.Input.t<string>,
11
+ userPoolId: Pulumi.Input.t<string>,
12
+ }
13
+
14
+ @module("@pulumi/aws") @scope("cognito") @new
15
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => t =
16
+ "UserGroup"
@@ -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,125 @@
1
+ /** @pulumi/aws/cognit/UserPool
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito/userpool
3
+ */
4
+ open Pulumi
5
+
6
+ type t = {
7
+ arn: Output.t<string>,
8
+ name: Output.t<string>,
9
+ id: Output.t<string>,
10
+ endpoint: Output.t<string>,
11
+ }
12
+
13
+ @module("@pulumi/aws") @scope(("cognito", "UserPool"))
14
+ external get: (~name: string, ~id: Input.t<string>, ~opts: CustomResourceOptions.t=?) => t = "get"
15
+
16
+ type userAttributes = dict<string>
17
+
18
+ type lambdaConfig = {
19
+ createAuthChallenge?: Input.t<string>,
20
+ customMessage?: Input.t<string>,
21
+ defineAuthChallenge?: Input.t<string>,
22
+ postAuthentication?: Input.t<string>,
23
+ postConfirmation?: Input.t<string>,
24
+ preAuthentication?: Input.t<string>,
25
+ preSignUp?: Input.t<string>,
26
+ preTokenGeneration?: Input.t<string>,
27
+ userMigration?: Input.t<string>,
28
+ verifyAuthChallengeResponse?: Input.t<string>,
29
+ }
30
+
31
+ type adminCreateUserConfig = {allowAdminCreateUserOnly?: Input.t<bool>}
32
+
33
+ type passwordPolicy = {
34
+ minimumLength?: Input.t<int>,
35
+ requireLowercase?: Input.t<bool>,
36
+ requireNumbers?: Input.t<bool>,
37
+ requireSymbols?: Input.t<bool>,
38
+ requireUppercase?: Input.t<bool>,
39
+ }
40
+
41
+ type args = {
42
+ name?: Input.t<string>,
43
+ lambdaConfig?: Input.t<lambdaConfig>,
44
+ adminCreateUserConfig?: Input.t<adminCreateUserConfig>,
45
+ usernameAttributes?: Input.t<array<Input.t<string>>>,
46
+ passwordPolicy?: Input.t<passwordPolicy>,
47
+ mfaConfiguration?: Input.t<string>,
48
+ tags?: Input.t<Aws.tags>,
49
+ }
50
+
51
+ @module("@pulumi/aws") @scope("cognito") @new
52
+ external make: (~name: string, ~args: args=?, ~opts: CustomResourceOptions.t=?) => t = "UserPool"
53
+ @module("@pulumi/aws") @scope("cognito") @new
54
+ external makeWithOptions: (
55
+ ~name: string,
56
+ ~args: option<args>,
57
+ ~opts: option<CustomResourceOptions.t>,
58
+ ) => t = "UserPool"
59
+
60
+ type triggerSource = PreSignUp_SignUp | PreSignUp_AdminCreateUser // TODO: add other trigger sources
61
+ type request = {userAttributes: userAttributes} // TODO: add other request params
62
+ type response = {autoConfirmUser?: bool} // TODO: add other response params
63
+ type event = {triggerSource: triggerSource, request: request, response: response}
64
+
65
+ let makeAutoCommiting: (~name: string, ~args: args=?, ~opts: CustomResourceOptions.t=?) => t = (
66
+ ~name,
67
+ ~args=?,
68
+ ~opts=?,
69
+ ) => {
70
+ let autoCommitUser: Lambda.eventHandler<event, event> = async (event: event, _) => {
71
+ {...event, response: {autoConfirmUser: true}}
72
+ }
73
+
74
+ let autoCommitLambda = Lambda.CallbackFunction.make(
75
+ ~name="autoCommitUser" ++ name,
76
+ ~args=Lambda.CallbackFunction.Args.make(
77
+ ~callback=autoCommitUser,
78
+ ~policies=Lambda.defaultLoggingPolicyDocument->PolicyDocument.toJsonString,
79
+ ),
80
+ ~opts?,
81
+ )
82
+
83
+ let autoCommitArn = autoCommitLambda.arn
84
+
85
+ let _attachAutoCommitPermission = autoCommitLambda.name->Output.apply(autoCommitLambdaName => {
86
+ Lambda.Permission.make(
87
+ ~name="autoCommitPermission",
88
+ ~args={
89
+ action: "lambda:InvokeFunction",
90
+ function: autoCommitLambdaName->Input.make,
91
+ principal: "cognito-idp.amazonaws.com",
92
+ },
93
+ )
94
+ })
95
+
96
+ let lambdaConfig = {preSignUp: autoCommitArn->Output.asInput}
97
+ let args = switch args {
98
+ | None => {lambdaConfig: lambdaConfig->Input.make}->Some
99
+ | Some(args) =>
100
+ {
101
+ name: ?args.name,
102
+ lambdaConfig: lambdaConfig->Input.make,
103
+ adminCreateUserConfig: ?args.adminCreateUserConfig,
104
+ usernameAttributes: ?args.usernameAttributes,
105
+ passwordPolicy: ?args.passwordPolicy,
106
+ mfaConfiguration: ?args.mfaConfiguration,
107
+ tags: ?args.tags,
108
+ }->Some
109
+ }
110
+ makeWithOptions(~name, ~args, ~opts)
111
+ }
112
+
113
+ type getArgs = {userPoolId: string, region?: string}
114
+
115
+ type getResult = {
116
+ arn: string,
117
+ id: string,
118
+ name: string,
119
+ }
120
+
121
+ @module("@pulumi/aws") @scope("cognito") @val
122
+ external getUserPoolOutput: (
123
+ ~args: getArgs,
124
+ ~opts: InvokeOptions.t=?,
125
+ ) => Output.t<getResult> = "getUserPoolOutput"
@@ -0,0 +1,44 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Aws from "@pulumi/aws";
4
+ import * as Lambda$PulumiAws from "../Lambda/Lambda.res.mjs";
5
+ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
6
+ import * as PolicyDocument$PulumiAws from "../IAM/PolicyDocument.res.mjs";
7
+
8
+ function makeAutoCommiting(name, args, opts) {
9
+ let autoCommitUser = async (event, param) => ({
10
+ triggerSource: event.triggerSource,
11
+ request: event.request,
12
+ response: {
13
+ autoConfirmUser: true
14
+ }
15
+ });
16
+ let autoCommitLambda = new (Aws.lambda.CallbackFunction)("autoCommitUser" + name, Lambda$PulumiAws.CallbackFunction.Args.make(autoCommitUser, undefined, PolicyDocument$PulumiAws.toJsonString(Lambda$PulumiAws.defaultLoggingPolicyDocument), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined), opts !== undefined ? Primitive_option.valFromOption(opts) : undefined);
17
+ let autoCommitArn = autoCommitLambda.arn;
18
+ autoCommitLambda.name.apply(autoCommitLambdaName => new (Aws.lambda.Permission)("autoCommitPermission", {
19
+ action: "lambda:InvokeFunction",
20
+ function: autoCommitLambdaName,
21
+ principal: "cognito-idp.amazonaws.com"
22
+ }));
23
+ let lambdaConfig_preSignUp = autoCommitArn;
24
+ let lambdaConfig = {
25
+ preSignUp: lambdaConfig_preSignUp
26
+ };
27
+ let args$1 = args !== undefined ? ({
28
+ name: args.name,
29
+ lambdaConfig: lambdaConfig,
30
+ adminCreateUserConfig: args.adminCreateUserConfig,
31
+ usernameAttributes: args.usernameAttributes,
32
+ passwordPolicy: args.passwordPolicy,
33
+ mfaConfiguration: args.mfaConfiguration,
34
+ tags: args.tags
35
+ }) : ({
36
+ lambdaConfig: lambdaConfig
37
+ });
38
+ return new (Aws.cognito.UserPool)(name, args$1, opts);
39
+ }
40
+
41
+ export {
42
+ makeAutoCommiting,
43
+ }
44
+ /* @pulumi/aws Not a pure module */
@@ -0,0 +1,33 @@
1
+ /** @pulumi/aws/cognito/UserPoolClient
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/cognito/userpoolclient
3
+ */
4
+ open Pulumi
5
+
6
+ type t = {
7
+ urn: Output.t<string>,
8
+ name: Output.t<string>,
9
+ id: Output.t<string>,
10
+ userPoolId: Output.t<string>,
11
+ }
12
+
13
+ type tokenValidityUnits = {
14
+ accessToken?: Input.t<string>,
15
+ idToken?: Input.t<string>,
16
+ refreshToken?: Input.t<string>,
17
+ }
18
+
19
+ type args = {
20
+ userPoolId: Input.t<string>,
21
+ name?: Input.t<string>,
22
+ generateSecret?: Input.t<bool>,
23
+ explicitAuthFlows?: Input.t<array<Input.t<string>>>,
24
+ preventUserExistenceErrors?: Input.t<string>,
25
+ idTokenValidity?: Input.t<int>,
26
+ accessTokenValidity?: Input.t<int>,
27
+ refreshTokenValidity?: Input.t<int>,
28
+ tokenValidityUnits?: Input.t<tokenValidityUnits>,
29
+ }
30
+
31
+ @module("@pulumi/aws") @scope("cognito") @new
32
+ external make: (~name: string, ~args: args=?, ~opts: CustomResourceOptions.t=?) => t =
33
+ "UserPoolClient"
@@ -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/dynamodb
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/dynamodb/
3
+ */
4
+ module Table = DynamoDb_Table
5
+ module Stream = DynamoDb_Stream
@@ -0,0 +1,12 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+
4
+ let Table;
5
+
6
+ let Stream;
7
+
8
+ export {
9
+ Table,
10
+ Stream,
11
+ }
12
+ /* No side effect */
@@ -0,0 +1,41 @@
1
+ type streamViewType =
2
+ | KEYS_ONLY
3
+ | NEW_IMAGE
4
+ | OLD_IMAGE
5
+ | NEW_AND_OLD_IMAGES
6
+
7
+ type keys = {id: AwsSdk.DynamoDb.Util.attributeValue}
8
+ type image = dict<AwsSdk.DynamoDb.Util.attributeValue>
9
+
10
+ type streamRecord = {
11
+ @as("ApproximateCreationTime") approximateCreationTime?: int,
12
+ @as("Keys") keys: keys,
13
+ @as("NewImage") newImage?: image,
14
+ @as("OldImage") oldImage?: image,
15
+ @as("SequenceNumber") sequenceNumber?: string,
16
+ @as("SizeBytes") sizeBytes?: int,
17
+ @as("StreamViewType") streamViewType?: streamViewType,
18
+ }
19
+
20
+ type functionResponseType =
21
+ | INSERT
22
+ | MODIFY
23
+ | REMOVE
24
+
25
+ type record = {
26
+ awsRegion: string,
27
+ dynamodb?: streamRecord,
28
+ eventID: string,
29
+ eventName: functionResponseType,
30
+ eventSource: string,
31
+ eventSourceARN: string,
32
+ eventVersion: string,
33
+ userIdentity: string,
34
+ }
35
+
36
+ external asRecord: Lambda.CallbackFunction.record => record = "%identity"
37
+
38
+ type event = {@as("Records") records: array<record>}
39
+
40
+ type itemIdentifier = {itemIdentifier: string}
41
+ type streamEventResponse = {batchItemFailures: array<itemIdentifier>}
@@ -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,66 @@
1
+ /** @pulumi/aws/dynamodb/table
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/dynamodb/table
3
+ */
4
+ type ttl = {attributeName: string, enabled?: bool}
5
+ type pointInTimeRecovery = {enabled: bool}
6
+
7
+ type t = {
8
+ arn: Pulumi.Output.t<string>,
9
+ name: Pulumi.Output.t<string>,
10
+ id: Pulumi.Output.t<string>,
11
+ hashKey: Pulumi.Output.t<string>,
12
+ rangeKey: Pulumi.Output.t<option<string>>,
13
+ streamEnabled: Pulumi.Output.t<option<bool>>,
14
+ streamArn: Pulumi.Output.t<string>,
15
+ streamLabel: Pulumi.Output.t<string>,
16
+ ttl: Pulumi.Output.t<ttl>,
17
+ pointInTimeRecovery: Pulumi.Output.t<pointInTimeRecovery>,
18
+ }
19
+ type table = t
20
+
21
+ type projectionType = KEYS_ONLY | ALL | INCLUDE
22
+
23
+ type globalSecondaryIndex = {
24
+ hashKey: string,
25
+ name: string,
26
+ projectionType: projectionType,
27
+ nonKeyAttributes?: array<string>,
28
+ rangeKey?: string,
29
+ readCapacity?: int,
30
+ writeCapacity?: int,
31
+ }
32
+
33
+ type localSecondaryIndex = {
34
+ name: string,
35
+ nonKeyAttributes?: array<string>,
36
+ projectionType: projectionType,
37
+ rangeKey: string,
38
+ }
39
+
40
+ type attribute = {name: string, @as("type") type_: string}
41
+ type streamViewType = KEYS_ONLY | NEW_IMAGE | OLD_IMAGE | NEW_AND_OLD_IMAGES
42
+ type billingMode = PROVISIONED | PAY_PER_REQUEST
43
+
44
+ type args = {
45
+ attributes: Pulumi.Input.t<array<attribute>>,
46
+ hashKey: Pulumi.Input.t<string>,
47
+ billingMode: billingMode,
48
+ rangeKey?: Pulumi.Input.t<string>,
49
+ name?: Pulumi.Input.t<string>,
50
+ globalSecondaryIndexes?: Pulumi.Input.t<array<Pulumi.Input.t<globalSecondaryIndex>>>,
51
+ localSecondaryIndexes?: Pulumi.Input.t<array<Pulumi.Input.t<localSecondaryIndex>>>,
52
+ readCapacity?: Pulumi.Input.t<int>,
53
+ writeCapacity?: Pulumi.Input.t<int>,
54
+ tags?: Pulumi.Input.t<Aws.tags>,
55
+ streamEnabled?: bool,
56
+ streamViewType?: streamViewType,
57
+ ttl?: Pulumi.Input.t<ttl>,
58
+ pointInTimeRecovery?: Pulumi.Input.t<pointInTimeRecovery>,
59
+ restoreSourceName?: Pulumi.Input.t<string>,
60
+ restoreDateTime?: Pulumi.Input.t<string>,
61
+ restoreToLatestTime?: Pulumi.Input.t<bool>,
62
+ }
63
+
64
+ @module("@pulumi/aws") @scope("dynamodb") @new
65
+ external make: (~name: string, ~args: args, ~opts: Pulumi.CustomResourceOptions.t=?) => table =
66
+ "Table"
@@ -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,13 @@
1
+ /** @pulumi/aws/ec2
2
+ see: https://www.pulumi.com/registry/packages/aws/api-docs/ec2
3
+ */
4
+ module DefaultSecurityGroup = EC2_DefaultSecurityGroup
5
+ module Eip = EC2_Eip
6
+ module InternetGateway = EC2_InternetGateway
7
+ module NatGateway = EC2_NatGateway
8
+ module RouteTable = EC2_RouteTable
9
+ module RouteTableAssociation = EC2_RouteTableAssociation
10
+ module SecurityGroup = EC2_SecurityGroup
11
+ module Subnet = EC2_Subnet
12
+ module Vpc = EC2_Vpc
13
+ module VpcEndpoint = EC2_VpcEndpoint