generated from pulumi/pulumi-tf-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAuthAttachment.cs
468 lines (431 loc) · 19.3 KB
/
AuthAttachment.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;
namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Kubernetes
{
/// <summary>
/// Provide a resource to configure kubernetes cluster authentication info.
///
/// > **NOTE:** Only available for cluster version >= 1.20
///
/// ## Example Usage
///
/// <!--Start PulumiCodeChooser -->
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tencentcloud = Pulumi.Tencentcloud;
/// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
///
/// return await Deployment.RunAsync(() =>
/// {
/// var config = new Config();
/// var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
/// var clusterCidr = config.Get("clusterCidr") ?? "172.16.0.0/16";
/// var defaultInstanceType = config.Get("defaultInstanceType") ?? "S1.SMALL1";
/// var @default = Tencentcloud.Images.GetInstance.Invoke(new()
/// {
/// ImageTypes = new[]
/// {
/// "PUBLIC_IMAGE",
/// },
/// OsName = "centos",
/// });
///
/// var vpc = Tencentcloud.Vpc.GetSubnets.Invoke(new()
/// {
/// IsDefault = true,
/// AvailabilityZone = availabilityZone,
/// });
///
/// var managedCluster = new Tencentcloud.Kubernetes.Cluster("managedCluster", new()
/// {
/// VpcId = vpc.Apply(getSubnetsResult => getSubnetsResult.InstanceLists[0]?.VpcId),
/// ClusterCidr = "10.31.0.0/16",
/// ClusterMaxPodNum = 32,
/// ClusterName = "keep",
/// ClusterDesc = "test cluster desc",
/// ClusterVersion = "1.20.6",
/// ClusterMaxServiceNum = 32,
/// WorkerConfigs = new[]
/// {
/// new Tencentcloud.Kubernetes.Inputs.ClusterWorkerConfigArgs
/// {
/// Count = 1,
/// AvailabilityZone = availabilityZone,
/// InstanceType = defaultInstanceType,
/// SystemDiskType = "CLOUD_SSD",
/// SystemDiskSize = 60,
/// InternetChargeType = "TRAFFIC_POSTPAID_BY_HOUR",
/// InternetMaxBandwidthOut = 100,
/// PublicIpAssigned = true,
/// SubnetId = vpc.Apply(getSubnetsResult => getSubnetsResult.InstanceLists[0]?.SubnetId),
/// DataDisks = new[]
/// {
/// new Tencentcloud.Kubernetes.Inputs.ClusterWorkerConfigDataDiskArgs
/// {
/// DiskType = "CLOUD_PREMIUM",
/// DiskSize = 50,
/// },
/// },
/// EnhancedSecurityService = false,
/// EnhancedMonitorService = false,
/// UserData = "dGVzdA==",
/// Password = "ZZXXccvv1212",
/// },
/// },
/// ClusterDeployType = "MANAGED_CLUSTER",
/// });
///
/// var testAuthAttach = new Tencentcloud.Kubernetes.AuthAttachment("testAuthAttach", new()
/// {
/// ClusterId = managedCluster.Id,
/// JwksUri = managedCluster.Id.Apply(id => $"https://{id}.ccs.tencent-cloud.com/openid/v1/jwks"),
/// Issuer = managedCluster.Id.Apply(id => $"https://{id}.ccs.tencent-cloud.com"),
/// AutoCreateDiscoveryAnonymousAuth = true,
/// });
///
/// });
/// ```
/// <!--End PulumiCodeChooser -->
///
/// ### Use the TKE default issuer and jwks_uri
///
/// <!--Start PulumiCodeChooser -->
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tencentcloud = Pulumi.Tencentcloud;
/// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
///
/// return await Deployment.RunAsync(() =>
/// {
/// var config = new Config();
/// var availabilityZone = config.Get("availabilityZone") ?? "ap-guangzhou-3";
/// var clusterCidr = config.Get("clusterCidr") ?? "172.16.0.0/16";
/// var defaultInstanceType = config.Get("defaultInstanceType") ?? "S1.SMALL1";
/// var @default = Tencentcloud.Images.GetInstance.Invoke(new()
/// {
/// ImageTypes = new[]
/// {
/// "PUBLIC_IMAGE",
/// },
/// OsName = "centos",
/// });
///
/// var vpc = Tencentcloud.Vpc.GetSubnets.Invoke(new()
/// {
/// IsDefault = true,
/// AvailabilityZone = availabilityZone,
/// });
///
/// var managedCluster = new Tencentcloud.Kubernetes.Cluster("managedCluster", new()
/// {
/// VpcId = vpc.Apply(getSubnetsResult => getSubnetsResult.InstanceLists[0]?.VpcId),
/// ClusterCidr = "10.31.0.0/16",
/// ClusterMaxPodNum = 32,
/// ClusterName = "keep",
/// ClusterDesc = "test cluster desc",
/// ClusterVersion = "1.20.6",
/// ClusterMaxServiceNum = 32,
/// WorkerConfigs = new[]
/// {
/// new Tencentcloud.Kubernetes.Inputs.ClusterWorkerConfigArgs
/// {
/// Count = 1,
/// AvailabilityZone = availabilityZone,
/// InstanceType = defaultInstanceType,
/// SystemDiskType = "CLOUD_SSD",
/// SystemDiskSize = 60,
/// InternetChargeType = "TRAFFIC_POSTPAID_BY_HOUR",
/// InternetMaxBandwidthOut = 100,
/// PublicIpAssigned = true,
/// SubnetId = vpc.Apply(getSubnetsResult => getSubnetsResult.InstanceLists[0]?.SubnetId),
/// DataDisks = new[]
/// {
/// new Tencentcloud.Kubernetes.Inputs.ClusterWorkerConfigDataDiskArgs
/// {
/// DiskType = "CLOUD_PREMIUM",
/// DiskSize = 50,
/// },
/// },
/// EnhancedSecurityService = false,
/// EnhancedMonitorService = false,
/// UserData = "dGVzdA==",
/// Password = "ZZXXccvv1212",
/// },
/// },
/// ClusterDeployType = "MANAGED_CLUSTER",
/// });
///
/// // if you want to use tke default issuer and jwks_uri, please set use_tke_default to true and set issuer to empty string.
/// var testUseTkeDefaultAuthAttach = new Tencentcloud.Kubernetes.AuthAttachment("testUseTkeDefaultAuthAttach", new()
/// {
/// ClusterId = managedCluster.Id,
/// AutoCreateDiscoveryAnonymousAuth = true,
/// UseTkeDefault = true,
/// });
///
/// });
/// ```
/// <!--End PulumiCodeChooser -->
///
/// ### Use OIDC Config
///
/// <!--Start PulumiCodeChooser -->
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Tencentcloud = Pulumi.Tencentcloud;
/// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
///
/// return await Deployment.RunAsync(() =>
/// {
/// var testAuthAttach = new Tencentcloud.Kubernetes.AuthAttachment("testAuthAttach", new()
/// {
/// ClusterId = tencentcloud_kubernetes_cluster.Managed_cluster.Id,
/// UseTkeDefault = true,
/// AutoCreateDiscoveryAnonymousAuth = true,
/// AutoCreateOidcConfig = true,
/// AutoInstallPodIdentityWebhookAddon = true,
/// });
///
/// var oidcConfig = Tencentcloud.Cam.GetOidcConfig.Invoke(new()
/// {
/// Name = tencentcloud_kubernetes_cluster.Managed_cluster.Id,
/// });
///
/// return new Dictionary<string, object?>
/// {
/// ["identityKey"] = oidcConfig.Apply(getOidcConfigResult => getOidcConfigResult.IdentityKey),
/// ["identityUrl"] = oidcConfig.Apply(getOidcConfigResult => getOidcConfigResult.IdentityUrl),
/// };
/// });
/// ```
/// <!--End PulumiCodeChooser -->
///
/// ## Import
///
/// tke cluster authentication can be imported, e.g.
///
/// ```sh
/// $ pulumi import tencentcloud:Kubernetes/authAttachment:AuthAttachment test cls-xxx
/// ```
/// </summary>
[TencentcloudResourceType("tencentcloud:Kubernetes/authAttachment:AuthAttachment")]
public partial class AuthAttachment : global::Pulumi.CustomResource
{
/// <summary>
/// Creating ClientId of the identity provider.
/// </summary>
[Output("autoCreateClientIds")]
public Output<ImmutableArray<string>> AutoCreateClientIds { get; private set; } = null!;
/// <summary>
/// If set to `true`, the rbac rule will be created automatically which allow anonymous user to access '/.well-known/openid-configuration' and '/openid/v1/jwks'.
/// </summary>
[Output("autoCreateDiscoveryAnonymousAuth")]
public Output<bool?> AutoCreateDiscoveryAnonymousAuth { get; private set; } = null!;
/// <summary>
/// Creating an identity provider.
/// </summary>
[Output("autoCreateOidcConfig")]
public Output<bool> AutoCreateOidcConfig { get; private set; } = null!;
/// <summary>
/// Creating the PodIdentityWebhook component. if `auto_create_oidc_config` is true, this field must set true.
/// </summary>
[Output("autoInstallPodIdentityWebhookAddon")]
public Output<bool> AutoInstallPodIdentityWebhookAddon { get; private set; } = null!;
/// <summary>
/// ID of clusters.
/// </summary>
[Output("clusterId")]
public Output<string> ClusterId { get; private set; } = null!;
/// <summary>
/// Specify service-account-issuer. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Output("issuer")]
public Output<string?> Issuer { get; private set; } = null!;
/// <summary>
/// Specify service-account-jwks-uri. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Output("jwksUri")]
public Output<string?> JwksUri { get; private set; } = null!;
/// <summary>
/// The default issuer of tke. If use_tke_default is set to `true`, this parameter will be set to the default value.
/// </summary>
[Output("tkeDefaultIssuer")]
public Output<string> TkeDefaultIssuer { get; private set; } = null!;
/// <summary>
/// The default jwks_uri of tke. If use_tke_default is set to `true`, this parameter will be set to the default value.
/// </summary>
[Output("tkeDefaultJwksUri")]
public Output<string> TkeDefaultJwksUri { get; private set; } = null!;
/// <summary>
/// If set to `true`, the issuer and jwks_uri will be generated automatically by tke, please do not set issuer and jwks_uri.
/// </summary>
[Output("useTkeDefault")]
public Output<bool?> UseTkeDefault { get; private set; } = null!;
/// <summary>
/// Create a AuthAttachment resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public AuthAttachment(string name, AuthAttachmentArgs args, CustomResourceOptions? options = null)
: base("tencentcloud:Kubernetes/authAttachment:AuthAttachment", name, args ?? new AuthAttachmentArgs(), MakeResourceOptions(options, ""))
{
}
private AuthAttachment(string name, Input<string> id, AuthAttachmentState? state = null, CustomResourceOptions? options = null)
: base("tencentcloud:Kubernetes/authAttachment:AuthAttachment", name, state, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
PluginDownloadURL = "github://api.github.com/tencentcloudstack",
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing AuthAttachment resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="state">Any extra arguments used during the lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static AuthAttachment Get(string name, Input<string> id, AuthAttachmentState? state = null, CustomResourceOptions? options = null)
{
return new AuthAttachment(name, id, state, options);
}
}
public sealed class AuthAttachmentArgs : global::Pulumi.ResourceArgs
{
[Input("autoCreateClientIds")]
private InputList<string>? _autoCreateClientIds;
/// <summary>
/// Creating ClientId of the identity provider.
/// </summary>
public InputList<string> AutoCreateClientIds
{
get => _autoCreateClientIds ?? (_autoCreateClientIds = new InputList<string>());
set => _autoCreateClientIds = value;
}
/// <summary>
/// If set to `true`, the rbac rule will be created automatically which allow anonymous user to access '/.well-known/openid-configuration' and '/openid/v1/jwks'.
/// </summary>
[Input("autoCreateDiscoveryAnonymousAuth")]
public Input<bool>? AutoCreateDiscoveryAnonymousAuth { get; set; }
/// <summary>
/// Creating an identity provider.
/// </summary>
[Input("autoCreateOidcConfig")]
public Input<bool>? AutoCreateOidcConfig { get; set; }
/// <summary>
/// Creating the PodIdentityWebhook component. if `auto_create_oidc_config` is true, this field must set true.
/// </summary>
[Input("autoInstallPodIdentityWebhookAddon")]
public Input<bool>? AutoInstallPodIdentityWebhookAddon { get; set; }
/// <summary>
/// ID of clusters.
/// </summary>
[Input("clusterId", required: true)]
public Input<string> ClusterId { get; set; } = null!;
/// <summary>
/// Specify service-account-issuer. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Input("issuer")]
public Input<string>? Issuer { get; set; }
/// <summary>
/// Specify service-account-jwks-uri. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Input("jwksUri")]
public Input<string>? JwksUri { get; set; }
/// <summary>
/// If set to `true`, the issuer and jwks_uri will be generated automatically by tke, please do not set issuer and jwks_uri.
/// </summary>
[Input("useTkeDefault")]
public Input<bool>? UseTkeDefault { get; set; }
public AuthAttachmentArgs()
{
}
public static new AuthAttachmentArgs Empty => new AuthAttachmentArgs();
}
public sealed class AuthAttachmentState : global::Pulumi.ResourceArgs
{
[Input("autoCreateClientIds")]
private InputList<string>? _autoCreateClientIds;
/// <summary>
/// Creating ClientId of the identity provider.
/// </summary>
public InputList<string> AutoCreateClientIds
{
get => _autoCreateClientIds ?? (_autoCreateClientIds = new InputList<string>());
set => _autoCreateClientIds = value;
}
/// <summary>
/// If set to `true`, the rbac rule will be created automatically which allow anonymous user to access '/.well-known/openid-configuration' and '/openid/v1/jwks'.
/// </summary>
[Input("autoCreateDiscoveryAnonymousAuth")]
public Input<bool>? AutoCreateDiscoveryAnonymousAuth { get; set; }
/// <summary>
/// Creating an identity provider.
/// </summary>
[Input("autoCreateOidcConfig")]
public Input<bool>? AutoCreateOidcConfig { get; set; }
/// <summary>
/// Creating the PodIdentityWebhook component. if `auto_create_oidc_config` is true, this field must set true.
/// </summary>
[Input("autoInstallPodIdentityWebhookAddon")]
public Input<bool>? AutoInstallPodIdentityWebhookAddon { get; set; }
/// <summary>
/// ID of clusters.
/// </summary>
[Input("clusterId")]
public Input<string>? ClusterId { get; set; }
/// <summary>
/// Specify service-account-issuer. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Input("issuer")]
public Input<string>? Issuer { get; set; }
/// <summary>
/// Specify service-account-jwks-uri. If use_tke_default is set to `true`, please do not set this field.
/// </summary>
[Input("jwksUri")]
public Input<string>? JwksUri { get; set; }
/// <summary>
/// The default issuer of tke. If use_tke_default is set to `true`, this parameter will be set to the default value.
/// </summary>
[Input("tkeDefaultIssuer")]
public Input<string>? TkeDefaultIssuer { get; set; }
/// <summary>
/// The default jwks_uri of tke. If use_tke_default is set to `true`, this parameter will be set to the default value.
/// </summary>
[Input("tkeDefaultJwksUri")]
public Input<string>? TkeDefaultJwksUri { get; set; }
/// <summary>
/// If set to `true`, the issuer and jwks_uri will be generated automatically by tke, please do not set issuer and jwks_uri.
/// </summary>
[Input("useTkeDefault")]
public Input<bool>? UseTkeDefault { get; set; }
public AuthAttachmentState()
{
}
public static new AuthAttachmentState Empty => new AuthAttachmentState();
}
}