@mstuercke/pulumi-modules 1.2.3 → 1.3.0

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 (45) hide show
  1. package/dist/clerk/Clerk.d.ts +27 -0
  2. package/dist/clerk/Clerk.js +88 -0
  3. package/dist/clerk/index.d.ts +5 -0
  4. package/dist/clerk/index.js +5 -0
  5. package/dist/domain/getDomain.js +7 -2
  6. package/dist/index.d.ts +4 -0
  7. package/dist/index.js +3 -0
  8. package/package.json +24 -6
  9. package/sdks/clerk/.gitattributes +1 -0
  10. package/sdks/clerk/README.md +3 -0
  11. package/sdks/clerk/allowlistIdentifier.ts +121 -0
  12. package/sdks/clerk/apiKey.ts +254 -0
  13. package/sdks/clerk/application.ts +182 -0
  14. package/sdks/clerk/applicationSettings.ts +171 -0
  15. package/sdks/clerk/blocklistIdentifier.ts +114 -0
  16. package/sdks/clerk/config/index.ts +5 -0
  17. package/sdks/clerk/config/vars.ts +34 -0
  18. package/sdks/clerk/domain.ts +154 -0
  19. package/sdks/clerk/getApplication.ts +42 -0
  20. package/sdks/clerk/index.ts +213 -0
  21. package/sdks/clerk/instanceConfig.ts +128 -0
  22. package/sdks/clerk/instanceDomain.ts +129 -0
  23. package/sdks/clerk/jwtTemplate.ts +190 -0
  24. package/sdks/clerk/machine.ts +127 -0
  25. package/sdks/clerk/oauthApplication.ts +228 -0
  26. package/sdks/clerk/organization.ts +190 -0
  27. package/sdks/clerk/organizationDomain.ts +166 -0
  28. package/sdks/clerk/organizationMembership.ts +148 -0
  29. package/sdks/clerk/organizationPermission.ts +142 -0
  30. package/sdks/clerk/organizationRole.ts +156 -0
  31. package/sdks/clerk/package.json +26 -0
  32. package/sdks/clerk/provider.ts +76 -0
  33. package/sdks/clerk/redirectUrl.ts +104 -0
  34. package/sdks/clerk/roleSet.ts +197 -0
  35. package/sdks/clerk/samlConnection.ts +361 -0
  36. package/sdks/clerk/scripts/postinstall.js +20 -0
  37. package/sdks/clerk/svixWebhook.ts +77 -0
  38. package/sdks/clerk/tsconfig.json +53 -0
  39. package/sdks/clerk/types/index.ts +13 -0
  40. package/sdks/clerk/types/input.ts +59 -0
  41. package/sdks/clerk/types/output.ts +79 -0
  42. package/sdks/clerk/user.ts +458 -0
  43. package/sdks/clerk/utilities.ts +107 -0
  44. package/dist/mongodb/MongoDB.d.ts +0 -18
  45. package/dist/mongodb/MongoDB.js +0 -77
@@ -0,0 +1,27 @@
1
+ import { ComponentResource, type ComponentResourceOptions, type Output } from '@pulumi/pulumi';
2
+ export type ClerkURL = `http://${string}` | `https://${string}`;
3
+ export type ClerkUser = {
4
+ name: string;
5
+ email: string;
6
+ password: string;
7
+ emailVerified: boolean;
8
+ appMetadata?: Record<string, unknown>;
9
+ };
10
+ export type ClerkArgs = {
11
+ projectId: string;
12
+ environmentName: string;
13
+ allowedUrls: ClerkURL[];
14
+ platformApiKey: string;
15
+ displayName?: string;
16
+ allowedRedirectUrls?: ClerkURL[];
17
+ nativeAppId?: string;
18
+ defaultUsers?: ClerkUser[];
19
+ disableSignup?: boolean;
20
+ };
21
+ export declare class Clerk extends ComponentResource {
22
+ applicationId: Output<string>;
23
+ instanceId: Output<string>;
24
+ publishableKey: Output<string>;
25
+ secretKey: Output<string>;
26
+ constructor(name: string, args: ClerkArgs, opts?: ComponentResourceOptions);
27
+ }
@@ -0,0 +1,88 @@
1
+ import { ComponentResource, secret } from '@pulumi/pulumi';
2
+ import { Application, InstanceConfig, Provider, RedirectUrl, User } from '@pulumi/clerk';
3
+ const getClerkAllowedOrigins = (allowedUrls) => {
4
+ const origins = [];
5
+ for (const allowedUrl of allowedUrls) {
6
+ origins.push(new URL(allowedUrl).origin);
7
+ }
8
+ return origins;
9
+ };
10
+ const getClerkRedirectUrls = (allowedUrls, allowedRedirectUrls, nativeAppId) => {
11
+ const redirectUrls = [...(allowedRedirectUrls ?? allowedUrls)];
12
+ if (nativeAppId) {
13
+ redirectUrls.push(`${nativeAppId}://oauth-callback`);
14
+ }
15
+ return redirectUrls;
16
+ };
17
+ const getClerkUserNames = (name) => {
18
+ const [firstName, ...lastNameParts] = name.split(' ');
19
+ return {
20
+ firstName: firstName || name,
21
+ lastName: lastNameParts.length > 0 ? lastNameParts.join(' ') : undefined,
22
+ };
23
+ };
24
+ export class Clerk extends ComponentResource {
25
+ applicationId;
26
+ instanceId;
27
+ publishableKey;
28
+ secretKey;
29
+ constructor(name, args, opts) {
30
+ super('mstuercke:clerk:Clerk', name, undefined, opts);
31
+ const { projectId, environmentName, allowedUrls, platformApiKey, displayName = `${projectId}-${environmentName}`, allowedRedirectUrls, nativeAppId, defaultUsers = [], disableSignup = false, } = args;
32
+ const environmentType = environmentName === 'prod' ? 'production' : 'development';
33
+ const platformProvider = new Provider(`${name}-platform`, { platformApiKey }, { parent: this });
34
+ const application = new Application(name, {
35
+ name: displayName,
36
+ environmentTypes: [environmentType],
37
+ }, { parent: this, provider: platformProvider });
38
+ const instance = application.instances.apply((instances) => {
39
+ const matchingInstance = instances.find((item) => item.environmentType === environmentType);
40
+ const selectedInstance = matchingInstance ?? instances[0];
41
+ if (!selectedInstance) {
42
+ throw new Error(`Clerk application ${displayName} has no instances`);
43
+ }
44
+ return selectedInstance;
45
+ });
46
+ const instanceProvider = new Provider(`${name}-instance`, {
47
+ platformApiKey,
48
+ apiKey: instance.apply((item) => item.secretKey),
49
+ }, { parent: this });
50
+ new InstanceConfig(name, {
51
+ applicationId: application.id,
52
+ instanceId: instance.apply((item) => item.instanceId),
53
+ config: JSON.stringify({
54
+ auth_email: {
55
+ used_for_sign_up: true,
56
+ used_for_sign_in: true,
57
+ },
58
+ auth_password: {
59
+ required: true,
60
+ },
61
+ hibp: true,
62
+ sign_up_mode: disableSignup ? 'restricted' : 'public',
63
+ allowed_origins: getClerkAllowedOrigins(allowedUrls),
64
+ ...(environmentType === 'development' ? { url_based_session_syncing: true } : {}),
65
+ }),
66
+ }, { parent: this, provider: platformProvider });
67
+ const redirectUrls = getClerkRedirectUrls(allowedUrls, allowedRedirectUrls, nativeAppId);
68
+ for (const [index, url] of redirectUrls.entries()) {
69
+ new RedirectUrl(`${name}-redirect-${index}`, { url }, { parent: this, provider: instanceProvider });
70
+ }
71
+ for (const defaultUser of defaultUsers) {
72
+ const { firstName, lastName } = getClerkUserNames(defaultUser.name);
73
+ new User(`default-user-${defaultUser.email}`, {
74
+ emailAddresses: [defaultUser.email],
75
+ password: defaultUser.password,
76
+ firstName,
77
+ lastName,
78
+ skipLegalChecks: true,
79
+ skipPasswordChecks: true,
80
+ publicMetadata: defaultUser.appMetadata ? JSON.stringify(defaultUser.appMetadata) : undefined,
81
+ }, { parent: this, provider: instanceProvider });
82
+ }
83
+ this.applicationId = application.id;
84
+ this.instanceId = instance.apply((item) => item.instanceId);
85
+ this.publishableKey = instance.apply((item) => item.publishableKey);
86
+ this.secretKey = secret(instance.apply((item) => item.secretKey));
87
+ }
88
+ }
@@ -0,0 +1,5 @@
1
+ import { Clerk } from './Clerk.ts';
2
+ export * from './Clerk.ts';
3
+ export declare const clerk: {
4
+ Clerk: typeof Clerk;
5
+ };
@@ -0,0 +1,5 @@
1
+ import { Clerk } from "./Clerk.js";
2
+ export * from "./Clerk.js";
3
+ export const clerk = {
4
+ Clerk,
5
+ };
@@ -2,8 +2,13 @@ import { acm, route53 } from '@pulumi/aws';
2
2
  export const getDomain = async (options) => {
3
3
  const { usEast1Provider, name } = options;
4
4
  const zone = await route53.getZone({ name });
5
- const euCentral1Certificate = await acm.getCertificate({ domain: name });
6
- const usEast1Certificate = await acm.getCertificate({ domain: name }, { provider: usEast1Provider });
5
+ const certificateArgs = {
6
+ domain: name,
7
+ mostRecent: true,
8
+ statuses: ['PENDING_VALIDATION', 'ISSUED', 'INACTIVE', 'EXPIRED', 'VALIDATION_TIMED_OUT', 'REVOKED', 'FAILED'],
9
+ };
10
+ const euCentral1Certificate = await acm.getCertificate(certificateArgs);
11
+ const usEast1Certificate = await acm.getCertificate(certificateArgs, { provider: usEast1Provider });
7
12
  return {
8
13
  name: zone.name,
9
14
  zoneId: zone.zoneId,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './auth0/index.ts';
2
+ export * from './clerk/index.ts';
2
3
  export * from './domain/index.ts';
3
4
  export * from './iam/index.ts';
4
5
  export * from './lambda/index.ts';
@@ -12,6 +13,9 @@ export declare const mstuercke: {
12
13
  auth0: {
13
14
  Auth0: typeof import("./auth0/Auth0.ts").Auth0;
14
15
  };
16
+ clerk: {
17
+ Clerk: typeof import("./clerk/Clerk.ts").Clerk;
18
+ };
15
19
  domain: {
16
20
  getDomain: (options: import("./domain/getDomain.ts").DataDomainOptions) => Promise<import("./domain/getDomain.ts").DomainResult>;
17
21
  };
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { auth0 } from "./auth0/index.js";
2
+ import { clerk } from "./clerk/index.js";
2
3
  import { domain } from "./domain/index.js";
3
4
  import { iam } from "./iam/index.js";
4
5
  import { rest } from "./rest/index.js";
@@ -9,6 +10,7 @@ import { s3 } from "./s3/index.js";
9
10
  import { website } from "./website/index.js";
10
11
  import { websocket } from "./websocket/index.js";
11
12
  export * from "./auth0/index.js";
13
+ export * from "./clerk/index.js";
12
14
  export * from "./domain/index.js";
13
15
  export * from "./iam/index.js";
14
16
  export * from "./lambda/index.js";
@@ -20,6 +22,7 @@ export * from "./website/index.js";
20
22
  export * from "./websocket/index.js";
21
23
  export const mstuercke = {
22
24
  auth0,
25
+ clerk,
23
26
  domain,
24
27
  iam,
25
28
  lambda,
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@mstuercke/pulumi-modules",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "files": [
5
5
  "dist/**/!(*.test|*.fixture){.d.ts,.js}",
6
+ "sdks/clerk/**",
6
7
  "README.md"
7
8
  ],
8
9
  "type": "module",
@@ -11,15 +12,18 @@
11
12
  "types": "./dist/index.d.ts"
12
13
  },
13
14
  "scripts": {
14
- "typeCheck": "tsc --noEmit",
15
- "build": "tsc -p tsconfig.build.json",
16
- "release": "node --no-warnings --import ts-node/esm scripts/release.ts"
15
+ "typeCheck": "node sdks/clerk/scripts/postinstall.js && tsc --noEmit",
16
+ "build": "node sdks/clerk/scripts/postinstall.js && tsc -p tsconfig.build.json",
17
+ "lint": "biome check && eslint . --max-warnings 0 --no-error-on-unmatched-pattern",
18
+ "lint:fix": "biome check --fix && eslint . --fix --max-warnings 0 --no-error-on-unmatched-pattern",
19
+ "prepack": "pnpm run build"
17
20
  },
18
21
  "dependencies": {
19
22
  "@mstuercke/pulumi-neon": "1.0.0",
20
- "@pulumi/archive": "^0.3.0",
23
+ "@pulumi/archive": "^0.5.0",
21
24
  "@pulumi/auth0": "^3.8.1",
22
25
  "@pulumi/aws": "^7.0.0",
26
+ "@pulumi/clerk": "link:sdks/clerk",
23
27
  "@pulumi/mongodbatlas": "^4.0.0",
24
28
  "@pulumi/pulumi": "^3.142.0",
25
29
  "@pulumi/random": "^4.16.7",
@@ -29,10 +33,24 @@
29
33
  "mime": "^3.0.0"
30
34
  },
31
35
  "devDependencies": {
32
- "@mstuercke/node-utils": "0.0.3",
36
+ "@biomejs/biome": "^2.0.6",
37
+ "@mstuercke/biome-config": "0.1.0",
38
+ "@mstuercke/eslint-config": "1.3.0",
39
+ "@mstuercke/typescript-config": "3.1.0",
40
+ "@types/node": "^24.1.0",
41
+ "eslint": "^8.57.1",
42
+ "semantic-release": "^25.0.0",
33
43
  "typescript": "^6.0.0"
34
44
  },
35
45
  "publishConfig": {
36
46
  "registry": "https://registry.npmjs.org/"
47
+ },
48
+ "packageManager": "pnpm@11.25.0",
49
+ "engines": {
50
+ "node": ">=24.0.0"
51
+ },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+ssh://git@github.com/mstuercke/pulumi-modules.git"
37
55
  }
38
56
  }
@@ -0,0 +1 @@
1
+ * linguist-generated
@@ -0,0 +1,3 @@
1
+ > This provider is a derived work of the [Terraform Provider](https://github.com/buildwithdeck/terraform-provider-clerk)
2
+ > distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,
3
+ > please consult the source [`terraform-provider-clerk` repo](https://github.com/buildwithdeck/terraform-provider-clerk/issues).
@@ -0,0 +1,121 @@
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
+ export class AllowlistIdentifier extends pulumi.CustomResource {
8
+ /**
9
+ * Get an existing AllowlistIdentifier resource's state with the given name, ID, and optional extra
10
+ * properties used to qualify the lookup.
11
+ *
12
+ * @param name The _unique_ name of the resulting resource.
13
+ * @param id The _unique_ provider ID of the resource to lookup.
14
+ * @param state Any extra arguments used during the lookup.
15
+ * @param opts Optional settings to control the behavior of the CustomResource.
16
+ */
17
+ public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AllowlistIdentifierState, opts?: pulumi.CustomResourceOptions): AllowlistIdentifier {
18
+ return new AllowlistIdentifier(name, <any>state, { ...opts, id: id });
19
+ }
20
+
21
+ /** @internal */
22
+ public static readonly __pulumiType = 'clerk:index/allowlistIdentifier:AllowlistIdentifier';
23
+
24
+ /**
25
+ * Returns true if the given object is an instance of AllowlistIdentifier. This is designed to work even
26
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
27
+ */
28
+ public static isInstance(obj: any): obj is AllowlistIdentifier {
29
+ if (obj === undefined || obj === null) {
30
+ return false;
31
+ }
32
+ return obj['__pulumiType'] === AllowlistIdentifier.__pulumiType;
33
+ }
34
+
35
+ /**
36
+ * Timestamp when the allowlist entry was created.
37
+ */
38
+ declare public /*out*/ readonly createdAt: pulumi.Output<string>;
39
+ /**
40
+ * The identifier to add to the allowlist. Can be an email address, phone number, or web3 wallet address. Supports wildcard
41
+ * patterns for email addresses (e.g. *@example.com).
42
+ */
43
+ declare public readonly identifier: pulumi.Output<string>;
44
+ /**
45
+ * Whether to send an invitation email to the identifier upon creation. Only applies to email address identifiers.
46
+ */
47
+ declare public readonly notify: pulumi.Output<boolean | undefined>;
48
+ /**
49
+ * Timestamp when the allowlist entry was last updated.
50
+ */
51
+ declare public /*out*/ readonly updatedAt: pulumi.Output<string>;
52
+
53
+ /**
54
+ * Create a AllowlistIdentifier 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: AllowlistIdentifierArgs, opts?: pulumi.CustomResourceOptions)
61
+ constructor(name: string, argsOrState?: AllowlistIdentifierArgs | AllowlistIdentifierState, opts?: pulumi.CustomResourceOptions) {
62
+ let resourceInputs: pulumi.Inputs = {};
63
+ opts = opts || {};
64
+ if (opts.id) {
65
+ const state = argsOrState as AllowlistIdentifierState | undefined;
66
+ resourceInputs["createdAt"] = state?.createdAt;
67
+ resourceInputs["identifier"] = state?.identifier;
68
+ resourceInputs["notify"] = state?.notify;
69
+ resourceInputs["updatedAt"] = state?.updatedAt;
70
+ } else {
71
+ const args = argsOrState as AllowlistIdentifierArgs | undefined;
72
+ if (args?.identifier === undefined && !opts.urn) {
73
+ throw new Error("Missing required property 'identifier'");
74
+ }
75
+ resourceInputs["identifier"] = args?.identifier;
76
+ resourceInputs["notify"] = args?.notify;
77
+ resourceInputs["createdAt"] = undefined /*out*/;
78
+ resourceInputs["updatedAt"] = undefined /*out*/;
79
+ }
80
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
81
+ super(AllowlistIdentifier.__pulumiType, name, resourceInputs, opts, false /*dependency*/, utilities.getPackage());
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Input properties used for looking up and filtering AllowlistIdentifier resources.
87
+ */
88
+ export interface AllowlistIdentifierState {
89
+ /**
90
+ * Timestamp when the allowlist entry was created.
91
+ */
92
+ createdAt?: pulumi.Input<string | undefined>;
93
+ /**
94
+ * The identifier to add to the allowlist. Can be an email address, phone number, or web3 wallet address. Supports wildcard
95
+ * patterns for email addresses (e.g. *@example.com).
96
+ */
97
+ identifier?: pulumi.Input<string | undefined>;
98
+ /**
99
+ * Whether to send an invitation email to the identifier upon creation. Only applies to email address identifiers.
100
+ */
101
+ notify?: pulumi.Input<boolean | undefined>;
102
+ /**
103
+ * Timestamp when the allowlist entry was last updated.
104
+ */
105
+ updatedAt?: pulumi.Input<string | undefined>;
106
+ }
107
+
108
+ /**
109
+ * The set of arguments for constructing a AllowlistIdentifier resource.
110
+ */
111
+ export interface AllowlistIdentifierArgs {
112
+ /**
113
+ * The identifier to add to the allowlist. Can be an email address, phone number, or web3 wallet address. Supports wildcard
114
+ * patterns for email addresses (e.g. *@example.com).
115
+ */
116
+ identifier: pulumi.Input<string>;
117
+ /**
118
+ * Whether to send an invitation email to the identifier upon creation. Only applies to email address identifiers.
119
+ */
120
+ notify?: pulumi.Input<boolean | undefined>;
121
+ }
@@ -0,0 +1,254 @@
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
+ export class ApiKey extends pulumi.CustomResource {
8
+ /**
9
+ * Get an existing ApiKey resource's state with the given name, ID, and optional extra
10
+ * properties used to qualify the lookup.
11
+ *
12
+ * @param name The _unique_ name of the resulting resource.
13
+ * @param id The _unique_ provider ID of the resource to lookup.
14
+ * @param state Any extra arguments used during the lookup.
15
+ * @param opts Optional settings to control the behavior of the CustomResource.
16
+ */
17
+ public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ApiKeyState, opts?: pulumi.CustomResourceOptions): ApiKey {
18
+ return new ApiKey(name, <any>state, { ...opts, id: id });
19
+ }
20
+
21
+ /** @internal */
22
+ public static readonly __pulumiType = 'clerk:index/apiKey:ApiKey';
23
+
24
+ /**
25
+ * Returns true if the given object is an instance of ApiKey. This is designed to work even
26
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
27
+ */
28
+ public static isInstance(obj: any): obj is ApiKey {
29
+ if (obj === undefined || obj === null) {
30
+ return false;
31
+ }
32
+ return obj['__pulumiType'] === ApiKey.__pulumiType;
33
+ }
34
+
35
+ /**
36
+ * JSON string of custom claims for the API key.
37
+ */
38
+ declare public readonly claims: pulumi.Output<string>;
39
+ /**
40
+ * Timestamp when the API key was created.
41
+ */
42
+ declare public /*out*/ readonly createdAt: pulumi.Output<string>;
43
+ /**
44
+ * Identifier of the entity that created the API key. Set on create only.
45
+ */
46
+ declare public readonly createdBy: pulumi.Output<string>;
47
+ /**
48
+ * Description of the API key.
49
+ */
50
+ declare public readonly description: pulumi.Output<string>;
51
+ /**
52
+ * Expiration timestamp in RFC3339 format.
53
+ */
54
+ declare public /*out*/ readonly expiration: pulumi.Output<string>;
55
+ /**
56
+ * Whether the API key has expired.
57
+ */
58
+ declare public /*out*/ readonly expired: pulumi.Output<boolean>;
59
+ /**
60
+ * Timestamp when the API key was last used, in RFC3339 format.
61
+ */
62
+ declare public /*out*/ readonly lastUsedAt: pulumi.Output<string>;
63
+ /**
64
+ * Name of the API key.
65
+ */
66
+ declare public readonly name: pulumi.Output<string>;
67
+ /**
68
+ * Whether the API key has been revoked.
69
+ */
70
+ declare public /*out*/ readonly revoked: pulumi.Output<boolean>;
71
+ /**
72
+ * List of scopes for the API key.
73
+ */
74
+ declare public readonly scopes: pulumi.Output<string[]>;
75
+ /**
76
+ * Number of seconds until the API key expires. Write-only: used on create/update, the API returns an expiration timestamp
77
+ * instead.
78
+ */
79
+ declare public readonly secondsUntilExpiration: pulumi.Output<number | undefined>;
80
+ /**
81
+ * The API key secret. Write-only: only returned on creation, not on subsequent reads.
82
+ */
83
+ declare public /*out*/ readonly secret: pulumi.Output<string>;
84
+ /**
85
+ * Subject of the API key.
86
+ */
87
+ declare public readonly subject: pulumi.Output<string>;
88
+ /**
89
+ * Type of the API key. Cannot be changed after creation.
90
+ */
91
+ declare public readonly type: pulumi.Output<string>;
92
+ /**
93
+ * Timestamp when the API key was last updated.
94
+ */
95
+ declare public /*out*/ readonly updatedAt: pulumi.Output<string>;
96
+
97
+ /**
98
+ * Create a ApiKey resource with the given unique name, arguments, and options.
99
+ *
100
+ * @param name The _unique_ name of the resource.
101
+ * @param args The arguments to use to populate this resource's properties.
102
+ * @param opts A bag of options that control this resource's behavior.
103
+ */
104
+ constructor(name: string, args?: ApiKeyArgs, opts?: pulumi.CustomResourceOptions)
105
+ constructor(name: string, argsOrState?: ApiKeyArgs | ApiKeyState, opts?: pulumi.CustomResourceOptions) {
106
+ let resourceInputs: pulumi.Inputs = {};
107
+ opts = opts || {};
108
+ if (opts.id) {
109
+ const state = argsOrState as ApiKeyState | undefined;
110
+ resourceInputs["claims"] = state?.claims;
111
+ resourceInputs["createdAt"] = state?.createdAt;
112
+ resourceInputs["createdBy"] = state?.createdBy;
113
+ resourceInputs["description"] = state?.description;
114
+ resourceInputs["expiration"] = state?.expiration;
115
+ resourceInputs["expired"] = state?.expired;
116
+ resourceInputs["lastUsedAt"] = state?.lastUsedAt;
117
+ resourceInputs["name"] = state?.name;
118
+ resourceInputs["revoked"] = state?.revoked;
119
+ resourceInputs["scopes"] = state?.scopes;
120
+ resourceInputs["secondsUntilExpiration"] = state?.secondsUntilExpiration;
121
+ resourceInputs["secret"] = state?.secret;
122
+ resourceInputs["subject"] = state?.subject;
123
+ resourceInputs["type"] = state?.type;
124
+ resourceInputs["updatedAt"] = state?.updatedAt;
125
+ } else {
126
+ const args = argsOrState as ApiKeyArgs | undefined;
127
+ resourceInputs["claims"] = args?.claims;
128
+ resourceInputs["createdBy"] = args?.createdBy;
129
+ resourceInputs["description"] = args?.description;
130
+ resourceInputs["name"] = args?.name;
131
+ resourceInputs["scopes"] = args?.scopes;
132
+ resourceInputs["secondsUntilExpiration"] = args?.secondsUntilExpiration;
133
+ resourceInputs["subject"] = args?.subject;
134
+ resourceInputs["type"] = args?.type;
135
+ resourceInputs["createdAt"] = undefined /*out*/;
136
+ resourceInputs["expiration"] = undefined /*out*/;
137
+ resourceInputs["expired"] = undefined /*out*/;
138
+ resourceInputs["lastUsedAt"] = undefined /*out*/;
139
+ resourceInputs["revoked"] = undefined /*out*/;
140
+ resourceInputs["secret"] = undefined /*out*/;
141
+ resourceInputs["updatedAt"] = undefined /*out*/;
142
+ }
143
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
144
+ const secretOpts = { additionalSecretOutputs: ["secret"] };
145
+ opts = pulumi.mergeOptions(opts, secretOpts);
146
+ super(ApiKey.__pulumiType, name, resourceInputs, opts, false /*dependency*/, utilities.getPackage());
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Input properties used for looking up and filtering ApiKey resources.
152
+ */
153
+ export interface ApiKeyState {
154
+ /**
155
+ * JSON string of custom claims for the API key.
156
+ */
157
+ claims?: pulumi.Input<string | undefined>;
158
+ /**
159
+ * Timestamp when the API key was created.
160
+ */
161
+ createdAt?: pulumi.Input<string | undefined>;
162
+ /**
163
+ * Identifier of the entity that created the API key. Set on create only.
164
+ */
165
+ createdBy?: pulumi.Input<string | undefined>;
166
+ /**
167
+ * Description of the API key.
168
+ */
169
+ description?: pulumi.Input<string | undefined>;
170
+ /**
171
+ * Expiration timestamp in RFC3339 format.
172
+ */
173
+ expiration?: pulumi.Input<string | undefined>;
174
+ /**
175
+ * Whether the API key has expired.
176
+ */
177
+ expired?: pulumi.Input<boolean | undefined>;
178
+ /**
179
+ * Timestamp when the API key was last used, in RFC3339 format.
180
+ */
181
+ lastUsedAt?: pulumi.Input<string | undefined>;
182
+ /**
183
+ * Name of the API key.
184
+ */
185
+ name?: pulumi.Input<string | undefined>;
186
+ /**
187
+ * Whether the API key has been revoked.
188
+ */
189
+ revoked?: pulumi.Input<boolean | undefined>;
190
+ /**
191
+ * List of scopes for the API key.
192
+ */
193
+ scopes?: pulumi.Input<pulumi.Input<string>[] | undefined>;
194
+ /**
195
+ * Number of seconds until the API key expires. Write-only: used on create/update, the API returns an expiration timestamp
196
+ * instead.
197
+ */
198
+ secondsUntilExpiration?: pulumi.Input<number | undefined>;
199
+ /**
200
+ * The API key secret. Write-only: only returned on creation, not on subsequent reads.
201
+ */
202
+ secret?: pulumi.Input<string | undefined>;
203
+ /**
204
+ * Subject of the API key.
205
+ */
206
+ subject?: pulumi.Input<string | undefined>;
207
+ /**
208
+ * Type of the API key. Cannot be changed after creation.
209
+ */
210
+ type?: pulumi.Input<string | undefined>;
211
+ /**
212
+ * Timestamp when the API key was last updated.
213
+ */
214
+ updatedAt?: pulumi.Input<string | undefined>;
215
+ }
216
+
217
+ /**
218
+ * The set of arguments for constructing a ApiKey resource.
219
+ */
220
+ export interface ApiKeyArgs {
221
+ /**
222
+ * JSON string of custom claims for the API key.
223
+ */
224
+ claims?: pulumi.Input<string | undefined>;
225
+ /**
226
+ * Identifier of the entity that created the API key. Set on create only.
227
+ */
228
+ createdBy?: pulumi.Input<string | undefined>;
229
+ /**
230
+ * Description of the API key.
231
+ */
232
+ description?: pulumi.Input<string | undefined>;
233
+ /**
234
+ * Name of the API key.
235
+ */
236
+ name?: pulumi.Input<string | undefined>;
237
+ /**
238
+ * List of scopes for the API key.
239
+ */
240
+ scopes?: pulumi.Input<pulumi.Input<string>[] | undefined>;
241
+ /**
242
+ * Number of seconds until the API key expires. Write-only: used on create/update, the API returns an expiration timestamp
243
+ * instead.
244
+ */
245
+ secondsUntilExpiration?: pulumi.Input<number | undefined>;
246
+ /**
247
+ * Subject of the API key.
248
+ */
249
+ subject?: pulumi.Input<string | undefined>;
250
+ /**
251
+ * Type of the API key. Cannot be changed after creation.
252
+ */
253
+ type?: pulumi.Input<string | undefined>;
254
+ }