@atensec/pulumi-thoth 0.1.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.
- package/.gitattributes +1 -0
- package/Pulumi.yaml +3 -0
- package/README.md +4 -0
- package/access/apiKey.ts +239 -0
- package/access/getApiKeyMetrics.ts +31 -0
- package/access/index.ts +30 -0
- package/browser/enrollment.ts +218 -0
- package/browser/index.ts +41 -0
- package/browser/policy.ts +256 -0
- package/browser/provider.ts +186 -0
- package/config/index.ts +5 -0
- package/config/vars.ts +119 -0
- package/governance/approvalDecision.ts +141 -0
- package/governance/getFeed.ts +102 -0
- package/governance/getTenantSettings.ts +33 -0
- package/governance/getTools.ts +52 -0
- package/governance/index.ts +72 -0
- package/governance/packAssignment.ts +213 -0
- package/governance/policySync.ts +233 -0
- package/governance/tenantSettings.ts +579 -0
- package/governance/webhookTest.ts +131 -0
- package/index.ts +34 -0
- package/mdm/getSyncJob.ts +53 -0
- package/mdm/index.ts +38 -0
- package/mdm/provider.ts +218 -0
- package/mdm/sync.ts +230 -0
- package/package.json +29 -0
- package/provider.ts +144 -0
- package/tsconfig.json +48 -0
- package/utilities.ts +96 -0
package/mdm/sync.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
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 Sync extends pulumi.CustomResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get an existing Sync 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?: SyncState, opts?: pulumi.CustomResourceOptions): Sync {
|
|
18
|
+
return new Sync(name, <any>state, { ...opts, id: id });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
public static readonly __pulumiType = 'thoth:mdm/sync:Sync';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Returns true if the given object is an instance of Sync. 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 Sync {
|
|
29
|
+
if (obj === undefined || obj === null) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return obj['__pulumiType'] === Sync.__pulumiType;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Job completion timestamp.
|
|
37
|
+
*/
|
|
38
|
+
declare public /*out*/ readonly completedAt: pulumi.Output<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Job creation timestamp.
|
|
41
|
+
*/
|
|
42
|
+
declare public /*out*/ readonly createdAt: pulumi.Output<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Job error string when status=failed.
|
|
45
|
+
*/
|
|
46
|
+
declare public /*out*/ readonly error: pulumi.Output<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Polling interval when wait_for_completion=true.
|
|
49
|
+
*/
|
|
50
|
+
declare public readonly pollIntervalSeconds: pulumi.Output<number | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* MDM provider slug.
|
|
53
|
+
*/
|
|
54
|
+
declare public readonly providerName: pulumi.Output<string>;
|
|
55
|
+
/**
|
|
56
|
+
* Job start timestamp.
|
|
57
|
+
*/
|
|
58
|
+
declare public /*out*/ readonly startedAt: pulumi.Output<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Job status: queued, running, succeeded, failed.
|
|
61
|
+
*/
|
|
62
|
+
declare public /*out*/ readonly status: pulumi.Output<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Number of endpoints synchronized by the job.
|
|
65
|
+
*/
|
|
66
|
+
declare public /*out*/ readonly syncedEndpoints: pulumi.Output<number>;
|
|
67
|
+
/**
|
|
68
|
+
* Tenant ID from provider configuration.
|
|
69
|
+
*/
|
|
70
|
+
declare public /*out*/ readonly tenantId: pulumi.Output<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Polling timeout when wait_for_completion=true.
|
|
73
|
+
*/
|
|
74
|
+
declare public readonly timeoutSeconds: pulumi.Output<number | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* Arbitrary replacement trigger value.
|
|
77
|
+
*/
|
|
78
|
+
declare public readonly trigger: pulumi.Output<string | undefined>;
|
|
79
|
+
/**
|
|
80
|
+
* Count of devices that could not be mapped.
|
|
81
|
+
*/
|
|
82
|
+
declare public /*out*/ readonly unassignedCount: pulumi.Output<number>;
|
|
83
|
+
/**
|
|
84
|
+
* Job update timestamp.
|
|
85
|
+
*/
|
|
86
|
+
declare public /*out*/ readonly updatedAt: pulumi.Output<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Wait for sync job completion before returning state.
|
|
89
|
+
*/
|
|
90
|
+
declare public readonly waitForCompletion: pulumi.Output<boolean | undefined>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Create a Sync resource with the given unique name, arguments, and options.
|
|
94
|
+
*
|
|
95
|
+
* @param name The _unique_ name of the resource.
|
|
96
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
97
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
98
|
+
*/
|
|
99
|
+
constructor(name: string, args: SyncArgs, opts?: pulumi.CustomResourceOptions)
|
|
100
|
+
constructor(name: string, argsOrState?: SyncArgs | SyncState, opts?: pulumi.CustomResourceOptions) {
|
|
101
|
+
let resourceInputs: pulumi.Inputs = {};
|
|
102
|
+
opts = opts || {};
|
|
103
|
+
if (opts.id) {
|
|
104
|
+
const state = argsOrState as SyncState | undefined;
|
|
105
|
+
resourceInputs["completedAt"] = state?.completedAt;
|
|
106
|
+
resourceInputs["createdAt"] = state?.createdAt;
|
|
107
|
+
resourceInputs["error"] = state?.error;
|
|
108
|
+
resourceInputs["pollIntervalSeconds"] = state?.pollIntervalSeconds;
|
|
109
|
+
resourceInputs["providerName"] = state?.providerName;
|
|
110
|
+
resourceInputs["startedAt"] = state?.startedAt;
|
|
111
|
+
resourceInputs["status"] = state?.status;
|
|
112
|
+
resourceInputs["syncedEndpoints"] = state?.syncedEndpoints;
|
|
113
|
+
resourceInputs["tenantId"] = state?.tenantId;
|
|
114
|
+
resourceInputs["timeoutSeconds"] = state?.timeoutSeconds;
|
|
115
|
+
resourceInputs["trigger"] = state?.trigger;
|
|
116
|
+
resourceInputs["unassignedCount"] = state?.unassignedCount;
|
|
117
|
+
resourceInputs["updatedAt"] = state?.updatedAt;
|
|
118
|
+
resourceInputs["waitForCompletion"] = state?.waitForCompletion;
|
|
119
|
+
} else {
|
|
120
|
+
const args = argsOrState as SyncArgs | undefined;
|
|
121
|
+
if (args?.providerName === undefined && !opts.urn) {
|
|
122
|
+
throw new Error("Missing required property 'providerName'");
|
|
123
|
+
}
|
|
124
|
+
resourceInputs["pollIntervalSeconds"] = args?.pollIntervalSeconds;
|
|
125
|
+
resourceInputs["providerName"] = args?.providerName;
|
|
126
|
+
resourceInputs["timeoutSeconds"] = args?.timeoutSeconds;
|
|
127
|
+
resourceInputs["trigger"] = args?.trigger;
|
|
128
|
+
resourceInputs["waitForCompletion"] = args?.waitForCompletion;
|
|
129
|
+
resourceInputs["completedAt"] = undefined /*out*/;
|
|
130
|
+
resourceInputs["createdAt"] = undefined /*out*/;
|
|
131
|
+
resourceInputs["error"] = undefined /*out*/;
|
|
132
|
+
resourceInputs["startedAt"] = undefined /*out*/;
|
|
133
|
+
resourceInputs["status"] = undefined /*out*/;
|
|
134
|
+
resourceInputs["syncedEndpoints"] = undefined /*out*/;
|
|
135
|
+
resourceInputs["tenantId"] = undefined /*out*/;
|
|
136
|
+
resourceInputs["unassignedCount"] = undefined /*out*/;
|
|
137
|
+
resourceInputs["updatedAt"] = undefined /*out*/;
|
|
138
|
+
}
|
|
139
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
140
|
+
super(Sync.__pulumiType, name, resourceInputs, opts);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Input properties used for looking up and filtering Sync resources.
|
|
146
|
+
*/
|
|
147
|
+
export interface SyncState {
|
|
148
|
+
/**
|
|
149
|
+
* Job completion timestamp.
|
|
150
|
+
*/
|
|
151
|
+
completedAt?: pulumi.Input<string | undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* Job creation timestamp.
|
|
154
|
+
*/
|
|
155
|
+
createdAt?: pulumi.Input<string | undefined>;
|
|
156
|
+
/**
|
|
157
|
+
* Job error string when status=failed.
|
|
158
|
+
*/
|
|
159
|
+
error?: pulumi.Input<string | undefined>;
|
|
160
|
+
/**
|
|
161
|
+
* Polling interval when wait_for_completion=true.
|
|
162
|
+
*/
|
|
163
|
+
pollIntervalSeconds?: pulumi.Input<number | undefined>;
|
|
164
|
+
/**
|
|
165
|
+
* MDM provider slug.
|
|
166
|
+
*/
|
|
167
|
+
providerName?: pulumi.Input<string | undefined>;
|
|
168
|
+
/**
|
|
169
|
+
* Job start timestamp.
|
|
170
|
+
*/
|
|
171
|
+
startedAt?: pulumi.Input<string | undefined>;
|
|
172
|
+
/**
|
|
173
|
+
* Job status: queued, running, succeeded, failed.
|
|
174
|
+
*/
|
|
175
|
+
status?: pulumi.Input<string | undefined>;
|
|
176
|
+
/**
|
|
177
|
+
* Number of endpoints synchronized by the job.
|
|
178
|
+
*/
|
|
179
|
+
syncedEndpoints?: pulumi.Input<number | undefined>;
|
|
180
|
+
/**
|
|
181
|
+
* Tenant ID from provider configuration.
|
|
182
|
+
*/
|
|
183
|
+
tenantId?: pulumi.Input<string | undefined>;
|
|
184
|
+
/**
|
|
185
|
+
* Polling timeout when wait_for_completion=true.
|
|
186
|
+
*/
|
|
187
|
+
timeoutSeconds?: pulumi.Input<number | undefined>;
|
|
188
|
+
/**
|
|
189
|
+
* Arbitrary replacement trigger value.
|
|
190
|
+
*/
|
|
191
|
+
trigger?: pulumi.Input<string | undefined>;
|
|
192
|
+
/**
|
|
193
|
+
* Count of devices that could not be mapped.
|
|
194
|
+
*/
|
|
195
|
+
unassignedCount?: pulumi.Input<number | undefined>;
|
|
196
|
+
/**
|
|
197
|
+
* Job update timestamp.
|
|
198
|
+
*/
|
|
199
|
+
updatedAt?: pulumi.Input<string | undefined>;
|
|
200
|
+
/**
|
|
201
|
+
* Wait for sync job completion before returning state.
|
|
202
|
+
*/
|
|
203
|
+
waitForCompletion?: pulumi.Input<boolean | undefined>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The set of arguments for constructing a Sync resource.
|
|
208
|
+
*/
|
|
209
|
+
export interface SyncArgs {
|
|
210
|
+
/**
|
|
211
|
+
* Polling interval when wait_for_completion=true.
|
|
212
|
+
*/
|
|
213
|
+
pollIntervalSeconds?: pulumi.Input<number | undefined>;
|
|
214
|
+
/**
|
|
215
|
+
* MDM provider slug.
|
|
216
|
+
*/
|
|
217
|
+
providerName: pulumi.Input<string>;
|
|
218
|
+
/**
|
|
219
|
+
* Polling timeout when wait_for_completion=true.
|
|
220
|
+
*/
|
|
221
|
+
timeoutSeconds?: pulumi.Input<number | undefined>;
|
|
222
|
+
/**
|
|
223
|
+
* Arbitrary replacement trigger value.
|
|
224
|
+
*/
|
|
225
|
+
trigger?: pulumi.Input<string | undefined>;
|
|
226
|
+
/**
|
|
227
|
+
* Wait for sync job completion before returning state.
|
|
228
|
+
*/
|
|
229
|
+
waitForCompletion?: pulumi.Input<boolean | undefined>;
|
|
230
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atensec/pulumi-thoth",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pulumi provider for Aten Security Thoth AI governance control plane.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pulumi",
|
|
7
|
+
"thoth",
|
|
8
|
+
"atensecurity",
|
|
9
|
+
"governance",
|
|
10
|
+
"ai"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://atensecurity.com",
|
|
13
|
+
"repository": "https://github.com/atensecurity/pulumi-thoth",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@pulumi/pulumi": "^3.0.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20",
|
|
23
|
+
"typescript": "^4.7.0"
|
|
24
|
+
},
|
|
25
|
+
"pulumi": {
|
|
26
|
+
"resource": true,
|
|
27
|
+
"name": "thoth"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/provider.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
* The provider type for the thoth package. By default, resources use package-wide configuration
|
|
9
|
+
* settings, however an explicit `Provider` instance may be created and passed during resource
|
|
10
|
+
* construction to achieve fine-grained programmatic control over provider settings. See the
|
|
11
|
+
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
|
|
12
|
+
*/
|
|
13
|
+
export class Provider extends pulumi.ProviderResource {
|
|
14
|
+
/** @internal */
|
|
15
|
+
public static readonly __pulumiType = 'thoth';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns true if the given object is an instance of Provider. This is designed to work even
|
|
19
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
20
|
+
*/
|
|
21
|
+
public static isInstance(obj: any): obj is Provider {
|
|
22
|
+
if (obj === undefined || obj === null) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Admin bearer token used for authenticated GovAPI requests.
|
|
30
|
+
*/
|
|
31
|
+
declare public readonly adminBearerToken: pulumi.Output<string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Path to a file containing the admin bearer token.
|
|
34
|
+
*/
|
|
35
|
+
declare public readonly adminBearerTokenFile: pulumi.Output<string | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* Apex domain used to derive GovAPI host when apiBaseUrl is omitted. Defaults to atensecurity.com.
|
|
38
|
+
*/
|
|
39
|
+
declare public readonly apexDomain: pulumi.Output<string | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* GovAPI base URL override. When omitted, provider derives https://grid.<tenant_id>.<apex_domain>.
|
|
42
|
+
*/
|
|
43
|
+
declare public readonly apiBaseUrl: pulumi.Output<string | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Tenant slug used in GovAPI route scoping.
|
|
46
|
+
*/
|
|
47
|
+
declare public readonly tenantId: pulumi.Output<string>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create a Provider resource with the given unique name, arguments, and options.
|
|
51
|
+
*
|
|
52
|
+
* @param name The _unique_ name of the resource.
|
|
53
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
54
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
55
|
+
*/
|
|
56
|
+
constructor(name: string, args: ProviderArgs, opts?: pulumi.ResourceOptions) {
|
|
57
|
+
let resourceInputs: pulumi.Inputs = {};
|
|
58
|
+
opts = opts || {};
|
|
59
|
+
{
|
|
60
|
+
if (args?.tenantId === undefined && !opts.urn) {
|
|
61
|
+
throw new Error("Missing required property 'tenantId'");
|
|
62
|
+
}
|
|
63
|
+
resourceInputs["adminBearerToken"] = args?.adminBearerToken ? pulumi.secret(args.adminBearerToken) : undefined;
|
|
64
|
+
resourceInputs["adminBearerTokenFile"] = args?.adminBearerTokenFile;
|
|
65
|
+
resourceInputs["apexDomain"] = args?.apexDomain;
|
|
66
|
+
resourceInputs["apiBaseUrl"] = args?.apiBaseUrl;
|
|
67
|
+
resourceInputs["insecureSkipTlsVerify"] = pulumi.output(args?.insecureSkipTlsVerify).apply(JSON.stringify);
|
|
68
|
+
resourceInputs["requestTimeoutSeconds"] = pulumi.output(args?.requestTimeoutSeconds).apply(JSON.stringify);
|
|
69
|
+
resourceInputs["retryBaseDelayMs"] = pulumi.output(args?.retryBaseDelayMs).apply(JSON.stringify);
|
|
70
|
+
resourceInputs["retryMaxAttempts"] = pulumi.output(args?.retryMaxAttempts).apply(JSON.stringify);
|
|
71
|
+
resourceInputs["retryMaxDelayMs"] = pulumi.output(args?.retryMaxDelayMs).apply(JSON.stringify);
|
|
72
|
+
resourceInputs["tenantId"] = args?.tenantId;
|
|
73
|
+
}
|
|
74
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
75
|
+
const secretOpts = { additionalSecretOutputs: ["adminBearerToken"] };
|
|
76
|
+
opts = pulumi.mergeOptions(opts, secretOpts);
|
|
77
|
+
super(Provider.__pulumiType, name, resourceInputs, opts);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* This function returns a Terraform config object with terraform-namecased keys,to be used with the Terraform Module Provider.
|
|
82
|
+
*/
|
|
83
|
+
terraformConfig(): pulumi.Output<Provider.TerraformConfigResult> {
|
|
84
|
+
return pulumi.runtime.call("pulumi:providers:thoth/terraformConfig", {
|
|
85
|
+
"__self__": this,
|
|
86
|
+
}, this);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The set of arguments for constructing a Provider resource.
|
|
92
|
+
*/
|
|
93
|
+
export interface ProviderArgs {
|
|
94
|
+
/**
|
|
95
|
+
* Admin bearer token used for authenticated GovAPI requests.
|
|
96
|
+
*/
|
|
97
|
+
adminBearerToken?: pulumi.Input<string | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Path to a file containing the admin bearer token.
|
|
100
|
+
*/
|
|
101
|
+
adminBearerTokenFile?: pulumi.Input<string | undefined>;
|
|
102
|
+
/**
|
|
103
|
+
* Apex domain used to derive GovAPI host when apiBaseUrl is omitted. Defaults to atensecurity.com.
|
|
104
|
+
*/
|
|
105
|
+
apexDomain?: pulumi.Input<string | undefined>;
|
|
106
|
+
/**
|
|
107
|
+
* GovAPI base URL override. When omitted, provider derives https://grid.<tenant_id>.<apex_domain>.
|
|
108
|
+
*/
|
|
109
|
+
apiBaseUrl?: pulumi.Input<string | undefined>;
|
|
110
|
+
/**
|
|
111
|
+
* Skip TLS certificate verification (development/testing only).
|
|
112
|
+
*/
|
|
113
|
+
insecureSkipTlsVerify?: pulumi.Input<boolean | undefined>;
|
|
114
|
+
/**
|
|
115
|
+
* Per-request timeout in seconds.
|
|
116
|
+
*/
|
|
117
|
+
requestTimeoutSeconds?: pulumi.Input<number | undefined>;
|
|
118
|
+
/**
|
|
119
|
+
* Base delay in milliseconds for exponential retry backoff.
|
|
120
|
+
*/
|
|
121
|
+
retryBaseDelayMs?: pulumi.Input<number | undefined>;
|
|
122
|
+
/**
|
|
123
|
+
* Maximum retry attempts for transient API/network failures.
|
|
124
|
+
*/
|
|
125
|
+
retryMaxAttempts?: pulumi.Input<number | undefined>;
|
|
126
|
+
/**
|
|
127
|
+
* Maximum delay in milliseconds for retry backoff.
|
|
128
|
+
*/
|
|
129
|
+
retryMaxDelayMs?: pulumi.Input<number | undefined>;
|
|
130
|
+
/**
|
|
131
|
+
* Tenant slug used in GovAPI route scoping.
|
|
132
|
+
*/
|
|
133
|
+
tenantId: pulumi.Input<string>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export namespace Provider {
|
|
137
|
+
/**
|
|
138
|
+
* The results of the Provider.terraformConfig method.
|
|
139
|
+
*/
|
|
140
|
+
export interface TerraformConfigResult {
|
|
141
|
+
readonly result: {[key: string]: any};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Output
|
|
4
|
+
"outDir": "bin",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"stripInternal": true,
|
|
9
|
+
// Environment
|
|
10
|
+
"target": "ES2022",
|
|
11
|
+
"module": "nodenext",
|
|
12
|
+
"moduleResolution": "nodenext",
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"types": ["node"],
|
|
15
|
+
// Type Checking
|
|
16
|
+
"strict": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noImplicitReturns": true,
|
|
19
|
+
"skipLibCheck": true
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"access/apiKey.ts",
|
|
23
|
+
"access/getApiKeyMetrics.ts",
|
|
24
|
+
"access/index.ts",
|
|
25
|
+
"browser/enrollment.ts",
|
|
26
|
+
"browser/index.ts",
|
|
27
|
+
"browser/policy.ts",
|
|
28
|
+
"browser/provider.ts",
|
|
29
|
+
"config/index.ts",
|
|
30
|
+
"config/vars.ts",
|
|
31
|
+
"governance/approvalDecision.ts",
|
|
32
|
+
"governance/getFeed.ts",
|
|
33
|
+
"governance/getTenantSettings.ts",
|
|
34
|
+
"governance/getTools.ts",
|
|
35
|
+
"governance/index.ts",
|
|
36
|
+
"governance/packAssignment.ts",
|
|
37
|
+
"governance/policySync.ts",
|
|
38
|
+
"governance/tenantSettings.ts",
|
|
39
|
+
"governance/webhookTest.ts",
|
|
40
|
+
"index.ts",
|
|
41
|
+
"mdm/getSyncJob.ts",
|
|
42
|
+
"mdm/index.ts",
|
|
43
|
+
"mdm/provider.ts",
|
|
44
|
+
"mdm/sync.ts",
|
|
45
|
+
"provider.ts",
|
|
46
|
+
"utilities.ts"
|
|
47
|
+
]
|
|
48
|
+
}
|
package/utilities.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
|
|
5
|
+
import * as runtime from "@pulumi/pulumi/runtime";
|
|
6
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
7
|
+
|
|
8
|
+
export function getEnv(...vars: string[]): string | undefined {
|
|
9
|
+
for (const v of vars) {
|
|
10
|
+
const value = process.env[v];
|
|
11
|
+
if (value) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getEnvBoolean(...vars: string[]): boolean | undefined {
|
|
19
|
+
const s = getEnv(...vars);
|
|
20
|
+
if (s !== undefined) {
|
|
21
|
+
// NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
|
|
22
|
+
// Terraform uses internally when parsing boolean values.
|
|
23
|
+
if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getEnvNumber(...vars: string[]): number | undefined {
|
|
34
|
+
const s = getEnv(...vars);
|
|
35
|
+
if (s !== undefined) {
|
|
36
|
+
const f = parseFloat(s);
|
|
37
|
+
if (!isNaN(f)) {
|
|
38
|
+
return f;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getVersion(): string {
|
|
45
|
+
let version = require('./package.json').version;
|
|
46
|
+
// Node allows for the version to be prefixed by a "v", while semver doesn't.
|
|
47
|
+
// If there is a v, strip it off.
|
|
48
|
+
if (version.indexOf('v') === 0) {
|
|
49
|
+
version = version.slice(1);
|
|
50
|
+
}
|
|
51
|
+
return version;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export function resourceOptsDefaults(): any {
|
|
56
|
+
return { version: getVersion() };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export function lazyLoad(exports: any, props: string[], loadModule: any) {
|
|
61
|
+
for (let property of props) {
|
|
62
|
+
Object.defineProperty(exports, property, {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function() {
|
|
65
|
+
return loadModule()[property];
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export async function callAsync<T>(
|
|
73
|
+
tok: string,
|
|
74
|
+
props: pulumi.Inputs,
|
|
75
|
+
res?: pulumi.Resource,
|
|
76
|
+
opts?: {property?: string},
|
|
77
|
+
): Promise<T> {
|
|
78
|
+
const o: any = runtime.call<T>(tok, props, res);
|
|
79
|
+
const value = await o.promise(true /*withUnknowns*/);
|
|
80
|
+
const isKnown = await o.isKnown;
|
|
81
|
+
const isSecret = await o.isSecret;
|
|
82
|
+
const problem: string|undefined =
|
|
83
|
+
!isKnown ? "an unknown value"
|
|
84
|
+
: isSecret ? "a secret value"
|
|
85
|
+
: undefined;
|
|
86
|
+
// Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
|
|
87
|
+
if (problem) {
|
|
88
|
+
throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
|
|
89
|
+
"This is an error in the provider, please report this to the provider developer.");
|
|
90
|
+
}
|
|
91
|
+
// Extract a single property if requested.
|
|
92
|
+
if (opts && opts.property) {
|
|
93
|
+
return value[opts.property];
|
|
94
|
+
}
|
|
95
|
+
return value;
|
|
96
|
+
}
|