com.pulumi.alicloud.cs.kotlin.Kubernetes.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.alicloud.cs.kotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesAddon
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesCertificateAuthority
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesConnections
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesDeleteOption
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesMasterNode
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesRuntime
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesAddon.Companion.toKotlin as kubernetesAddonToKotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesCertificateAuthority.Companion.toKotlin as kubernetesCertificateAuthorityToKotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesConnections.Companion.toKotlin as kubernetesConnectionsToKotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesDeleteOption.Companion.toKotlin as kubernetesDeleteOptionToKotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesMasterNode.Companion.toKotlin as kubernetesMasterNodeToKotlin
import com.pulumi.alicloud.cs.kotlin.outputs.KubernetesRuntime.Companion.toKotlin as kubernetesRuntimeToKotlin
/**
* Builder for [Kubernetes].
*/
@PulumiTagMarker
public class KubernetesResourceBuilder internal constructor() {
public var name: String? = null
public var args: KubernetesArgs = KubernetesArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend KubernetesArgsBuilder.() -> Unit) {
val builder = KubernetesArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Kubernetes {
val builtJavaResource = com.pulumi.alicloud.cs.Kubernetes(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Kubernetes(builtJavaResource)
}
}
/**
* This resource will help you to manage a Kubernetes Cluster in Alibaba Cloud Kubernetes Service, see [What is kubernetes](https://www.alibabacloud.com/help/en/ack/ack-managed-and-ack-dedicated/developer-reference/create-an-ask-cluster-1).
* > **NOTE:** Available since v1.9.0.
* > **NOTE:** Kubernetes cluster only supports VPC network and it can access internet while creating kubernetes cluster.
* A Nat Gateway and configuring a SNAT for it can ensure one VPC network access internet. If there is no nat gateway in the
* VPC, you can set `new_nat_gateway` to "true" to create one automatically.
* > **NOTE:** Each kubernetes cluster contains 3 master nodes and those number cannot be changed at now.
* > **NOTE:** Creating kubernetes cluster need to install several packages and it will cost about 15 minutes. Please be patient.
* > **NOTE:** From version 1.9.4, the provider supports to download kube config, client certificate, client key and cluster ca certificate
* after creating cluster successfully, and you can put them into the specified location, like '~/.kube/config'.
* > **NOTE:** From version 1.16.0, the provider supports Multiple Availability Zones Kubernetes Cluster. To create a cluster of this kind, you must specify 3 or 5 items in `master_vswitch_ids` and `master_instance_types`.
* > **NOTE:** From version 1.20.0, the provider supports disabling internet load balancer for API Server by setting `false` to `slb_internet_enabled`.
* > **NOTE:** If you want to manage Kubernetes, you can use Kubernetes Provider.
* > **NOTE:** You need to activate several other products and confirm Authorization Policy used by Container Service before using this resource.
* Please refer to the `Authorization management` and `Cluster management` sections in the [Document Center](https://www.alibabacloud.com/help/doc-detail/86488.htm).
* > **NOTE:** From version 1.75.0, Some parameters have been removed from resource,You can check them below and re-import the cluster if necessary.
* > **NOTE:** From version 1.101.0+, We supported the `professional managed clusters(ack-pro)`, You can create a pro cluster by setting the the value of `cluster_spec`.
* > **NOTE:** From version 1.177.0+, `exclude_autoscaler_nodes`,`worker_number`,`worker_vswitch_ids`,`worker_instance_types`,`worker_instance_charge_type`,`worker_period`,`worker_period_unit`,`worker_auto_renew`,`worker_auto_renew_period`,`worker_disk_category`,`worker_disk_size`,`worker_data_disks`,`node_port_range`,`cpu_policy`,`user_data`,`taints`,`worker_disk_performance_level`,`worker_disk_snapshot_policy_id` are deprecated.
* We Suggest you using resource **`alicloud.cs.NodePool`** to manage your cluster worker nodes.
* > **NOTE:** From version 1.212.0, `exclude_autoscaler_nodes`,`worker_number`,`worker_vswitch_ids`,`worker_instance_types`,`worker_instance_charge_type`,`worker_period`,`worker_period_unit`,`worker_auto_renew`,`worker_auto_renew_period`,`worker_disk_category`,`worker_disk_size`,`worker_data_disks`,`node_port_range`,`cpu_policy`,`user_data`,`taints`,`worker_disk_performance_level`,`worker_disk_snapshot_policy_id`,`kube_config`,`availability_zone` are removed.
* Please use resource **`alicloud.cs.NodePool`** to manage your cluster worker nodes.
* ## Import
* Kubernetes cluster can be imported using the id, e.g. Then complete the main.tf accords to the result of `pulumi preview`.
* ```sh
* $ pulumi import alicloud:cs/kubernetes:Kubernetes main cluster-id
* ```
*/
public class Kubernetes internal constructor(
override val javaResource: com.pulumi.alicloud.cs.Kubernetes,
) : KotlinCustomResource(javaResource, KubernetesMapper) {
/**
* The addon you want to install in cluster. See `addons` to manage addons if cluster is created.
* *Network params*
*/
public val addons: Output>?
get() = javaResource.addons().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> kubernetesAddonToKotlin(args0) })
})
}).orElse(null)
})
/**
* A list of API audiences for [Service Account Token Volume Projection](https://www.alibabacloud.com/help/doc-detail/160384.htm). Set this to `["https://kubernetes.default.svc"]` if you want to enable the Token Volume Projection feature requires specifying `service_account_issuer` as well. From cluster version 1.22+, Service Account Token Volume Projection will be enabled by default.
*/
public val apiAudiences: Output>?
get() = javaResource.apiAudiences().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* (Map, Available since v1.105.0) Nested attribute containing certificate authority data for your cluster.
*/
public val certificateAuthority: Output
get() = javaResource.certificateAuthority().applyValue({ args0 ->
args0.let({ args0 ->
kubernetesCertificateAuthorityToKotlin(args0)
})
})
/**
* The path of client certificate, like `~/.kube/client-cert.pem`.
*/
public val clientCert: Output?
get() = javaResource.clientCert().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The path of client key, like `~/.kube/client-key.pem`.
*/
public val clientKey: Output?
get() = javaResource.clientKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The path of cluster ca certificate, like `~/.kube/cluster-ca-cert.pem`
* *Removed params*
*/
public val clusterCaCert: Output?
get() = javaResource.clusterCaCert().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Cluster local domain name, Default to `cluster.local`. A domain name consists of one or more sections separated by a decimal point (.), each of which is up to 63 characters long, and can be lowercase, numerals, and underscores (-), and must be lowercase or numerals at the beginning and end.
*/
public val clusterDomain: Output?
get() = javaResource.clusterDomain().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* (Map) Map of kubernetes cluster connection information.
*/
public val connections: Output
get() = javaResource.connections().applyValue({ args0 ->
args0.let({ args0 ->
kubernetesConnectionsToKotlin(args0)
})
})
/**
* Customize the certificate SAN, multiple IP or domain names are separated by English commas (,).
*/
public val customSan: Output?
get() = javaResource.customSan().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Delete options, only work for deleting resource. Make sure you have run `pulumi up` to make the configuration applied. See `delete_options` below.
*/
public val deleteOptions: Output>?
get() = javaResource.deleteOptions().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
kubernetesDeleteOptionToKotlin(args0)
})
})
}).orElse(null)
})
/**
* Whether to enable cluster deletion protection.
*/
public val deletionProtection: Output?
get() = javaResource.deletionProtection().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Enable login to the node through SSH. Default to `false`.
*/
public val enableSsh: Output?
get() = javaResource.enableSsh().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Custom Image support. Must based on CentOS7 or AliyunLinux2.
*/
public val imageId: Output
get() = javaResource.imageId().applyValue({ args0 -> args0 })
/**
* Install cloud monitor agent on ECS. Default to `true`.
*/
public val installCloudMonitor: Output?
get() = javaResource.installCloudMonitor().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Enable to create advanced security group. default: false. See [Advanced security group](https://www.alibabacloud.com/help/doc-detail/120621.htm).
*/
public val isEnterpriseSecurityGroup: Output
get() = javaResource.isEnterpriseSecurityGroup().applyValue({ args0 -> args0 })
/**
* The keypair of ssh login cluster node, you have to create it first. You have to specify one of `password` `key_name` `kms_encrypted_password` fields.
*/
public val keyName: Output?
get() = javaResource.keyName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* An KMS encrypts password used to a cs kubernetes. You have to specify one of `password` `key_name` `kms_encrypted_password` fields.
*/
public val kmsEncryptedPassword: Output?
get() = javaResource.kmsEncryptedPassword().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating a cs kubernetes with `kms_encrypted_password`. See [Encryption Context](https://www.alibabacloud.com/help/doc-detail/42975.htm). It is valid when `kms_encrypted_password` is set.
*/
public val kmsEncryptionContext: Output