-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
60 lines (50 loc) · 1.08 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
provider "digitalocean" {
token = var.do_token
}
resource "digitalocean_droplet" "jenkins" {
image = "ubuntu-22-04-x64"
name = "jenkins"
region = var.region
size = "s-2vcpu-2gb"
}
data "digitalocean_ssh_key" "lobo" {
name = var.ssh_key_name
}
resource "digitalocean_droplet" "conversor" {
image = "ubuntu-18-04-x64"
name = "conversor"
region = var.region
size = "s-2vcpu-2gb"
ssh_keys = [data.digitalocean_ssh_key.lobo.id]
}
resource "digitalocean_kubernetes_cluster" "k8s-dev" {
name = "k8s-dev"
region = var.region
# Grab the latest version slug from `doctl kubernetes options versions`
version = "1.25.4-do.0"
node_pool {
name = "default"
size = "s-2vcpu-2gb"
node_count = 1
}
}
variable "do_token" {
default = ""
}
variable "ssh_key_name" {
default = ""
}
variable "region" {
default = ""
}
output "jenkins_ip" {
value = digitalocean_droplet.conversor.ipv4_address
}