Skip to content

Instantly share code, notes, and snippets.

@HauptJ
Created June 15, 2023 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save HauptJ/ebddb285dbc16291e1e800730effea2d to your computer and use it in GitHub Desktop.
Save HauptJ/ebddb285dbc16291e1e800730effea2d to your computer and use it in GitHub Desktop.
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
# Set the variable value in *.tfvars file
# or using -var="do_token=..." CLI option
variable "do_token" {}
# Configure the DigitalOcean Provider
provider "digitalocean" {
token = var.do_token
}
resource "digitalocean_kubernetes_cluster" "demo" {
name = "demo"
region = "nyc1"
version = "1.27.2-do.0"
node_pool {
name = "worker-nodes"
size = "s-2vcpu-4gb"
node_count = 3
}
}
output "kubeconfig" {
value = digitalocean_kubernetes_cluster.demo.kube_config
sensitive = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment