add civo terraform templates

This commit is contained in:
Christian Lempa 2024-01-12 10:50:17 +01:00
parent e59a26f1ce
commit e5d1459169
4 changed files with 23 additions and 10 deletions

View File

@ -0,0 +1,5 @@
resource "civo_firewall" "your_firewall" {
name = "your-firewall-name"
network_id = civo_network.your_network.id
create_default_rules = true
}

View File

@ -4,15 +4,20 @@
# Create a new Kubernetes Cluster
resource "civo_kubernetes_cluster" "your-kubernetes-cluster" {
name = "your-kubernetes-cluster"
applications = ""
num_target_nodes = 2
target_nodes_size = element(data.civo_size.xsmall.sizes, 0).name
name = "your-kubernetes-cluster"
applications = ""
firewall_id = civo_firewall.your_firewall.id
network_id = civo_network.your_network.id
pools {
size = element(data.civo_size.k8s_std_small.sizes, 0).name
node_count = 3
}
# (Optional) add depenencies on other resources
depends_on = [ civo_firewall.your_firewall, civo_network.your_network ]
}
# (Optional) Time Sleep elements for other Objects that need to wait a few seconds after the Cluster deployment
resource "time_sleep" "wait_for_kubernetes" {
depends_on = [civo_kubernetes_cluster.your-kubernetes-cluster]
create_duration = "20s"
}
# resource "time_sleep" "wait_for_kubernetes" {
# depends_on = [civo_kubernetes_cluster.your-kubernetes-cluster]
# create_duration = "20s"
# }

View File

@ -0,0 +1,3 @@
resource "civo_network" "your_network" {
label = "your-network-label"
}

View File

@ -3,7 +3,7 @@
# Initial Provider Configuration for CIVO
terraform {
required_version = ">= 0.13.0"
required_version = ">= 1.5.0"
required_providers {
civo = {