/
kubernetesCluster.ts
281 lines (272 loc) · 15.1 KB
/
kubernetesCluster.ts
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
// *** 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! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as utilities from "../utilities";
/**
* > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/kubernetes_cluster.html.markdown.
*/
export class KubernetesCluster extends pulumi.CustomResource {
/**
* Get an existing KubernetesCluster resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: KubernetesClusterState, opts?: pulumi.CustomResourceOptions): KubernetesCluster {
return new KubernetesCluster(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'azure:containerservice/kubernetesCluster:KubernetesCluster';
/**
* Returns true if the given object is an instance of KubernetesCluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is KubernetesCluster {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === KubernetesCluster.__pulumiType;
}
public readonly addonProfile!: pulumi.Output<outputs.containerservice.KubernetesClusterAddonProfile>;
/**
* One or more `agentPoolProfile` blocks as defined below.
*/
public readonly agentPoolProfiles!: pulumi.Output<outputs.containerservice.KubernetesClusterAgentPoolProfile[]>;
public readonly apiServerAuthorizedIpRanges!: pulumi.Output<string[] | undefined>;
/**
* DNS prefix specified when creating the managed cluster. Changing this forces a new resource to be created.
*/
public readonly dnsPrefix!: pulumi.Output<string>;
public readonly enablePodSecurityPolicy!: pulumi.Output<boolean>;
/**
* The FQDN of the Azure Kubernetes Managed Cluster.
*/
public /*out*/ readonly fqdn!: pulumi.Output<string>;
/**
* A `kubeAdminConfig` block as defined below. This is only available when Role Based Access Control with Azure Active Directory is enabled.
*/
public /*out*/ readonly kubeAdminConfig!: pulumi.Output<outputs.containerservice.KubernetesClusterKubeAdminConfig>;
/**
* Raw Kubernetes config for the admin account to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools. This is only available when Role Based Access Control with Azure Active Directory is enabled.
*/
public /*out*/ readonly kubeAdminConfigRaw!: pulumi.Output<string>;
/**
* A `kubeConfig` block as defined below.
*/
public /*out*/ readonly kubeConfig!: pulumi.Output<outputs.containerservice.KubernetesClusterKubeConfig>;
/**
* Raw Kubernetes config to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools
*/
public /*out*/ readonly kubeConfigRaw!: pulumi.Output<string>;
public readonly kubernetesVersion!: pulumi.Output<string>;
public readonly linuxProfile!: pulumi.Output<outputs.containerservice.KubernetesClusterLinuxProfile | undefined>;
/**
* The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
*/
public readonly location!: pulumi.Output<string>;
/**
* The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
*/
public readonly name!: pulumi.Output<string>;
public readonly networkProfile!: pulumi.Output<outputs.containerservice.KubernetesClusterNetworkProfile>;
/**
* The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster.
*/
public readonly nodeResourceGroup!: pulumi.Output<string>;
/**
* Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
*/
public readonly resourceGroupName!: pulumi.Output<string>;
public readonly roleBasedAccessControl!: pulumi.Output<outputs.containerservice.KubernetesClusterRoleBasedAccessControl>;
/**
* A `servicePrincipal` block as documented below.
*/
public readonly servicePrincipal!: pulumi.Output<outputs.containerservice.KubernetesClusterServicePrincipal>;
public readonly tags!: pulumi.Output<{[key: string]: any}>;
public readonly windowsProfile!: pulumi.Output<outputs.containerservice.KubernetesClusterWindowsProfile | undefined>;
/**
* Create a KubernetesCluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: KubernetesClusterArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: KubernetesClusterArgs | KubernetesClusterState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as KubernetesClusterState | undefined;
inputs["addonProfile"] = state ? state.addonProfile : undefined;
inputs["agentPoolProfiles"] = state ? state.agentPoolProfiles : undefined;
inputs["apiServerAuthorizedIpRanges"] = state ? state.apiServerAuthorizedIpRanges : undefined;
inputs["dnsPrefix"] = state ? state.dnsPrefix : undefined;
inputs["enablePodSecurityPolicy"] = state ? state.enablePodSecurityPolicy : undefined;
inputs["fqdn"] = state ? state.fqdn : undefined;
inputs["kubeAdminConfig"] = state ? state.kubeAdminConfig : undefined;
inputs["kubeAdminConfigRaw"] = state ? state.kubeAdminConfigRaw : undefined;
inputs["kubeConfig"] = state ? state.kubeConfig : undefined;
inputs["kubeConfigRaw"] = state ? state.kubeConfigRaw : undefined;
inputs["kubernetesVersion"] = state ? state.kubernetesVersion : undefined;
inputs["linuxProfile"] = state ? state.linuxProfile : undefined;
inputs["location"] = state ? state.location : undefined;
inputs["name"] = state ? state.name : undefined;
inputs["networkProfile"] = state ? state.networkProfile : undefined;
inputs["nodeResourceGroup"] = state ? state.nodeResourceGroup : undefined;
inputs["resourceGroupName"] = state ? state.resourceGroupName : undefined;
inputs["roleBasedAccessControl"] = state ? state.roleBasedAccessControl : undefined;
inputs["servicePrincipal"] = state ? state.servicePrincipal : undefined;
inputs["tags"] = state ? state.tags : undefined;
inputs["windowsProfile"] = state ? state.windowsProfile : undefined;
} else {
const args = argsOrState as KubernetesClusterArgs | undefined;
if (!args || args.agentPoolProfiles === undefined) {
throw new Error("Missing required property 'agentPoolProfiles'");
}
if (!args || args.dnsPrefix === undefined) {
throw new Error("Missing required property 'dnsPrefix'");
}
if (!args || args.resourceGroupName === undefined) {
throw new Error("Missing required property 'resourceGroupName'");
}
if (!args || args.servicePrincipal === undefined) {
throw new Error("Missing required property 'servicePrincipal'");
}
inputs["addonProfile"] = args ? args.addonProfile : undefined;
inputs["agentPoolProfiles"] = args ? args.agentPoolProfiles : undefined;
inputs["apiServerAuthorizedIpRanges"] = args ? args.apiServerAuthorizedIpRanges : undefined;
inputs["dnsPrefix"] = args ? args.dnsPrefix : undefined;
inputs["enablePodSecurityPolicy"] = args ? args.enablePodSecurityPolicy : undefined;
inputs["kubernetesVersion"] = args ? args.kubernetesVersion : undefined;
inputs["linuxProfile"] = args ? args.linuxProfile : undefined;
inputs["location"] = args ? args.location : undefined;
inputs["name"] = args ? args.name : undefined;
inputs["networkProfile"] = args ? args.networkProfile : undefined;
inputs["nodeResourceGroup"] = args ? args.nodeResourceGroup : undefined;
inputs["resourceGroupName"] = args ? args.resourceGroupName : undefined;
inputs["roleBasedAccessControl"] = args ? args.roleBasedAccessControl : undefined;
inputs["servicePrincipal"] = args ? args.servicePrincipal : undefined;
inputs["tags"] = args ? args.tags : undefined;
inputs["windowsProfile"] = args ? args.windowsProfile : undefined;
inputs["fqdn"] = undefined /*out*/;
inputs["kubeAdminConfig"] = undefined /*out*/;
inputs["kubeAdminConfigRaw"] = undefined /*out*/;
inputs["kubeConfig"] = undefined /*out*/;
inputs["kubeConfigRaw"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(KubernetesCluster.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering KubernetesCluster resources.
*/
export interface KubernetesClusterState {
readonly addonProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterAddonProfile>;
/**
* One or more `agentPoolProfile` blocks as defined below.
*/
readonly agentPoolProfiles?: pulumi.Input<pulumi.Input<inputs.containerservice.KubernetesClusterAgentPoolProfile>[]>;
readonly apiServerAuthorizedIpRanges?: pulumi.Input<pulumi.Input<string>[]>;
/**
* DNS prefix specified when creating the managed cluster. Changing this forces a new resource to be created.
*/
readonly dnsPrefix?: pulumi.Input<string>;
readonly enablePodSecurityPolicy?: pulumi.Input<boolean>;
/**
* The FQDN of the Azure Kubernetes Managed Cluster.
*/
readonly fqdn?: pulumi.Input<string>;
/**
* A `kubeAdminConfig` block as defined below. This is only available when Role Based Access Control with Azure Active Directory is enabled.
*/
readonly kubeAdminConfig?: pulumi.Input<inputs.containerservice.KubernetesClusterKubeAdminConfig>;
/**
* Raw Kubernetes config for the admin account to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools. This is only available when Role Based Access Control with Azure Active Directory is enabled.
*/
readonly kubeAdminConfigRaw?: pulumi.Input<string>;
/**
* A `kubeConfig` block as defined below.
*/
readonly kubeConfig?: pulumi.Input<inputs.containerservice.KubernetesClusterKubeConfig>;
/**
* Raw Kubernetes config to be used by [kubectl](https://kubernetes.io/docs/reference/kubectl/overview/) and other compatible tools
*/
readonly kubeConfigRaw?: pulumi.Input<string>;
readonly kubernetesVersion?: pulumi.Input<string>;
readonly linuxProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterLinuxProfile>;
/**
* The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
*/
readonly location?: pulumi.Input<string>;
/**
* The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
*/
readonly name?: pulumi.Input<string>;
readonly networkProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterNetworkProfile>;
/**
* The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster.
*/
readonly nodeResourceGroup?: pulumi.Input<string>;
/**
* Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
*/
readonly resourceGroupName?: pulumi.Input<string>;
readonly roleBasedAccessControl?: pulumi.Input<inputs.containerservice.KubernetesClusterRoleBasedAccessControl>;
/**
* A `servicePrincipal` block as documented below.
*/
readonly servicePrincipal?: pulumi.Input<inputs.containerservice.KubernetesClusterServicePrincipal>;
readonly tags?: pulumi.Input<{[key: string]: any}>;
readonly windowsProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterWindowsProfile>;
}
/**
* The set of arguments for constructing a KubernetesCluster resource.
*/
export interface KubernetesClusterArgs {
readonly addonProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterAddonProfile>;
/**
* One or more `agentPoolProfile` blocks as defined below.
*/
readonly agentPoolProfiles: pulumi.Input<pulumi.Input<inputs.containerservice.KubernetesClusterAgentPoolProfile>[]>;
readonly apiServerAuthorizedIpRanges?: pulumi.Input<pulumi.Input<string>[]>;
/**
* DNS prefix specified when creating the managed cluster. Changing this forces a new resource to be created.
*/
readonly dnsPrefix: pulumi.Input<string>;
readonly enablePodSecurityPolicy?: pulumi.Input<boolean>;
readonly kubernetesVersion?: pulumi.Input<string>;
readonly linuxProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterLinuxProfile>;
/**
* The location where the Managed Kubernetes Cluster should be created. Changing this forces a new resource to be created.
*/
readonly location?: pulumi.Input<string>;
/**
* The name of the Managed Kubernetes Cluster to create. Changing this forces a new resource to be created.
*/
readonly name?: pulumi.Input<string>;
readonly networkProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterNetworkProfile>;
/**
* The auto-generated Resource Group which contains the resources for this Managed Kubernetes Cluster.
*/
readonly nodeResourceGroup?: pulumi.Input<string>;
/**
* Specifies the Resource Group where the Managed Kubernetes Cluster should exist. Changing this forces a new resource to be created.
*/
readonly resourceGroupName: pulumi.Input<string>;
readonly roleBasedAccessControl?: pulumi.Input<inputs.containerservice.KubernetesClusterRoleBasedAccessControl>;
/**
* A `servicePrincipal` block as documented below.
*/
readonly servicePrincipal: pulumi.Input<inputs.containerservice.KubernetesClusterServicePrincipal>;
readonly tags?: pulumi.Input<{[key: string]: any}>;
readonly windowsProfile?: pulumi.Input<inputs.containerservice.KubernetesClusterWindowsProfile>;
}