Add DO project and droplets Terraform config

This commit is contained in:
Jeremy Dormitzer 2020-12-03 16:26:28 -05:00
parent e899c3e85e
commit f6ce08450a
15 changed files with 209 additions and 0 deletions

View File

@ -0,0 +1,12 @@
provider "digitalocean" {
token = var.do_token
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}
resource "digitalocean_project" "jeremy_dormitzer" {
name = "jeremy.dormitzer"
environment = "Production"
description = "Personal infrastructure"
purpose = "Personal infrastructure"
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.3.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "mgmt/do-project-jeremydormitzer.tfstate"
}
}

View File

@ -0,0 +1,11 @@
variable "do_token" {
type = string
}
variable "spaces_access_id" {
type = string
}
variable "spaces_secret_key" {
type = string
}

View File

@ -0,0 +1,13 @@
provider "digitalocean" {
token = var.do_token
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}
resource "digitalocean_droplet" "git_jeremydormitzer_com" {
name = "git.jeremydormitzer.com"
image = "41695378"
region = "nyc3"
size = "s-1vcpu-1gb"
backups = true
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.3.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "prod/git-jeremydormitzer-com.tfstate"
}
}

View File

@ -0,0 +1,11 @@
variable "do_token" {
type = string
}
variable "spaces_access_id" {
type = string
}
variable "spaces_secret_key" {
type = string
}

View File

@ -0,0 +1,13 @@
provider "digitalocean" {
token = var.do_token
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}
resource "digitalocean_droplet" "jdormit_website" {
name = "jdormit-website"
image = "50901536"
region = "nyc1"
size = "s-1vcpu-1gb"
backups = true
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.3.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "prod/jdormit-website.tfstate"
}
}

View File

@ -0,0 +1,11 @@
variable "do_token" {
type = string
}
variable "spaces_access_id" {
type = string
}
variable "spaces_secret_key" {
type = string
}

View File

@ -0,0 +1,13 @@
provider "digitalocean" {
token = var.do_token
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}
resource "digitalocean_droplet" "justin_ghost_site" {
name = "justin-ghost-site"
image = "53296993"
region = "nyc3"
size = "s-1vcpu-1gb"
backups = true
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.3.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "prod/justin-ghost-site.tfstate"
}
}

View File

@ -0,0 +1,11 @@
variable "do_token" {
type = string
}
variable "spaces_access_id" {
type = string
}
variable "spaces_secret_key" {
type = string
}

13
prod/syncthing/main.tf Normal file
View File

@ -0,0 +1,13 @@
provider "digitalocean" {
token = var.do_token
spaces_access_id = var.spaces_access_id
spaces_secret_key = var.spaces_secret_key
}
resource "digitalocean_droplet" "jdormit_syncthing" {
name = "jdormit-syncthing"
image = "53893572"
region = "nyc1"
size = "s-1vcpu-1gb"
backups = true
}

View File

@ -0,0 +1,18 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.3.0"
}
}
backend "s3" {
skip_credentials_validation = true
skip_metadata_api_check = true
# Need to specify an AWS region to stop Terraform complaining
region = "us-east-1"
endpoint = "nyc3.digitaloceanspaces.com"
bucket = "jdormit-tf-state"
key = "prod/syncthing.tfstate"
}
}

View File

@ -0,0 +1,11 @@
variable "do_token" {
type = string
}
variable "spaces_access_id" {
type = string
}
variable "spaces_secret_key" {
type = string
}