Adds digital ocean droplet
This commit is contained in:
parent
76911c299b
commit
db38793584
|
@ -0,0 +1,16 @@
|
||||||
|
resource "digitalocean_droplet" "sydney" {
|
||||||
|
image = ""
|
||||||
|
name = "sydney.captnemo.in"
|
||||||
|
region = "blr1"
|
||||||
|
size = "1gb"
|
||||||
|
ipv6 = true
|
||||||
|
private_networking = true
|
||||||
|
resize_disk = true
|
||||||
|
|
||||||
|
tags = [
|
||||||
|
"bangalore",
|
||||||
|
"proxy",
|
||||||
|
"sydney",
|
||||||
|
"vpn",
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
resource "digitalocean_firewall" "web" {
|
||||||
|
name = "web-inbound"
|
||||||
|
inbound_rule = [
|
||||||
|
{
|
||||||
|
protocol = "tcp"
|
||||||
|
port_range = "80"
|
||||||
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
protocol = "tcp"
|
||||||
|
port_range = "443"
|
||||||
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "digitalocean_firewall" "ssh" {
|
||||||
|
name = "ssh-inbound"
|
||||||
|
inbound_rule = [
|
||||||
|
{
|
||||||
|
protocol = "tcp"
|
||||||
|
port_range = "22"
|
||||||
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
protocol = "tcp"
|
||||||
|
port_range = "222"
|
||||||
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
protocol = "tcp"
|
||||||
|
port_range = "24"
|
||||||
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
resource "digitalocean_floating_ip" "sydney" {
|
||||||
|
droplet_id = "${digitalocean_droplet.sydney.id}"
|
||||||
|
region = "${digitalocean_droplet.sydney.region}"
|
||||||
|
}
|
4
main.tf
4
main.tf
|
@ -49,3 +49,7 @@ module "monitoring" {
|
||||||
gf-security-admin-password = "${var.gf-security-admin-password}"
|
gf-security-admin-password = "${var.gf-security-admin-password}"
|
||||||
domain = "bb8.fun"
|
domain = "bb8.fun"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "digitalocean" {
|
||||||
|
source = "digitalocean"
|
||||||
|
}
|
||||||
|
|
|
@ -13,3 +13,7 @@ provider "mysql" {
|
||||||
username = "root"
|
username = "root"
|
||||||
password = "${var.mysql_root_password}"
|
password = "${var.mysql_root_password}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provider digitalocean {
|
||||||
|
token = "${var.digitalocean-token}"
|
||||||
|
}
|
||||||
|
|
|
@ -44,3 +44,4 @@ variable "gf-security-admin-password" {
|
||||||
variable "gitea-secret-key" {}
|
variable "gitea-secret-key" {}
|
||||||
variable "gitea-internal-token" {}
|
variable "gitea-internal-token" {}
|
||||||
variable "gitea-smtp-password" {}
|
variable "gitea-smtp-password" {}
|
||||||
|
variable "digitalocean-token" {}
|
||||||
|
|
Loading…
Reference in New Issue