Provides access to the available DigitalOcean Kubernetes Service versions.
data "digitalocean_kubernetes_versions" "example" {}
output "k8s-versions" {
value = data.digitalocean_kubernetes_versions.example.valid_versions
}
data "digitalocean_kubernetes_versions" "example" {}
resource "digitalocean_kubernetes_cluster" "example-cluster" {
name = "example-cluster"
region = "lon1"
version = data.digitalocean_kubernetes_versions.example.latest_version
node_pool {
name = "default"
size = "s-1vcpu-2gb"
node_count = 3
}
}
data "digitalocean_kubernetes_versions" "example" {
version_prefix = "1.22."
}
resource "digitalocean_kubernetes_cluster" "example-cluster" {
name = "example-cluster"
region = "lon1"
version = data.digitalocean_kubernetes_versions.example.latest_version
node_pool {
name = "default"
size = "s-1vcpu-2gb"
node_count = 3
}
}
The following arguments are supported:
version_prefix
- (Optional) If provided, Terraform will only return versions that match the string prefix. For example, 1.15.
will match all 1.15.x series releases.The following attributes are exported:
valid_versions
- A list of available versions.latest_version
- The most recent version available.