mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2025-01-23 06:39:54 +01:00
add civo terraform templates
This commit is contained in:
parent
e59a26f1ce
commit
e5d1459169
5
terraform/civo/firewall.tf
Normal file
5
terraform/civo/firewall.tf
Normal 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
|
||||
}
|
@ -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"
|
||||
# }
|
||||
|
3
terraform/civo/network.tf
Normal file
3
terraform/civo/network.tf
Normal file
@ -0,0 +1,3 @@
|
||||
resource "civo_network" "your_network" {
|
||||
label = "your-network-label"
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
# Initial Provider Configuration for CIVO
|
||||
|
||||
terraform {
|
||||
required_version = ">= 0.13.0"
|
||||
required_version = ">= 1.5.0"
|
||||
|
||||
required_providers {
|
||||
civo = {
|
||||
|
Loading…
Reference in New Issue
Block a user