Create FOS

parent 0093cc5a
Pipeline #10 passed with stage
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "ops-ski"
workspaces {
name = "terraform-infrasture"
}
}
}
resource "digitalocean_project" "ops_ski" {
name = "ops-ski"
description = "Infrastructure for ops-ski."
purpose = "Web Application"
environment = "Production"
}
resource "digitalocean_domain" "ops_ski" {
name = "ops.ski"
}
resource "digitalocean_record" "fos" {
domain = digitalocean_domain.ops_ski.name
type = "A"
name = "fos"
value = digitalocean_droplet.fos.ipv4_address
}
resource "digitalocean_droplet" "fos" {
image = "ubuntu-18-04-x64"
name = "fos.ops.ski"
region = "sfo2"
size = "s-2vcpu-2gb"
ipv6 = true
private_networking = true
volume_ids = [
digitalocean_volume.fos_disk1.id
]
ssh_keys = [
digitalocean_ssh_key.ops_ski_tf.id
]
}
resource "digitalocean_volume" "fos_disk1" {
region = "sfo2"
name = "fos-disk1"
size = 100
initial_filesystem_type = "ext4"
description = "FOS's first data disk"
}
resource "digitalocean_project_resources" "fos" {
project = digitalocean_project.ops_ski.id
resources = [
digitalocean_droplet.fos.urn
]
}
# output "ops-ski-ns" {
# value = "value"
# }
variable "do_token" {}
# Configure the DigitalOcean Provider
provider "digitalocean" {
token = var.do_token
}
resource "digitalocean_ssh_key" "ops_ski_tf" {
name = "Terraform SSH Key"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTuNOfKNQhwtKoLJej9x95NK51WkqoRdZEV+6Ks0R/CjiFZ2ajD+EZzle3tXmjK76RiKHu3EdhBtVXIjMukmV6ygh/hVjzryUiWta4zFlywgD/CaiBVU0zKggwKT53rFJ1s3OSTdp43f0iHOdZFltIp/iiehM3BiDC1rWpHLUsYJKvdw7ktpryEOhIdAeWz0he8lzOUeEOprvcTYU0mtKPSI30Ly/uS7FtAgzcnrqrvpCZ/6lOr/VbBZLESxrJZFxK0DvHeGZQxpcS+M8bKqw3beYGrYmL1xE3a+28S6ob90ulwfpJqWgrGu2h/FZgyf6VkxYh4SCcuKlZajc29n2t"
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment