@anvil-cloud/sdk 0.0.14 → 0.0.15

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 (56) hide show
  1. package/aws/cognitoAuth.ts +70 -0
  2. package/aws/cognitoUserPool.ts +132 -0
  3. package/aws/dynamoDB.ts +176 -0
  4. package/aws/eventBus.ts +91 -0
  5. package/aws/httpApi.ts +108 -0
  6. package/aws/index.ts +49 -0
  7. package/aws/lambda.ts +1 -1
  8. package/aws/oauthAuthorizer.ts +70 -0
  9. package/aws/queue.ts +156 -0
  10. package/aws/svelteKitSite.ts +14 -0
  11. package/aws/vpcEndpoint.ts +9 -4
  12. package/bin/aws/cognitoAuth.d.ts +36 -0
  13. package/bin/aws/cognitoAuth.js +53 -0
  14. package/bin/aws/cognitoAuth.js.map +1 -0
  15. package/bin/aws/cognitoUserPool.d.ts +82 -0
  16. package/bin/aws/cognitoUserPool.js +65 -0
  17. package/bin/aws/cognitoUserPool.js.map +1 -0
  18. package/bin/aws/dynamoDB.d.ts +115 -0
  19. package/bin/aws/dynamoDB.js +121 -0
  20. package/bin/aws/dynamoDB.js.map +1 -0
  21. package/bin/aws/eventBus.d.ts +47 -0
  22. package/bin/aws/eventBus.js +63 -0
  23. package/bin/aws/eventBus.js.map +1 -0
  24. package/bin/aws/httpApi.d.ts +66 -0
  25. package/bin/aws/httpApi.js +60 -0
  26. package/bin/aws/httpApi.js.map +1 -0
  27. package/bin/aws/index.d.ts +21 -0
  28. package/bin/aws/index.js +29 -1
  29. package/bin/aws/index.js.map +1 -1
  30. package/bin/aws/lambda.d.ts +1 -1
  31. package/bin/aws/oauthAuthorizer.d.ts +36 -0
  32. package/bin/aws/oauthAuthorizer.js +53 -0
  33. package/bin/aws/oauthAuthorizer.js.map +1 -0
  34. package/bin/aws/queue.d.ts +83 -0
  35. package/bin/aws/queue.js +103 -0
  36. package/bin/aws/queue.js.map +1 -0
  37. package/bin/aws/svelteKitSite.d.ts +9 -0
  38. package/bin/aws/svelteKitSite.js +3 -0
  39. package/bin/aws/svelteKitSite.js.map +1 -1
  40. package/bin/aws/vpcEndpoint.d.ts +9 -5
  41. package/bin/aws/vpcEndpoint.js +2 -1
  42. package/bin/aws/vpcEndpoint.js.map +1 -1
  43. package/bin/grants.js +4 -0
  44. package/bin/grants.js.map +1 -1
  45. package/bin/package.json +1 -1
  46. package/bin/types/enums/aws/index.d.ts +164 -36
  47. package/bin/types/enums/aws/index.js +149 -35
  48. package/bin/types/enums/aws/index.js.map +1 -1
  49. package/bin/types/input.d.ts +962 -10
  50. package/bin/types/output.d.ts +13 -0
  51. package/grants.ts +6 -1
  52. package/package.json +1 -1
  53. package/tsconfig.json +7 -0
  54. package/types/enums/aws/index.ts +186 -36
  55. package/types/input.ts +994 -10
  56. package/types/output.ts +14 -0
@@ -0,0 +1,70 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as utilities from "../utilities";
6
+
7
+ /**
8
+ * An Anvil-managed JWT authorizer for HTTP API Gateway. Works with any OIDC-compliant identity provider — Auth0, Clerk, Google, Okta, Cognito. API Gateway verifies the JWT signature, issuer, audience, and expiry on every request natively — no Lambda or custom code required. Pass authorizerId to HttpApi defaultAuthorizerId to protect your routes.
9
+ */
10
+ export class OAuthAuthorizer extends pulumi.ComponentResource {
11
+ /** @internal */
12
+ public static readonly __pulumiType = 'anvil:aws:OAuthAuthorizer';
13
+
14
+ /**
15
+ * Returns true if the given object is an instance of OAuthAuthorizer. This is designed to work even
16
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
17
+ */
18
+ public static isInstance(obj: any): obj is OAuthAuthorizer {
19
+ if (obj === undefined || obj === null) {
20
+ return false;
21
+ }
22
+ return obj['__pulumiType'] === OAuthAuthorizer.__pulumiType;
23
+ }
24
+
25
+ /**
26
+ * The API Gateway authorizer ID. Pass this to HttpApi defaultAuthorizerId to protect your API routes.
27
+ */
28
+ declare public /*out*/ readonly authorizerId: pulumi.Output<string>;
29
+
30
+ /**
31
+ * Create a OAuthAuthorizer resource with the given unique name, arguments, and options.
32
+ *
33
+ * @param name The _unique_ name of the resource.
34
+ * @param args The arguments to use to populate this resource's properties.
35
+ * @param opts A bag of options that control this resource's behavior.
36
+ */
37
+ constructor(name: string, args: OAuthAuthorizerArgs, opts?: pulumi.ComponentResourceOptions) {
38
+ let resourceInputs: pulumi.Inputs = {};
39
+ opts = opts || {};
40
+ if (!opts.id) {
41
+ if (args?.audience === undefined && !opts.urn) {
42
+ throw new Error("Missing required property 'audience'");
43
+ }
44
+ if (args?.issuer === undefined && !opts.urn) {
45
+ throw new Error("Missing required property 'issuer'");
46
+ }
47
+ resourceInputs["audience"] = args?.audience;
48
+ resourceInputs["issuer"] = args?.issuer;
49
+ resourceInputs["authorizerId"] = undefined /*out*/;
50
+ } else {
51
+ resourceInputs["authorizerId"] = undefined /*out*/;
52
+ }
53
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
54
+ super(OAuthAuthorizer.__pulumiType, name, resourceInputs, opts, true /*remote*/);
55
+ }
56
+ }
57
+
58
+ /**
59
+ * The set of arguments for constructing a OAuthAuthorizer resource.
60
+ */
61
+ export interface OAuthAuthorizerArgs {
62
+ /**
63
+ * The intended recipients of the JWT. API Gateway rejects tokens whose 'aud' claim does not match one of these values. Typically your API's client ID registered with the identity provider.
64
+ */
65
+ audience: pulumi.Input<pulumi.Input<string>[]>;
66
+ /**
67
+ * The OIDC issuer URL of your identity provider. API Gateway fetches public signing keys from {issuer}/.well-known/jwks.json to verify token signatures. Examples: Auth0: 'https://your-tenant.auth0.com/', Clerk: 'https://your-instance.clerk.accounts.dev', Google: 'https://accounts.google.com'.
68
+ */
69
+ issuer: pulumi.Input<string>;
70
+ }
package/aws/queue.ts ADDED
@@ -0,0 +1,156 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+ import * as enums from "../types/enums";
8
+ import * as utilities from "../utilities";
9
+ import * as grants from "../grants";
10
+
11
+ /**
12
+ * An Anvil-managed SQS queue. A dead letter queue is always provisioned to prevent silent message loss. SSE-SQS encryption is enabled by default at no cost.
13
+ */
14
+ export class Queue extends pulumi.ComponentResource {
15
+ /** @internal */
16
+ public static readonly __pulumiType = 'anvil:aws:Queue';
17
+
18
+ /** @internal Logical resource name for grant policy naming. */
19
+ private __name: string;
20
+
21
+ /**
22
+ * Returns true if the given object is an instance of Queue. This is designed to work even
23
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
24
+ */
25
+ public static isInstance(obj: any): obj is Queue {
26
+ if (obj === undefined || obj === null) {
27
+ return false;
28
+ }
29
+ return obj['__pulumiType'] === Queue.__pulumiType;
30
+ }
31
+
32
+ /**
33
+ * The ARN of the SQS queue.
34
+ */
35
+ declare public /*out*/ readonly arn: pulumi.Output<string>;
36
+ /**
37
+ * The ARN of the dead letter queue.
38
+ */
39
+ declare public /*out*/ readonly dlqArn: pulumi.Output<string>;
40
+ /**
41
+ * The URL of the dead letter queue.
42
+ */
43
+ declare public /*out*/ readonly dlqUrl: pulumi.Output<string>;
44
+ /**
45
+ * The physical name of the SQS queue.
46
+ */
47
+ declare public /*out*/ readonly name: pulumi.Output<string>;
48
+ /**
49
+ * The URL of the SQS queue. Use this to send and receive messages.
50
+ */
51
+ declare public /*out*/ readonly url: pulumi.Output<string>;
52
+
53
+ /**
54
+ * Create a Queue resource with the given unique name, arguments, and options.
55
+ *
56
+ * @param name The _unique_ name of the resource.
57
+ * @param args The arguments to use to populate this resource's properties.
58
+ * @param opts A bag of options that control this resource's behavior.
59
+ */
60
+ constructor(name: string, args?: QueueArgs, opts?: pulumi.ComponentResourceOptions) {
61
+ let resourceInputs: pulumi.Inputs = {};
62
+ opts = opts || {};
63
+ if (!opts.id) {
64
+ resourceInputs["consumer"] = args?.consumer;
65
+ resourceInputs["dlq"] = args?.dlq;
66
+ resourceInputs["fifo"] = args?.fifo;
67
+ resourceInputs["transform"] = args?.transform;
68
+ resourceInputs["arn"] = undefined /*out*/;
69
+ resourceInputs["dlqArn"] = undefined /*out*/;
70
+ resourceInputs["dlqUrl"] = undefined /*out*/;
71
+ resourceInputs["name"] = undefined /*out*/;
72
+ resourceInputs["url"] = undefined /*out*/;
73
+ } else {
74
+ resourceInputs["arn"] = undefined /*out*/;
75
+ resourceInputs["dlqArn"] = undefined /*out*/;
76
+ resourceInputs["dlqUrl"] = undefined /*out*/;
77
+ resourceInputs["name"] = undefined /*out*/;
78
+ resourceInputs["url"] = undefined /*out*/;
79
+ }
80
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
81
+ super(Queue.__pulumiType, name, resourceInputs, opts, true /*remote*/);
82
+ this.__name = name;
83
+ }
84
+
85
+ /**
86
+ * Grants sendmessage access (sqs:SendMessage) on this queue
87
+ * to the target compute resource's execution role.
88
+ *
89
+ * @param target - The compute resource to grant access to.
90
+ * @param opts - Optional grant options (justification for audit trail).
91
+ */
92
+ public grantSendMessage(target: grants.GrantTarget, opts?: grants.GrantOptions): void {
93
+ const name = `${this.__name}-${target.grantName()}-sendmessage`;
94
+ const arns = grants.buildResourceArns(this.arn, undefined);
95
+ grants.createGrant(this, name, target, ["sqs:SendMessage"], arns, opts);
96
+ }
97
+
98
+ /**
99
+ * Grants consumemessages access (sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes) on this queue
100
+ * to the target compute resource's execution role.
101
+ *
102
+ * @param target - The compute resource to grant access to.
103
+ * @param opts - Optional grant options (justification for audit trail).
104
+ */
105
+ public grantConsumeMessages(target: grants.GrantTarget, opts?: grants.GrantOptions): void {
106
+ const name = `${this.__name}-${target.grantName()}-consumemessages`;
107
+ const arns = grants.buildResourceArns(this.arn, undefined);
108
+ grants.createGrant(this, name, target, ["sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:GetQueueAttributes"], arns, opts);
109
+ }
110
+
111
+ /**
112
+ * Grants full access (sqs:SendMessage, sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes, sqs:ChangeMessageVisibility, sqs:PurgeQueue) on this queue
113
+ * to the target compute resource's execution role.
114
+ *
115
+ * This is an escape hatch — prefer scoped grants (grantRead, grantWrite, etc.).
116
+ * A warning is logged if no justification is provided.
117
+ */
118
+ public grantFullAccess(target: grants.GrantTarget, opts?: grants.GrantOptions): void {
119
+ if (!opts?.justification) {
120
+ pulumi.log.warn(
121
+ `⚠ ${this.__name} → ${target.grantName()}: full access granted with no justification. ` +
122
+ `Consider scoping with grantRead, grantWrite, or grantDelete, ` +
123
+ `or add a justification.`,
124
+ this,
125
+ );
126
+ } else {
127
+ pulumi.log.info(
128
+ `ℹ ${this.__name} → ${target.grantName()}: full access granted. Justification: "${opts.justification}"`,
129
+ this,
130
+ );
131
+ }
132
+ const name = `${this.__name}-${target.grantName()}-fullaccess`;
133
+ const arns = grants.buildResourceArns(this.arn, undefined);
134
+ grants.createGrant(this, name, target, ["sqs:SendMessage", "sqs:ReceiveMessage", "sqs:DeleteMessage", "sqs:GetQueueAttributes", "sqs:ChangeMessageVisibility", "sqs:PurgeQueue"], arns, opts);
135
+ }
136
+
137
+ }
138
+
139
+ /**
140
+ * The set of arguments for constructing a Queue resource.
141
+ */
142
+ export interface QueueArgs {
143
+ /**
144
+ * Wires a compute resource to consume messages from this queue. Creates the event source mapping (trigger) and grants the necessary IAM permissions automatically.
145
+ */
146
+ consumer?: pulumi.Input<inputs.aws.QueueConsumerArgsArgs>;
147
+ /**
148
+ * Dead letter queue configuration. Always provisioned — messages that fail processing are moved here instead of being silently dropped. Omit to use defaults (managed DLQ, maxReceiveCount: 3). Set arn to reuse an existing queue.
149
+ */
150
+ dlq?: pulumi.Input<inputs.aws.QueueDlqArgsArgs>;
151
+ /**
152
+ * Creates a FIFO queue when true. FIFO queues guarantee message ordering and exactly-once processing but have lower throughput (~3,000 msg/s vs unlimited for standard). Use for financial transactions, inventory updates, or any workflow where ordering or deduplication matters. Default: false.
153
+ */
154
+ fifo?: pulumi.Input<boolean>;
155
+ transform?: pulumi.Input<inputs.aws.QueueTransformArgsArgs>;
156
+ }
@@ -2,6 +2,9 @@
2
2
  // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
3
 
4
4
  import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+ import * as enums from "../types/enums";
5
8
  import * as utilities from "../utilities";
6
9
 
7
10
  export class SvelteKitSite extends pulumi.ComponentResource {
@@ -23,6 +26,10 @@ export class SvelteKitSite extends pulumi.ComponentResource {
23
26
  declare public /*out*/ readonly cloudFrontDistributionId: pulumi.Output<string | undefined>;
24
27
  declare public /*out*/ readonly dnsRecords: pulumi.Output<string | undefined>;
25
28
  declare public /*out*/ readonly functionName: pulumi.Output<string | undefined>;
29
+ /**
30
+ * OriginSecret is the x-origin-secret header value to configure in Cloudflare Transform Rules. Only populated when originProtection is set.
31
+ */
32
+ declare public /*out*/ readonly originSecret: pulumi.Output<string | undefined>;
26
33
  declare public /*out*/ readonly url: pulumi.Output<string | undefined>;
27
34
 
28
35
  /**
@@ -38,6 +45,7 @@ export class SvelteKitSite extends pulumi.ComponentResource {
38
45
  if (!opts.id) {
39
46
  resourceInputs["domain"] = args?.domain;
40
47
  resourceInputs["environment"] = args?.environment;
48
+ resourceInputs["originProtection"] = args?.originProtection;
41
49
  resourceInputs["path"] = args?.path;
42
50
  resourceInputs["runtimeEnvironment"] = args?.runtimeEnvironment;
43
51
  resourceInputs["transform"] = args?.transform;
@@ -45,12 +53,14 @@ export class SvelteKitSite extends pulumi.ComponentResource {
45
53
  resourceInputs["cloudFrontDistributionId"] = undefined /*out*/;
46
54
  resourceInputs["dnsRecords"] = undefined /*out*/;
47
55
  resourceInputs["functionName"] = undefined /*out*/;
56
+ resourceInputs["originSecret"] = undefined /*out*/;
48
57
  resourceInputs["url"] = undefined /*out*/;
49
58
  } else {
50
59
  resourceInputs["bucketName"] = undefined /*out*/;
51
60
  resourceInputs["cloudFrontDistributionId"] = undefined /*out*/;
52
61
  resourceInputs["dnsRecords"] = undefined /*out*/;
53
62
  resourceInputs["functionName"] = undefined /*out*/;
63
+ resourceInputs["originSecret"] = undefined /*out*/;
54
64
  resourceInputs["url"] = undefined /*out*/;
55
65
  }
56
66
  opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
@@ -67,6 +77,10 @@ export interface SvelteKitSiteArgs {
67
77
  * Environment vars available at BOTH build time and runtime. Values must be string literals since they're needed before the build runs.
68
78
  */
69
79
  environment?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
80
+ /**
81
+ * OriginProtection enables WAF-based origin protection. When set, a WAF WebACL is created that blocks requests missing the x-origin-secret header. The secret value is output as originSecret. Requires domain to be set.
82
+ */
83
+ originProtection?: pulumi.Input<inputs.aws.SiteOriginProtectionArgs>;
70
84
  path?: pulumi.Input<string>;
71
85
  /**
72
86
  * Runtime-only environment vars set on the Lambda function. Supports Pulumi Output values (e.g. bucket.name, fn.arn). Only available at request time, NOT during build/prerendering.
@@ -8,7 +8,7 @@ import * as enums from "../types/enums";
8
8
  import * as utilities from "../utilities";
9
9
 
10
10
  /**
11
- * An Anvil-managed AWS Interface VPC Endpoint. Creates one ENI per private subnet with private DNS enabled — standard AWS service hostnames resolve to ENI IPs inside the VPC automatically. Includes a dedicated security group with zero rules by default. Use grantEndpointAccess on compute resources to open the network path. IAM permissions are managed separately via grantPermissions.
11
+ * An Anvil-managed AWS Interface VPC Endpoint. Creates one ENI per private subnet with private DNS enabled. The endpoint security group uses a self-referencing ingress rule on port 443 only compute resources that have been explicitly granted access can reach the endpoint at the network layer. Access is enforced at three layers: network (self-referencing SG), IAM role policy (scoped per compute resource), and endpoint policy (blanket ceiling on allowed actions for all compute principals — Lambda, ECS, EC2).
12
12
  */
13
13
  export class VpcEndpoint extends pulumi.ComponentResource {
14
14
  /** @internal */
@@ -26,7 +26,7 @@ export class VpcEndpoint extends pulumi.ComponentResource {
26
26
  }
27
27
 
28
28
  /**
29
- * The first DNS name assigned to the endpoint, e.g. vpce-xxx.ssm.ap-southeast-2.vpce.amazonaws.com. With private DNS enabled, normal consumers use the standard AWS SDK hostname — this is exposed for debugging and multi-VPC architectures only.
29
+ * The first DNS name assigned to the endpoint, e.g. vpce-xxx.sqs.ap-southeast-2.vpce.amazonaws.com. With private DNS enabled, normal consumers use the standard AWS SDK hostname — this is exposed for debugging and multi-VPC architectures only.
30
30
  */
31
31
  declare public /*out*/ readonly dnsName: pulumi.Output<string>;
32
32
  /**
@@ -34,7 +34,7 @@ export class VpcEndpoint extends pulumi.ComponentResource {
34
34
  */
35
35
  declare public /*out*/ readonly endpointId: pulumi.Output<string>;
36
36
  /**
37
- * The ID of the dedicated security group attached to this endpoint. Zero rules by default. Ingress rules are added when compute resources call grantEndpointAccess.
37
+ * The ID of the dedicated security group attached to this endpoint. Uses a self-referencing ingress rule on port 443 only compute resources with this SG explicitly attached can reach the endpoint at the network layer.
38
38
  */
39
39
  declare public /*out*/ readonly securityGroupId: pulumi.Output<string>;
40
40
 
@@ -58,6 +58,7 @@ export class VpcEndpoint extends pulumi.ComponentResource {
58
58
  if (args?.vpcId === undefined && !opts.urn) {
59
59
  throw new Error("Missing required property 'vpcId'");
60
60
  }
61
+ resourceInputs["overridePermissions"] = args?.overridePermissions;
61
62
  resourceInputs["privateSubnetIds"] = args?.privateSubnetIds;
62
63
  resourceInputs["service"] = args?.service;
63
64
  resourceInputs["vpcId"] = args?.vpcId;
@@ -78,6 +79,10 @@ export class VpcEndpoint extends pulumi.ComponentResource {
78
79
  * The set of arguments for constructing a VpcEndpoint resource.
79
80
  */
80
81
  export interface VpcEndpointArgs {
82
+ /**
83
+ * Explicit Allow and Deny permission statements for the endpoint policy. When omitted, the endpoint policy allows all actions (*) for all Anvil compute principals (Lambda, ECS, EC2). When set, only the declared actions are permitted — the caller is responsible for declaring every action their compute resources need. Supports both Allow and Deny effects. Resource defaults to "*" if omitted on a permission entry.
84
+ */
85
+ overridePermissions?: pulumi.Input<pulumi.Input<inputs.aws.VpcEndpointPermissionArgs>[]>;
81
86
  /**
82
87
  * The IDs of the private subnets to attach the endpoint to. AWS places one ENI per subnet. Pass all private subnet IDs from your VPC — typically one per AZ.
83
88
  */
@@ -85,7 +90,7 @@ export interface VpcEndpointArgs {
85
90
  /**
86
91
  * The AWS service to route privately. The full com.amazonaws.{region}.{service} name is constructed at deploy time from the resolved region — you never write it manually.
87
92
  */
88
- service: pulumi.Input<enums.aws.AwsVpcEndpointService>;
93
+ service: pulumi.Input<string>;
89
94
  /**
90
95
  * The ID of the VPC to create the endpoint in. Accepts both Anvil-managed VPC IDs and imported VPC IDs.
91
96
  */
@@ -0,0 +1,36 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ /**
3
+ * An Anvil-managed JWT authorizer backed by a Cognito user pool. Derives the issuer URL automatically from the user pool ID — no manual Cognito endpoint construction required. Creates a native API Gateway JWT authorizer; verification is handled entirely by API Gateway with no Lambda or custom code. Pass authorizerId to HttpApi defaultAuthorizerId to protect your API routes.
4
+ */
5
+ export declare class CognitoAuth extends pulumi.ComponentResource {
6
+ /**
7
+ * Returns true if the given object is an instance of CognitoAuth. This is designed to work even
8
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
9
+ */
10
+ static isInstance(obj: any): obj is CognitoAuth;
11
+ /**
12
+ * The API Gateway authorizer ID. Pass this to HttpApi defaultAuthorizerId to protect your API routes.
13
+ */
14
+ readonly authorizerId: pulumi.Output<string>;
15
+ /**
16
+ * Create a CognitoAuth resource with the given unique name, arguments, and options.
17
+ *
18
+ * @param name The _unique_ name of the resource.
19
+ * @param args The arguments to use to populate this resource's properties.
20
+ * @param opts A bag of options that control this resource's behavior.
21
+ */
22
+ constructor(name: string, args: CognitoAuthArgs, opts?: pulumi.ComponentResourceOptions);
23
+ }
24
+ /**
25
+ * The set of arguments for constructing a CognitoAuth resource.
26
+ */
27
+ export interface CognitoAuthArgs {
28
+ /**
29
+ * The Cognito app client IDs allowed to access this API. API Gateway rejects tokens whose 'aud' claim does not match one of these values. Pass your Cognito app client ID(s) here.
30
+ */
31
+ audience: pulumi.Input<pulumi.Input<string>[]>;
32
+ /**
33
+ * The Cognito user pool ID. Pass pool.userPoolId directly. Accepts Output<string>. Anvil derives the issuer URL automatically: https://cognito-idp.{region}.amazonaws.com/{userPoolId}.
34
+ */
35
+ userPoolId: any;
36
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CognitoAuth = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ /**
9
+ * An Anvil-managed JWT authorizer backed by a Cognito user pool. Derives the issuer URL automatically from the user pool ID — no manual Cognito endpoint construction required. Creates a native API Gateway JWT authorizer; verification is handled entirely by API Gateway with no Lambda or custom code. Pass authorizerId to HttpApi defaultAuthorizerId to protect your API routes.
10
+ */
11
+ class CognitoAuth extends pulumi.ComponentResource {
12
+ /**
13
+ * Returns true if the given object is an instance of CognitoAuth. This is designed to work even
14
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
15
+ */
16
+ static isInstance(obj) {
17
+ if (obj === undefined || obj === null) {
18
+ return false;
19
+ }
20
+ return obj['__pulumiType'] === CognitoAuth.__pulumiType;
21
+ }
22
+ /**
23
+ * Create a CognitoAuth resource with the given unique name, arguments, and options.
24
+ *
25
+ * @param name The _unique_ name of the resource.
26
+ * @param args The arguments to use to populate this resource's properties.
27
+ * @param opts A bag of options that control this resource's behavior.
28
+ */
29
+ constructor(name, args, opts) {
30
+ let resourceInputs = {};
31
+ opts = opts || {};
32
+ if (!opts.id) {
33
+ if (args?.audience === undefined && !opts.urn) {
34
+ throw new Error("Missing required property 'audience'");
35
+ }
36
+ if (args?.userPoolId === undefined && !opts.urn) {
37
+ throw new Error("Missing required property 'userPoolId'");
38
+ }
39
+ resourceInputs["audience"] = args?.audience;
40
+ resourceInputs["userPoolId"] = args?.userPoolId;
41
+ resourceInputs["authorizerId"] = undefined /*out*/;
42
+ }
43
+ else {
44
+ resourceInputs["authorizerId"] = undefined /*out*/;
45
+ }
46
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
47
+ super(CognitoAuth.__pulumiType, name, resourceInputs, opts, true /*remote*/);
48
+ }
49
+ }
50
+ exports.CognitoAuth = CognitoAuth;
51
+ /** @internal */
52
+ CognitoAuth.__pulumiType = 'anvil:aws:CognitoAuth';
53
+ //# sourceMappingURL=cognitoAuth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cognitoAuth.js","sourceRoot":"","sources":["../../aws/cognitoAuth.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,0CAA0C;AAE1C;;GAEG;AACH,MAAa,WAAY,SAAQ,MAAM,CAAC,iBAAiB;IAIrD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,WAAW,CAAC,YAAY,CAAC;IAC5D,CAAC;IAOD;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAqB,EAAE,IAAsC;QACnF,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;YACV,IAAI,IAAI,EAAE,QAAQ,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC3C,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;aAC3D;YACD,IAAI,IAAI,EAAE,UAAU,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC7C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;aAC7D;YACD,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,EAAE,QAAQ,CAAC;YAC5C,cAAc,CAAC,YAAY,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC;YAChD,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SACtD;aAAM;YACH,cAAc,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;SACtD;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjF,CAAC;;AA7CL,kCA8CC;AA7CG,gBAAgB;AACO,wBAAY,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,82 @@
1
+ import * as pulumi from "@pulumi/pulumi";
2
+ import * as inputs from "../types/input";
3
+ /**
4
+ * An Anvil-managed Cognito user pool. Tier 1 controls (deletion protection, enforced password policy, account recovery via email) are always on. Pair with CognitoAuth to protect API Gateway routes.
5
+ */
6
+ export declare class CognitoUserPool extends pulumi.ComponentResource {
7
+ /**
8
+ * Returns true if the given object is an instance of CognitoUserPool. This is designed to work even
9
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
10
+ */
11
+ static isInstance(obj: any): obj is CognitoUserPool;
12
+ /**
13
+ * The ID of the default app client. Pass to CognitoAuth audience.
14
+ */
15
+ readonly appClientId: pulumi.Output<string>;
16
+ /**
17
+ * The client secret of the default app client. Only populated when appClient.generateSecret is true. Treat as sensitive.
18
+ */
19
+ readonly appClientSecret: pulumi.Output<string | undefined>;
20
+ /**
21
+ * The CloudFront distribution domain for the custom hosted UI. Only populated when hostedUi.customDomain is true. Create a Route53 alias record pointing hostedUi.domain to this value to complete DNS setup. Empty string for Cognito-managed domains.
22
+ */
23
+ readonly cloudFrontDomain: pulumi.Output<string>;
24
+ /**
25
+ * The Cognito OIDC issuer URL. Format: https://cognito-idp.{region}.amazonaws.com/{userPoolId}. Pass directly to CognitoAuth if building the authorizer manually.
26
+ */
27
+ readonly endpoint: pulumi.Output<string>;
28
+ /**
29
+ * The full hosted UI domain (e.g. https://auth.myapp.com or https://myprefix.auth.us-east-1.amazoncognito.com). Empty string if hostedUi is not configured.
30
+ */
31
+ readonly hostedUiDomain: pulumi.Output<string>;
32
+ /**
33
+ * The ARN of the Cognito user pool.
34
+ */
35
+ readonly userPoolArn: pulumi.Output<string>;
36
+ /**
37
+ * The Cognito user pool ID. Pass to CognitoAuth.userPoolId.
38
+ */
39
+ readonly userPoolId: pulumi.Output<string>;
40
+ /**
41
+ * Create a CognitoUserPool resource with the given unique name, arguments, and options.
42
+ *
43
+ * @param name The _unique_ name of the resource.
44
+ * @param args The arguments to use to populate this resource's properties.
45
+ * @param opts A bag of options that control this resource's behavior.
46
+ */
47
+ constructor(name: string, args?: CognitoUserPoolArgs, opts?: pulumi.ComponentResourceOptions);
48
+ }
49
+ /**
50
+ * The set of arguments for constructing a CognitoUserPool resource.
51
+ */
52
+ export interface CognitoUserPoolArgs {
53
+ /**
54
+ * Default app client created with the user pool. Covers the 80% case of one application per pool. Use transform for additional clients.
55
+ */
56
+ appClient?: pulumi.Input<inputs.aws.CognitoUserPoolAppClientArgs>;
57
+ /**
58
+ * User attribute configuration. Controls sign-in identifiers and required attributes on sign-up.
59
+ */
60
+ attributes?: pulumi.Input<inputs.aws.CognitoUserPoolAttributesArgs>;
61
+ /**
62
+ * Email delivery configuration. Default: Cognito-managed email (5 emails/day limit). Set sesFromAddress for SES delivery in production.
63
+ */
64
+ emailConfiguration?: pulumi.Input<inputs.aws.CognitoUserPoolEmailConfigurationArgs>;
65
+ /**
66
+ * Hosted UI / Managed Login configuration. Omit to use the Cognito user pools API directly without a hosted sign-in page.
67
+ */
68
+ hostedUi?: pulumi.Input<inputs.aws.CognitoUserPoolHostedUiArgs>;
69
+ /**
70
+ * External identity providers to federate with this user pool. Supports Google, Facebook, LoginWithAmazon, SignInWithApple, OIDC, and SAML. Schema never changes per provider — add new providers by extending this array.
71
+ */
72
+ identityProviders?: pulumi.Input<pulumi.Input<inputs.aws.CognitoUserPoolIdentityProviderArgs>[]>;
73
+ /**
74
+ * MFA configuration. TOTP requires no additional AWS resources. SMS requires an SNS caller ARN.
75
+ */
76
+ mfa?: pulumi.Input<inputs.aws.CognitoUserPoolMfaArgs>;
77
+ /**
78
+ * Password policy for the user pool. Anvil enforces a secure baseline by default — override only to strengthen.
79
+ */
80
+ passwordPolicy?: pulumi.Input<inputs.aws.CognitoUserPoolPasswordPolicyArgs>;
81
+ transform?: pulumi.Input<inputs.aws.CognitoUserPoolTransformArgsArgs>;
82
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.CognitoUserPool = void 0;
6
+ const pulumi = require("@pulumi/pulumi");
7
+ const utilities = require("../utilities");
8
+ /**
9
+ * An Anvil-managed Cognito user pool. Tier 1 controls (deletion protection, enforced password policy, account recovery via email) are always on. Pair with CognitoAuth to protect API Gateway routes.
10
+ */
11
+ class CognitoUserPool extends pulumi.ComponentResource {
12
+ /**
13
+ * Returns true if the given object is an instance of CognitoUserPool. This is designed to work even
14
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
15
+ */
16
+ static isInstance(obj) {
17
+ if (obj === undefined || obj === null) {
18
+ return false;
19
+ }
20
+ return obj['__pulumiType'] === CognitoUserPool.__pulumiType;
21
+ }
22
+ /**
23
+ * Create a CognitoUserPool resource with the given unique name, arguments, and options.
24
+ *
25
+ * @param name The _unique_ name of the resource.
26
+ * @param args The arguments to use to populate this resource's properties.
27
+ * @param opts A bag of options that control this resource's behavior.
28
+ */
29
+ constructor(name, args, opts) {
30
+ let resourceInputs = {};
31
+ opts = opts || {};
32
+ if (!opts.id) {
33
+ resourceInputs["appClient"] = args?.appClient;
34
+ resourceInputs["attributes"] = args?.attributes;
35
+ resourceInputs["emailConfiguration"] = args?.emailConfiguration;
36
+ resourceInputs["hostedUi"] = args?.hostedUi;
37
+ resourceInputs["identityProviders"] = args?.identityProviders;
38
+ resourceInputs["mfa"] = args?.mfa;
39
+ resourceInputs["passwordPolicy"] = args?.passwordPolicy;
40
+ resourceInputs["transform"] = args?.transform;
41
+ resourceInputs["appClientId"] = undefined /*out*/;
42
+ resourceInputs["appClientSecret"] = undefined /*out*/;
43
+ resourceInputs["cloudFrontDomain"] = undefined /*out*/;
44
+ resourceInputs["endpoint"] = undefined /*out*/;
45
+ resourceInputs["hostedUiDomain"] = undefined /*out*/;
46
+ resourceInputs["userPoolArn"] = undefined /*out*/;
47
+ resourceInputs["userPoolId"] = undefined /*out*/;
48
+ }
49
+ else {
50
+ resourceInputs["appClientId"] = undefined /*out*/;
51
+ resourceInputs["appClientSecret"] = undefined /*out*/;
52
+ resourceInputs["cloudFrontDomain"] = undefined /*out*/;
53
+ resourceInputs["endpoint"] = undefined /*out*/;
54
+ resourceInputs["hostedUiDomain"] = undefined /*out*/;
55
+ resourceInputs["userPoolArn"] = undefined /*out*/;
56
+ resourceInputs["userPoolId"] = undefined /*out*/;
57
+ }
58
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
59
+ super(CognitoUserPool.__pulumiType, name, resourceInputs, opts, true /*remote*/);
60
+ }
61
+ }
62
+ exports.CognitoUserPool = CognitoUserPool;
63
+ /** @internal */
64
+ CognitoUserPool.__pulumiType = 'anvil:aws:CognitoUserPool';
65
+ //# sourceMappingURL=cognitoUser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