-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
301 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
presentation_name = "presentation-server-dev" | ||
application_name = "application-server-dev" | ||
region = "nyc1" | ||
size = "s-1vcpu-1gb" | ||
image = "ubuntu-20-04-x64" | ||
digitalocean_token = var.digitalocean_token | ||
presentation_name = "presentation-server-dev" | ||
application_name = "application-server-dev" | ||
presentation_region = "nyc1" | ||
presentation_size = "s-1vcpu-1gb" | ||
presentation_image = "ubuntu-20-04-x64" | ||
application_region = "nyc1" | ||
application_size = "s-1vcpu-1gb" | ||
application_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
database_name = "database-server-dev" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" | ||
database_name = "database-server-dev" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
presentation_name = "presentation-server-prod" | ||
application_name = "application-server-prod" | ||
region = "nyc1" | ||
size = "s-1vcpu-1gb" | ||
image = "ubuntu-20-04-x64" | ||
digitalocean_token = "your-digitalocean-token" | ||
presentation_name = "presentation-server-prod" | ||
application_name = "application-server-prod" | ||
presentation_region = "nyc1" | ||
presentation_size = "s-1vcpu-1gb" | ||
presentation_image = "ubuntu-20-04-x64" | ||
application_region = "nyc1" | ||
application_size = "s-1vcpu-1gb" | ||
application_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
database_name = "database-server-prod" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" | ||
database_name = "database-server-prod" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
presentation_name = "presentation-server-stage" | ||
application_name = "application-server-stage" | ||
region = "nyc1" | ||
size = "s-1vcpu-1gb" | ||
image = "ubuntu-20-04-x64" | ||
digitalocean_token = "your-digitalocean-token" | ||
presentation_name = "presentation-server-stage" | ||
application_name = "application-server-stage" | ||
presentation_region = "nyc1" | ||
presentation_size = "s-1vcpu-1gb" | ||
presentation_image = "ubuntu-20-04-x64" | ||
application_region = "nyc1" | ||
application_size = "s-1vcpu-1gb" | ||
application_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
database_name = "database-server-stage" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" | ||
database_name = "database-server-stage" | ||
database_region = "nyc1" | ||
database_size = "s-1vcpu-1gb" | ||
database_image = "ubuntu-20-04-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
module "compute" { | ||
source = "./compute" | ||
module "networking" { | ||
source = "./modules/networking" | ||
|
||
digitalocean_token = var.digitalocean_token | ||
|
||
presentation_name = var.presentation_name | ||
presentation_region = var.presentation_region | ||
presentation_size = var.presentation_size | ||
presentation_image = var.presentation_image | ||
|
||
presentation_name = var.presentation_name | ||
application_name = var.application_name | ||
region = var.region | ||
size = var.size | ||
image = var.image | ||
} | ||
application_name = var.application_name | ||
application_region = var.application_region | ||
application_size = var.application_size | ||
application_image = var.application_image | ||
|
||
module "storage" { | ||
source = "./modules/storage" | ||
|
||
database_name = var.database_name | ||
database_region = var.database_region | ||
database_size = var.database_size | ||
database_image = var.database_image | ||
} | ||
|
||
module "networking" { | ||
source = "./modules/networking" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
resource "digitalocean_droplet" "presentation" { | ||
name = var.presentation_name | ||
region = var.region | ||
size = var.size | ||
image = var.image | ||
name = var.presentation_name | ||
region = var.presentation_region | ||
size = var.presentation_size | ||
image = var.presentation_image | ||
} | ||
|
||
resource "digitalocean_droplet" "application" { | ||
name = var.application_name | ||
region = var.region | ||
size = var.size | ||
image = var.image | ||
name = var.application_name | ||
region = var.application_region | ||
size = var.application_size | ||
image = var.application_image | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
provider "digitalocean" { | ||
token = var.digitalocean_token | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
variable "presentation_name" { | ||
description = "Name for the presentation server" | ||
description = "Name of the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_region" { | ||
description = "Region for the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_size" { | ||
description = "Size of the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_image" { | ||
description = "Image for the presentation droplet" | ||
type = string | ||
default = "presentation-server" | ||
} | ||
|
||
variable "application_name" { | ||
description = "Name for the application server" | ||
description = "Name of the application droplet" | ||
type = string | ||
default = "application-server" | ||
} | ||
|
||
variable "region" { | ||
description = "Region for the droplets" | ||
variable "application_region" { | ||
description = "Region for the application droplet" | ||
type = string | ||
default = "nyc1" | ||
} | ||
|
||
variable "size" { | ||
description = "Size of the droplets" | ||
variable "application_size" { | ||
description = "Size of the application droplet" | ||
type = string | ||
default = "s-1vcpu-1gb" | ||
} | ||
|
||
variable "image" { | ||
description = "Image for the droplets" | ||
variable "application_image" { | ||
description = "Image for the application droplet" | ||
type = string | ||
default = "ubuntu-20-04-x64" | ||
} | ||
|
||
variable "digitalocean_token" { | ||
description = "DigitalOcean API token." | ||
description = "Digitalocean token" | ||
type = string | ||
default = "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,42 @@ | ||
resource "digitalocean_private_networking" "network" { | ||
name = "private-network" | ||
droplet_ids = [ | ||
digitalocean_droplet.presentation.id, | ||
digitalocean_droplet.application.id, | ||
digitalocean_droplet.database.id | ||
] | ||
module "compute" { | ||
source = "../compute" | ||
|
||
presentation_name = var.presentation_name | ||
presentation_region = var.presentation_region | ||
presentation_size = var.presentation_size | ||
presentation_image = var.presentation_image | ||
|
||
application_name = var.application_name | ||
application_region = var.application_region | ||
application_size = var.application_size | ||
application_image = var.application_image | ||
|
||
digitalocean_token = var.digitalocean_token | ||
|
||
} | ||
|
||
module "storage" { | ||
source = "../storage" | ||
|
||
database_name = var.database_name | ||
database_region = var.database_region | ||
database_size = var.database_size | ||
database_image = var.database_image | ||
|
||
digitalocean_token = var.digitalocean_token | ||
} | ||
|
||
resource "digitalocean_firewall" "firewall" { | ||
name = "firewall" | ||
droplet_ids = [ | ||
digitalocean_droplet.presentation.id, | ||
digitalocean_droplet.application.id, | ||
digitalocean_droplet.database.id | ||
module.compute.presentation_droplet_id, | ||
module.compute.application_droplet_id, | ||
module.storage.database_droplet_id | ||
] | ||
|
||
inbound_rule { | ||
protocol = "tcp" | ||
port_range = "80" | ||
source_type = "any" | ||
protocol = "tcp" | ||
port_range = "80" | ||
source_addresses = ["0.0.0.0/0"] | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
output "private_network_id" { | ||
description = "ID of the private network." | ||
value = digitalocean_private_networking.network.id | ||
} | ||
|
||
output "firewall_id" { | ||
description = "ID of the firewall." | ||
value = digitalocean_firewall.firewall.id | ||
value = digitalocean_firewall.firewall.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
provider "digitalocean" { | ||
token = var.digitalocean_token | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
variable "presentation_name" { | ||
description = "Name of the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_region" { | ||
description = "Region for the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_size" { | ||
description = "Size of the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "presentation_image" { | ||
description = "Image for the presentation droplet" | ||
type = string | ||
} | ||
|
||
variable "application_name" { | ||
description = "Name of the application droplet" | ||
type = string | ||
} | ||
|
||
variable "application_region" { | ||
description = "Region for the application droplet" | ||
type = string | ||
} | ||
|
||
variable "application_size" { | ||
description = "Size of the application droplet" | ||
type = string | ||
} | ||
|
||
variable "application_image" { | ||
description = "Image for the application droplet" | ||
type = string | ||
} | ||
|
||
variable "digitalocean_token" { | ||
description = "Digitalocean token" | ||
type = string | ||
} | ||
|
||
variable "database_name" { | ||
description = "Name of the database" | ||
type = string | ||
} | ||
|
||
variable "database_region" { | ||
description = "Region where the database is located" | ||
type = string | ||
} | ||
|
||
variable "database_size" { | ||
description = "Size of the database" | ||
type = string | ||
} | ||
|
||
variable "database_image" { | ||
description = "Image for the database" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
terraform { | ||
required_providers { | ||
digitalocean = { | ||
source = "digitalocean/digitalocean" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
provider "digitalocean" { | ||
token = var.digitalocean_token | ||
} |
Oops, something went wrong.