@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.
- package/CHANGELOG.md +366 -0
- package/LICENSE +202 -0
- package/README.md +19 -0
- package/package.json +52 -0
- package/rescript.json +27 -0
- package/scripts/bundle-resolvers.mjs +77 -0
- package/src/AWS/Aws_AvailabilityZone.res +9 -0
- package/src/AWS/Aws_AvailabilityZone.res.mjs +9 -0
- package/src/AWS/Aws_AvailabilityZone.resi +9 -0
- package/src/AWS/Aws_Aws.res +29 -0
- package/src/AWS/Aws_Aws.res.mjs +32 -0
- package/src/AWS/Aws_Common.res +2 -0
- package/src/AWS/Aws_Common.res.mjs +2 -0
- package/src/AWS/Aws_Provider.res +10 -0
- package/src/AWS/Aws_Provider.res.mjs +2 -0
- package/src/Acm/Acm.res +5 -0
- package/src/Acm/Acm.res.mjs +12 -0
- package/src/Acm/Acm_Certificate.res +27 -0
- package/src/Acm/Acm_Certificate.res.mjs +2 -0
- package/src/Acm/Acm_CertificateValidation.res +22 -0
- package/src/Acm/Acm_CertificateValidation.res.mjs +2 -0
- package/src/AppSync/AppSync.res +7 -0
- package/src/AppSync/AppSync.res.mjs +18 -0
- package/src/AppSync/AppSync_DataSource.res +93 -0
- package/src/AppSync/AppSync_DataSource.res.mjs +42 -0
- package/src/AppSync/AppSync_Function.res +75 -0
- package/src/AppSync/AppSync_Function.res.mjs +36 -0
- package/src/AppSync/AppSync_GraphQLApi.res +65 -0
- package/src/AppSync/AppSync_GraphQLApi.res.mjs +20 -0
- package/src/AppSync/AppSync_Resolver.res +229 -0
- package/src/AppSync/AppSync_Resolver.res.mjs +113 -0
- package/src/AppSync/AppSync_ResolverRuntime.res +214 -0
- package/src/AppSync/AppSync_ResolverRuntime.res.mjs +15 -0
- package/src/AppSync/AppSync_Resolver_Functions.res +998 -0
- package/src/AppSync/AppSync_Resolver_Functions.res.mjs +913 -0
- package/src/Aws.res +5 -0
- package/src/Aws.res.mjs +16 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_Api.res +92 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_Api.res.mjs +12 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_ChannelNamespace.res +81 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_ChannelNamespace.res.mjs +18 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_Resolver.res +39 -0
- package/src/AwsNative/AppSync/AwsNative_AppSync_Resolver.res.mjs +12 -0
- package/src/AwsNative/AwsNative.res +10 -0
- package/src/AwsNative/AwsNative.res.mjs +13 -0
- package/src/CloudFront/CloudFront.res +5 -0
- package/src/CloudFront/CloudFront.res.mjs +12 -0
- package/src/CloudFront/CloudFront_Distribution.res +81 -0
- package/src/CloudFront/CloudFront_Distribution.res.mjs +2 -0
- package/src/CloudFront/CloudFront_OriginAccessControl.res +20 -0
- package/src/CloudFront/CloudFront_OriginAccessControl.res.mjs +2 -0
- package/src/Cloudwatch/Cloudwatch.res +7 -0
- package/src/Cloudwatch/Cloudwatch.res.mjs +18 -0
- package/src/Cloudwatch/Cloudwatch_EventRule.res +52 -0
- package/src/Cloudwatch/Cloudwatch_EventRule.res.mjs +37 -0
- package/src/Cloudwatch/Cloudwatch_EventTarget.res +28 -0
- package/src/Cloudwatch/Cloudwatch_EventTarget.res.mjs +25 -0
- package/src/Cloudwatch/Cloudwatch_LogGroup.res +14 -0
- package/src/Cloudwatch/Cloudwatch_LogGroup.res.mjs +2 -0
- package/src/Cloudwatch/Cloudwatch_LogMetricFilter.res +28 -0
- package/src/Cloudwatch/Cloudwatch_LogMetricFilter.res.mjs +2 -0
- package/src/Cognito/Cognito.res +8 -0
- package/src/Cognito/Cognito.res.mjs +21 -0
- package/src/Cognito/Cognito_IdentityPool.res +148 -0
- package/src/Cognito/Cognito_IdentityPool.res.mjs +65 -0
- package/src/Cognito/Cognito_IdentityPoolRoleAttachment.res +18 -0
- package/src/Cognito/Cognito_IdentityPoolRoleAttachment.res.mjs +2 -0
- package/src/Cognito/Cognito_UserGroup.res +16 -0
- package/src/Cognito/Cognito_UserGroup.res.mjs +2 -0
- package/src/Cognito/Cognito_UserPool.res +125 -0
- package/src/Cognito/Cognito_UserPool.res.mjs +44 -0
- package/src/Cognito/Cognito_UserPoolClient.res +33 -0
- package/src/Cognito/Cognito_UserPoolClient.res.mjs +2 -0
- package/src/DynamoDb/DynamoDb.res +5 -0
- package/src/DynamoDb/DynamoDb.res.mjs +12 -0
- package/src/DynamoDb/DynamoDb_Stream.res +41 -0
- package/src/DynamoDb/DynamoDb_Stream.res.mjs +2 -0
- package/src/DynamoDb/DynamoDb_Table.res +66 -0
- package/src/DynamoDb/DynamoDb_Table.res.mjs +2 -0
- package/src/EC2/EC2.res +13 -0
- package/src/EC2/EC2.res.mjs +36 -0
- package/src/EC2/EC2_Common.res +13 -0
- package/src/EC2/EC2_Common.res.mjs +22 -0
- package/src/EC2/EC2_DefaultSecurityGroup.res +22 -0
- package/src/EC2/EC2_DefaultSecurityGroup.res.mjs +19 -0
- package/src/EC2/EC2_Eip.res +24 -0
- package/src/EC2/EC2_Eip.res.mjs +18 -0
- package/src/EC2/EC2_InternetGateway.res +25 -0
- package/src/EC2/EC2_InternetGateway.res.mjs +18 -0
- package/src/EC2/EC2_NatGateway.res +30 -0
- package/src/EC2/EC2_NatGateway.res.mjs +18 -0
- package/src/EC2/EC2_RouteTable.res +49 -0
- package/src/EC2/EC2_RouteTable.res.mjs +38 -0
- package/src/EC2/EC2_RouteTableAssociation.res +30 -0
- package/src/EC2/EC2_RouteTableAssociation.res.mjs +18 -0
- package/src/EC2/EC2_SecurityGroup.res +44 -0
- package/src/EC2/EC2_SecurityGroup.res.mjs +49 -0
- package/src/EC2/EC2_Subnet.res +31 -0
- package/src/EC2/EC2_Subnet.res.mjs +19 -0
- package/src/EC2/EC2_Vpc.res +25 -0
- package/src/EC2/EC2_Vpc.res.mjs +18 -0
- package/src/EC2/EC2_VpcEndpoint.res +43 -0
- package/src/EC2/EC2_VpcEndpoint.res.mjs +22 -0
- package/src/ECS/ECS.res +6 -0
- package/src/ECS/ECS.res.mjs +15 -0
- package/src/ECS/ECS_Cluster.res +10 -0
- package/src/ECS/ECS_Cluster.res.mjs +2 -0
- package/src/ECS/ECS_Container.res +58 -0
- package/src/ECS/ECS_Container.res.mjs +2 -0
- package/src/ECS/ECS_TaskDefinition.res +31 -0
- package/src/ECS/ECS_TaskDefinition.res.mjs +2 -0
- package/src/IAM/IAM.res +148 -0
- package/src/IAM/IAM.res.mjs +61 -0
- package/src/IAM/IAM_ManagedPolicies.res +32 -0
- package/src/IAM/IAM_ManagedPolicies.res.mjs +2 -0
- package/src/IAM/PolicyDocument.res +163 -0
- package/src/IAM/PolicyDocument.res.mjs +164 -0
- package/src/Kinesis/Kinesis.res +4 -0
- package/src/Kinesis/Kinesis.res.mjs +9 -0
- package/src/Kinesis/Kinesis_Stream.res +70 -0
- package/src/Kinesis/Kinesis_Stream.res.mjs +9 -0
- package/src/Lambda/EventSourceMapping.res +78 -0
- package/src/Lambda/EventSourceMapping.res.mjs +2 -0
- package/src/Lambda/FunctionUrl.res +41 -0
- package/src/Lambda/FunctionUrl.res.mjs +2 -0
- package/src/Lambda/Lambda.res +270 -0
- package/src/Lambda/Lambda.res.mjs +94 -0
- package/src/Route53/Route53.res +4 -0
- package/src/Route53/Route53.res.mjs +9 -0
- package/src/Route53/Route53_Record.res +36 -0
- package/src/Route53/Route53_Record.res.mjs +2 -0
- package/src/S3/S3.res +10 -0
- package/src/S3/S3.res.mjs +27 -0
- package/src/S3/S3_Bucket.res +236 -0
- package/src/S3/S3_Bucket.res.mjs +2 -0
- package/src/S3/S3_BucketAclV2.res +24 -0
- package/src/S3/S3_BucketAclV2.res.mjs +2 -0
- package/src/S3/S3_BucketObject.res +22 -0
- package/src/S3/S3_BucketObject.res.mjs +2 -0
- package/src/S3/S3_BucketOwnershipControls.res +19 -0
- package/src/S3/S3_BucketOwnershipControls.res.mjs +2 -0
- package/src/S3/S3_BucketPolicy.res +13 -0
- package/src/S3/S3_BucketPolicy.res.mjs +2 -0
- package/src/S3/S3_BucketPublicAccessBlock.res +16 -0
- package/src/S3/S3_BucketPublicAccessBlock.res.mjs +2 -0
- package/src/S3/S3_BucketV2.res +11 -0
- package/src/S3/S3_BucketV2.res.mjs +2 -0
- package/src/SES/SES.bs.js +11 -0
- package/src/SES/SES.res +25 -0
- package/src/SES/SES.res.mjs +12 -0
- package/src/SNS/SNS.res +5 -0
- package/src/SNS/SNS.res.mjs +12 -0
- package/src/SNS/SNS_Topic.res +71 -0
- package/src/SNS/SNS_Topic.res.mjs +2 -0
- package/src/SNS/SNS_TopicSubscription.res +21 -0
- package/src/SNS/SNS_TopicSubscription.res.mjs +2 -0
- package/src/SQS/SQS.res +5 -0
- package/src/SQS/SQS.res.mjs +12 -0
- package/src/SQS/SQS_Queue.res +92 -0
- package/src/SQS/SQS_Queue.res.mjs +19 -0
- package/src/SQS/SQS_QueuePolicy.res +13 -0
- package/src/SQS/SQS_QueuePolicy.res.mjs +2 -0
- package/src/SecretsManager/GetSecretVersion.res +37 -0
- package/src/SecretsManager/GetSecretVersion.res.mjs +23 -0
- package/src/example/CustomDomainExample.res +71 -0
- package/src/example/CustomDomainExample.res.mjs +57 -0
- package/tests/AppSync_Resolver_FunctionsTest.mjs +597 -0
- package/tests/__mocks__/appsync-utils.mjs +26 -0
- 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,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,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,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,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"
|
package/src/EC2/EC2.res
ADDED
|
@@ -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
|