Created
June 15, 2023 01:21
-
-
Save HauptJ/ebddb285dbc16291e1e800730effea2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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