From b84c14386aa766b338fe26958c0779d540fd9166 Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Thu, 19 May 2022 18:35:50 -0600 Subject: [PATCH 01/41] module template --- .../main-gateway/.terraform.lock.hcl | 54 +++++++++++++++++++ .../digitalocean/container_registry/README.md | 2 + .../digitalocean/database/mongodb/README.md | 2 + .../digitalocean/database/mysql/README.md | 2 + .../digitalocean/database/postgree/README.md | 2 + .../digitalocean/database/redis/README.md | 2 + .../digitalocean/droplet/README.md | 2 + .../digitalocean/github_oidc/README.md | 2 + .../digitalocean/kubernetes/README.md | 2 + .../digitalocean/load_balancer/README.md | 2 + .../digitalocean/monitoring/README.md | 2 + .../digitalocean/space/README.md | 2 + .../digitalocean/volume/README.md | 2 + terraform-modules/digitalocean/vpc/README.md | 2 + 14 files changed, 80 insertions(+) create mode 100644 terraform-modules/aws/istio-networking/main-gateway/.terraform.lock.hcl create mode 100644 terraform-modules/digitalocean/container_registry/README.md create mode 100644 terraform-modules/digitalocean/database/mongodb/README.md create mode 100644 terraform-modules/digitalocean/database/mysql/README.md create mode 100644 terraform-modules/digitalocean/database/postgree/README.md create mode 100644 terraform-modules/digitalocean/database/redis/README.md create mode 100644 terraform-modules/digitalocean/droplet/README.md create mode 100644 terraform-modules/digitalocean/github_oidc/README.md create mode 100644 terraform-modules/digitalocean/kubernetes/README.md create mode 100644 terraform-modules/digitalocean/load_balancer/README.md create mode 100644 terraform-modules/digitalocean/monitoring/README.md create mode 100644 terraform-modules/digitalocean/space/README.md create mode 100644 terraform-modules/digitalocean/volume/README.md create mode 100644 terraform-modules/digitalocean/vpc/README.md diff --git a/terraform-modules/aws/istio-networking/main-gateway/.terraform.lock.hcl b/terraform-modules/aws/istio-networking/main-gateway/.terraform.lock.hcl new file mode 100644 index 000000000..51d0ce5ee --- /dev/null +++ b/terraform-modules/aws/istio-networking/main-gateway/.terraform.lock.hcl @@ -0,0 +1,54 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/gavinbunney/kubectl" { + version = "1.13.1" + constraints = ">= 1.6.2" + hashes = [ + "h1:6RC15zES07oX9Ue20RrGlssfVeIqyhcHUvn2dHAMu1E=", + "zh:212c030cb975e46e3a85a6850c16773974f4498042a45c73b883b25f6e05962d", + "zh:213d1be8a231b04fdc55fd027479dbf0ae5b7ab891804b64f464db771d091ecd", + "zh:45f37b5c43f85d79973d0b890f774531a65def7f8436e435a4e259198f1c62de", + "zh:5a362871827f8582d6129b9c8b7d73c5e4e181155cef4cba1fe0408880db52db", + "zh:78986fdb4c41ac35815e4d41832d24b41b0aac046c046f21db92205115d16bae", + "zh:a6d07a9f066c386f44d61e7e2e83133663e3049f5c6b153fa5601b85cbb788b1", + "zh:bb307e902d2401df42205d57e36a2e094765b87b12f99a24ec2af411bef3c0fa", + "zh:dc3281f9fab38b8daf76d5f0073d2e323574f03d4cef338d6a363380f7f7bb59", + "zh:eb30e7fef17e7630858070d23a59375ba3a87fceaffde1c722338b1ad88df568", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.1.0" + hashes = [ + "h1:0C8acviZs0ttKv+vo6gbl49n6L+sQBIDgGdMmkrSAGE=", + "zh:0e4143cf20943e0efd96805fe69b5527dd89a023fa67f39c5f4128e5ca736e91", + "zh:0f208f3497a2bc977204d195085466804f7c6c9eaa1a3cf864ab2631adf683dd", + "zh:2bcfcaad7957504d7572063fc9178a2f4636ad98f24cdd5c74d4ffcc750db5a6", + "zh:38100b0cddc1716f2a58d93e55a34272862ffe571439b6d472af26d79a2b5a12", + "zh:3bcf9b33dd9d44e9c9562ed45b05511c65ef35496e5a48f58aa31427a76e037f", + "zh:6a808deb14ef7b7f8e4f87ceb996bfac88a99d654489eb99d0f2325a0e7b3c09", + "zh:81b49e8f8d3e8ec220c206c2f9af83455f1b674481d11ffd279897a2972ec66b", + "zh:a37a637c48cd7be608ce248bbed717d154e70b328fccc31ae29ec94f158d64cd", + "zh:bdefee374253e800402c5f2ef4637836ba7d6c6889a6c8bb4ffd0602e95b8877", + "zh:cdc2df5a3bd5cdeff497572a74c023e102e087dd39610afeef27b1c3d15541a0", + "zh:f3fc038d953b35f4ed3572a71d92151ed99d56a9bc3a3eaa6670be6120e30588", + ] +} + +provider "registry.terraform.io/hashicorp/template" { + version = "2.2.0" + hashes = [ + "h1:0wlehNaxBX7GJQnPfQwTNvvAf38Jm0Nv7ssKGMaG6Og=", + "zh:01702196f0a0492ec07917db7aaa595843d8f171dc195f4c988d2ffca2a06386", + "zh:09aae3da826ba3d7df69efeb25d146a1de0d03e951d35019a0f80e4f58c89b53", + "zh:09ba83c0625b6fe0a954da6fbd0c355ac0b7f07f86c91a2a97849140fea49603", + "zh:0e3a6c8e16f17f19010accd0844187d524580d9fdb0731f675ffcf4afba03d16", + "zh:45f2c594b6f2f34ea663704cc72048b212fe7d16fb4cfd959365fa997228a776", + "zh:77ea3e5a0446784d77114b5e851c970a3dde1e08fa6de38210b8385d7605d451", + "zh:8a154388f3708e3df5a69122a23bdfaf760a523788a5081976b3d5616f7d30ae", + "zh:992843002f2db5a11e626b3fc23dc0c87ad3729b3b3cff08e32ffb3df97edbde", + "zh:ad906f4cebd3ec5e43d5cd6dc8f4c5c9cc3b33d2243c89c5fc18f97f7277b51d", + "zh:c979425ddb256511137ecd093e23283234da0154b7fa8b21c2687182d9aea8b2", + ] +} diff --git a/terraform-modules/digitalocean/container_registry/README.md b/terraform-modules/digitalocean/container_registry/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/container_registry/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/database/mongodb/README.md b/terraform-modules/digitalocean/database/mongodb/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/database/mongodb/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/database/mysql/README.md b/terraform-modules/digitalocean/database/mysql/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/database/mysql/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/database/postgree/README.md b/terraform-modules/digitalocean/database/postgree/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/database/postgree/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/database/redis/README.md b/terraform-modules/digitalocean/database/redis/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/database/redis/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/README.md b/terraform-modules/digitalocean/droplet/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/droplet/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/github_oidc/README.md b/terraform-modules/digitalocean/github_oidc/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/github_oidc/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/kubernetes/README.md b/terraform-modules/digitalocean/kubernetes/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/kubernetes/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/load_balancer/README.md b/terraform-modules/digitalocean/load_balancer/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/load_balancer/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/monitoring/README.md b/terraform-modules/digitalocean/monitoring/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/monitoring/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/space/README.md b/terraform-modules/digitalocean/space/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/space/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/README.md b/terraform-modules/digitalocean/volume/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/volume/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/README.md b/terraform-modules/digitalocean/vpc/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/vpc/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file From 0f36132cb6d68ef613fc31accae93f453e1ed1dc Mon Sep 17 00:00:00 2001 From: Bayron Carranza Date: Thu, 19 May 2022 19:41:11 -0600 Subject: [PATCH 02/41] digital ocean project module --- .../digitalocean/project/main.tf | 14 +++++++++++ .../digitalocean/project/output.tf | 9 ++++++++ .../digitalocean/project/variables.tf | 23 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 terraform-modules/digitalocean/project/main.tf create mode 100644 terraform-modules/digitalocean/project/output.tf create mode 100644 terraform-modules/digitalocean/project/variables.tf diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf new file mode 100644 index 000000000..cd3a7ff19 --- /dev/null +++ b/terraform-modules/digitalocean/project/main.tf @@ -0,0 +1,14 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "~> 2.0" + } + } +} +resource "digitalocean_project" "this" { + name = var.name + description = var.description + purpose = var.purpose + environment = var.environment +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf new file mode 100644 index 000000000..f7cfe8dcc --- /dev/null +++ b/terraform-modules/digitalocean/project/output.tf @@ -0,0 +1,9 @@ +output "project_id" { + description = "The id of the project" + value = module.id +} + +output "project_owner_uuid" { + description = "the unique universal identifier of the project owner." + value = module.owner_uuid +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/project/variables.tf b/terraform-modules/digitalocean/project/variables.tf new file mode 100644 index 000000000..8dd4bfa19 --- /dev/null +++ b/terraform-modules/digitalocean/project/variables.tf @@ -0,0 +1,23 @@ +variable "name" { + type = string + description = "The name of the project" + default = "playground" +} + +variable "description" { + type = string + description = "The name of description" + default = "A project to represent development resources." +} + +variable "purpose" { + type = string + description = "A purpose for the project" + default = "Web Application" +} + +variable "environment" { + type = string + description = "Kind of dev, qa or prod" + default = "dev" +} \ No newline at end of file From b645a03dd2bc9ab4ab80e8d6e2336aa50e0c0ed1 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 18:11:42 -0600 Subject: [PATCH 03/41] environment base --- .../terragrunt-dev/SFO3/region.hcl | 4 +++ .../terragrunt-dev/050-project/terragrunt.hcl | 33 +++++++++++++++++ .../SFO3/terragrunt-dev/environment.hcl | 11 ++++++ .../digitalocean/terragrunt-dev/common.hcl | 5 +++ .../terragrunt-dev/terragrunt.hcl | 35 +++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/environment.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/common.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/terragrunt.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl new file mode 100644 index 000000000..809d606cc --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl @@ -0,0 +1,4 @@ +locals { + digitalocean_region = "SFO3" + aws_region = "us-east-1" +} \ No newline at end of file diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl new file mode 100644 index 000000000..81d0c77ef --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl @@ -0,0 +1,33 @@ +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +terraform { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/project?ref=digitalocean-kube-ops" +} + +# --------------------------------------------------------------------------------------------------------------------- +# Locals are named constants that are reusable within the configuration. +# --------------------------------------------------------------------------------------------------------------------- +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + + # Load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) +} + +# --------------------------------------------------------------------------------------------------------------------- +# MODULE PARAMETERS +# These are the variables we have to pass in to use the module specified in the terragrunt configuration above +# --------------------------------------------------------------------------------------------------------------------- +inputs = { + name = local.environment_vars.project_name + description = "Digital Ocean Managed Kube" + purpose = "Infra Testing" + environment = "dev" +} \ No newline at end of file diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/environment.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/environment.hcl new file mode 100644 index 000000000..c2c1588e2 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/environment.hcl @@ -0,0 +1,11 @@ +locals { + project_name = "digitalocean-managekube" + cluster_name = "digitalocean-terragrunt-dev" + domain_name = "digitalocean.managedkube.com" + vpc = { + availability_zones = [] + cidr = "" + private_subnets = [] + public_subnets = [] + } +} \ No newline at end of file diff --git a/terraform-environments/digitalocean/terragrunt-dev/common.hcl b/terraform-environments/digitalocean/terragrunt-dev/common.hcl new file mode 100644 index 000000000..5f83cc2ed --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/common.hcl @@ -0,0 +1,5 @@ +locals { + environment_name = "terragrunt-dev" + repository_name = "ManagedKube/kubernetes-ops" + base_repository_path = "terraform-environments/digitalocean/terragrunt-dev" +} diff --git a/terraform-environments/digitalocean/terragrunt-dev/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/terragrunt.hcl new file mode 100644 index 000000000..b5d5a3c79 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/terragrunt.hcl @@ -0,0 +1,35 @@ +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + +} + +# Generate an AWS provider block +generate "provider" { + path = "provider.tf" + if_exists = "skip" + contents = < Date: Sat, 21 May 2022 18:25:13 -0600 Subject: [PATCH 04/41] bugfix name --- .../SFO3/terragrunt-dev/050-project/terragrunt.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl index 81d0c77ef..5c6d5dcd6 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl @@ -26,7 +26,7 @@ locals { # These are the variables we have to pass in to use the module specified in the terragrunt configuration above # --------------------------------------------------------------------------------------------------------------------- inputs = { - name = local.environment_vars.project_name + name = local.common_vars.locals.project_name description = "Digital Ocean Managed Kube" purpose = "Infra Testing" environment = "dev" From 747d69b951970758f6163fa547307bad308cbb07 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 18:33:31 -0600 Subject: [PATCH 05/41] bugfix vars --- .../SFO3/terragrunt-dev/050-project/terragrunt.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl index 5c6d5dcd6..7e26df1da 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl @@ -26,7 +26,7 @@ locals { # These are the variables we have to pass in to use the module specified in the terragrunt configuration above # --------------------------------------------------------------------------------------------------------------------- inputs = { - name = local.common_vars.locals.project_name + name = local.environment_vars.locals.project_name description = "Digital Ocean Managed Kube" purpose = "Infra Testing" environment = "dev" From 4d83ef2bda14d85a9dd4ab18a92f6ac30bcf8c64 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 18:48:57 -0600 Subject: [PATCH 06/41] bugfix this name --- terraform-modules/digitalocean/project/output.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index f7cfe8dcc..67e918b33 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -1,9 +1,9 @@ output "project_id" { description = "The id of the project" - value = module.id + value = this.id } output "project_owner_uuid" { description = "the unique universal identifier of the project owner." - value = module.owner_uuid + value = this.owner_uuid } \ No newline at end of file From 4b3646c6f0f393b6a50c2ba34e4e8923e70a890c Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 18:51:02 -0600 Subject: [PATCH 07/41] project name bugfix --- terraform-modules/digitalocean/project/main.tf | 2 +- terraform-modules/digitalocean/project/output.tf | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index cd3a7ff19..b8919580a 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -6,7 +6,7 @@ terraform { } } } -resource "digitalocean_project" "this" { +resource "digitalocean_project" "project" { name = var.name description = var.description purpose = var.purpose diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index 67e918b33..389d03564 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -1,9 +1,9 @@ output "project_id" { description = "The id of the project" - value = this.id + value = digitalocean_project.project.id } output "project_owner_uuid" { description = "the unique universal identifier of the project owner." - value = this.owner_uuid + value = digitalocean_project.project.owner_uuid } \ No newline at end of file From fafb94bcc17bc8bf33e3c9777423c2dea5cf13ab Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 19:11:53 -0600 Subject: [PATCH 08/41] remove output vars for testing --- terraform-modules/digitalocean/project/output.tf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index 389d03564..e69de29bb 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -1,9 +0,0 @@ -output "project_id" { - description = "The id of the project" - value = digitalocean_project.project.id -} - -output "project_owner_uuid" { - description = "the unique universal identifier of the project owner." - value = digitalocean_project.project.owner_uuid -} \ No newline at end of file From 1da4c72466de39dbf77f014eb756072eff5060f6 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 19:14:38 -0600 Subject: [PATCH 09/41] output vars --- terraform-modules/digitalocean/project/output.tf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index e69de29bb..c0317a5fd 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -0,0 +1,9 @@ +output "project_id" { + description = "The id of the project" + value = digitalocean_project.project.id +} + +output "project_owner_uuid" { + description = "the unique universal identifier of the project owner." + value = digitalocean_project.project.owner_uuid +} From 676a3dc5dc7ed92b24572d609636b4ece12d39aa Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 19:22:08 -0600 Subject: [PATCH 10/41] modify environment var --- .../SFO3/terragrunt-dev/050-project/terragrunt.hcl | 2 +- terraform-modules/digitalocean/project/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl index 7e26df1da..4a44ffb5c 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/terragrunt.hcl @@ -29,5 +29,5 @@ inputs = { name = local.environment_vars.locals.project_name description = "Digital Ocean Managed Kube" purpose = "Infra Testing" - environment = "dev" + environment = "development" } \ No newline at end of file diff --git a/terraform-modules/digitalocean/project/variables.tf b/terraform-modules/digitalocean/project/variables.tf index 8dd4bfa19..372492fef 100644 --- a/terraform-modules/digitalocean/project/variables.tf +++ b/terraform-modules/digitalocean/project/variables.tf @@ -19,5 +19,5 @@ variable "purpose" { variable "environment" { type = string description = "Kind of dev, qa or prod" - default = "dev" + default = "development" } \ No newline at end of file From 97815039c964bdb0993500f907ee7c9a7c5d1d16 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 19:32:26 -0600 Subject: [PATCH 11/41] token --- terraform-modules/digitalocean/project/main.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index b8919580a..18772ca45 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -6,6 +6,13 @@ terraform { } } } +variable "do_token" {} +variable "pvt_key" {} + +provider "digitalocean" { + token = var.do_token +} + resource "digitalocean_project" "project" { name = var.name description = var.description From 9fa8d0b94be0114ae64e5938b2c13893c650ae0f Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 21 May 2022 19:51:28 -0600 Subject: [PATCH 12/41] authorization --- terraform-modules/digitalocean/project/main.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 18772ca45..1e5a9698e 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -12,6 +12,9 @@ variable "pvt_key" {} provider "digitalocean" { token = var.do_token } +data "digitalocean_ssh_key" "terraform" { + name = "managekube" +} resource "digitalocean_project" "project" { name = var.name From d20f8885085581a8272505a38acc3bae78ddaa52 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 18:31:08 -0600 Subject: [PATCH 13/41] testing key --- terraform-modules/digitalocean/project/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 1e5a9698e..7f529b361 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -10,10 +10,10 @@ variable "do_token" {} variable "pvt_key" {} provider "digitalocean" { - token = var.do_token + token = "dop_v1_f06110b92b2c712c88467b0982daef5f11b80eff9ce1bc612ab5e3cda3b3a84c" } data "digitalocean_ssh_key" "terraform" { - name = "managekube" + name = "46:6e:72:9e:9e:48:8c:cf:df:9b:b7:f7:a2:89:28:3c" } resource "digitalocean_project" "project" { From 6a850637b0ef2c10a318a7b940a608b07b2adc1b Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 18:37:02 -0600 Subject: [PATCH 14/41] ssh key bugfix --- terraform-modules/digitalocean/project/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 7f529b361..ad05f2d0a 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -10,10 +10,10 @@ variable "do_token" {} variable "pvt_key" {} provider "digitalocean" { - token = "dop_v1_f06110b92b2c712c88467b0982daef5f11b80eff9ce1bc612ab5e3cda3b3a84c" + token = var.do_token } data "digitalocean_ssh_key" "terraform" { - name = "46:6e:72:9e:9e:48:8c:cf:df:9b:b7:f7:a2:89:28:3c" + name = "digitalocean" } resource "digitalocean_project" "project" { From 3782f2169ce5471bb4f23b2abe9101a2d89c2c39 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 18:47:17 -0600 Subject: [PATCH 15/41] testing digitalocean --- terraform-modules/digitalocean/project/main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index ad05f2d0a..5ebb81022 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -7,13 +7,14 @@ terraform { } } variable "do_token" {} -variable "pvt_key" {} provider "digitalocean" { token = var.do_token } + data "digitalocean_ssh_key" "terraform" { name = "digitalocean" + public_key = "${file("~/.ssh/digitalocean.pub")}" } resource "digitalocean_project" "project" { From 81014ef6818aad3e67826df3d8c538c275b51694 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 19:03:15 -0600 Subject: [PATCH 16/41] dto token --- terraform-modules/digitalocean/project/main.tf | 6 ------ 1 file changed, 6 deletions(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 5ebb81022..cee97a2ba 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -11,12 +11,6 @@ variable "do_token" {} provider "digitalocean" { token = var.do_token } - -data "digitalocean_ssh_key" "terraform" { - name = "digitalocean" - public_key = "${file("~/.ssh/digitalocean.pub")}" -} - resource "digitalocean_project" "project" { name = var.name description = var.description From 9e28d271a06a83a5d51ba8212979989a19d0958e Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 19:05:34 -0600 Subject: [PATCH 17/41] terragrunt lock --- terraform-modules/digitalocean/project/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index cee97a2ba..2bc0e8bb9 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -9,7 +9,7 @@ terraform { variable "do_token" {} provider "digitalocean" { - token = var.do_token + token = "dop_v1_76205feb4816c770ae08504abb51a02458366d3ed0a968b6fad57b1e64a501d0" } resource "digitalocean_project" "project" { name = var.name From 8d9b40f4c76d3e31b084e104081ab2945bdc9a30 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 19:33:32 -0600 Subject: [PATCH 18/41] variables testing --- terraform-modules/digitalocean/project/terraform.tfvars | 1 + 1 file changed, 1 insertion(+) create mode 100644 terraform-modules/digitalocean/project/terraform.tfvars diff --git a/terraform-modules/digitalocean/project/terraform.tfvars b/terraform-modules/digitalocean/project/terraform.tfvars new file mode 100644 index 000000000..3a6485411 --- /dev/null +++ b/terraform-modules/digitalocean/project/terraform.tfvars @@ -0,0 +1 @@ +do_token = "dop_v1_76205feb4816c770ae08504abb51a02458366d3ed0a968b6fad57b1e64a501d0" \ No newline at end of file From 35d05bf9cf9deffbae14abed4080e65c3b3677f8 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 19:37:11 -0600 Subject: [PATCH 19/41] testing token --- terraform-modules/digitalocean/project/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 2bc0e8bb9..cee97a2ba 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -9,7 +9,7 @@ terraform { variable "do_token" {} provider "digitalocean" { - token = "dop_v1_76205feb4816c770ae08504abb51a02458366d3ed0a968b6fad57b1e64a501d0" + token = var.do_token } resource "digitalocean_project" "project" { name = var.name From 6a8740d973d4faff359f93769c57160238009412 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 19:43:22 -0600 Subject: [PATCH 20/41] bugfix en var token --- .../050-project/.terraform.lock.hcl | 44 +++++++++++++++++++ .../digitalocean/project/main.tf | 5 --- .../digitalocean/project/terraform.tfvars | 1 - 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/.terraform.lock.hcl delete mode 100644 terraform-modules/digitalocean/project/terraform.tfvars diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/.terraform.lock.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/.terraform.lock.hcl new file mode 100644 index 000000000..ea601ca9b --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/050-project/.terraform.lock.hcl @@ -0,0 +1,44 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.19.0" + constraints = "~> 2.0" + hashes = [ + "h1:XcLoKA2a1MR4foSFeFbJgCADRvsXtN9SyIiJX0fSGys=", + "zh:01cee85343dee2dfc01499e19ef4e56b0c9260eee0a47329231cf500c07b4386", + "zh:099eeddf9baf9c282430231da501a8b96b3fb28507ce3b78e3a185cc9d4b3860", + "zh:191e090e8553355d91842163737d71051aeb499c8ddb23d2e8aae9dab2f8a1a5", + "zh:25356abb47769270730b0ddb0a3eb89aec637395cdcb77c309d23e55839e4461", + "zh:28876afb75ba5367d20e508e05c7657f90922142ff80d8a81a4d68b3381adb86", + "zh:404a304e37c3dec8017318b16ab701553e5242dc2460211346a9dd39242709a6", + "zh:40f53111b01fc78fdc7a6ba47a80d51c9a45e77e5b7d7d5bcae3a0c6f58ffbdf", + "zh:48f212068234df3dcfe5544c96b10403b15a190203742756d7d0573ee0857c17", + "zh:5189fe4fffdbff5c280f6741f55b2de9cb2b8c653cda0b2339c28cd1e3bc7884", + "zh:a7d5840ca789a03a285c67d2838af4d8687c99f3e8fac4ce56fcd23802a66156", + "zh:c0bd3c4555e5d7e6c96d3add3ddd8e41aa0df9e4a4518ad3b7f1d726a4e0a9f4", + "zh:d70a903a6d75533aa4713e255c9c967ec453195f2209439981f015f203805a6e", + "zh:db8110736bd47f99213d72309ebb720718a80b15ddd46e34a8ee9b2125903079", + "zh:e2180f334506601e0a6af8863159cc719ce584fdb23bd45ddc120f33d22cec19", + "zh:eb515a24d231e7f1ef344b9b88fa2071f760ec34fbb47d80bbacdf7e35f3daca", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.15.1" + hashes = [ + "h1:leEZu+Kv9JIvGpt8SfFkjftdR8KrFMkbUMQVnH0kvFk=", + "zh:1d944144f8d613b8090c0c8391e4b205ca036086d70aceb4cdf664856fa8410c", + "zh:2a0ca16a6b12c0ac509f64512f80bd2ed6e7ea0ec369212efd4be3fa65e9773d", + "zh:3f9efdce4f1c320ffd061e8715e1d031deac1be0b959eaa60c25a274925653e4", + "zh:4cf82f3267b0c3e08be29b0345f711ab84ea1ea75f0e8ce81f5a2fe635ba67b4", + "zh:58474a0b7da438e1bcd53e87f10e28830836ff9b46cce5f09413c90952ae4f78", + "zh:6eb1be8afb0314b6b8424fe212b13beeb04f3f24692f0f3ee86c5153c7eb2e63", + "zh:8022da7d3b050d452ce6c679844e13729bdb4e1b3e75dcf68931af17a06b9277", + "zh:8e2683d00fff1df43440d6e7c04a2c1eb432c7d5dacff32fe8ce9045bc948fe6", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:b0c22d9a306e8ac2de57b5291a3d0a7a2c1713e33b7d076005662451afdc4d29", + "zh:ba6b7d7d91388b636145b133da6b4e32620cdc8046352e2dc8f3f0f81ff5d2e2", + "zh:d38a816eb60f4419d99303136a3bb61a0d2df3ca8a1dce2ced9b99bf23efa9f7", + ] +} diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index cee97a2ba..b8919580a 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -6,11 +6,6 @@ terraform { } } } -variable "do_token" {} - -provider "digitalocean" { - token = var.do_token -} resource "digitalocean_project" "project" { name = var.name description = var.description diff --git a/terraform-modules/digitalocean/project/terraform.tfvars b/terraform-modules/digitalocean/project/terraform.tfvars deleted file mode 100644 index 3a6485411..000000000 --- a/terraform-modules/digitalocean/project/terraform.tfvars +++ /dev/null @@ -1 +0,0 @@ -do_token = "dop_v1_76205feb4816c770ae08504abb51a02458366d3ed0a968b6fad57b1e64a501d0" \ No newline at end of file From 691c75c4b342b4c388f2bb5a0f0862442d5973f8 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 20:19:19 -0600 Subject: [PATCH 21/41] documentation and refactor --- .../digitalocean/project/README.md | 33 +++++++++++++++++++ .../digitalocean/project/main.tf | 8 ++--- .../digitalocean/project/output.tf | 2 +- .../digitalocean/project/variables.tf | 8 ++--- 4 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 terraform-modules/digitalocean/project/README.md diff --git a/terraform-modules/digitalocean/project/README.md b/terraform-modules/digitalocean/project/README.md new file mode 100644 index 000000000..1e8e82e67 --- /dev/null +++ b/terraform-modules/digitalocean/project/README.md @@ -0,0 +1,33 @@ +## Requirements + +No requirements. + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [project](#module\digitalocean_project) | [terraform-aws-modules/vpc/aws](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project) | x.x.x | + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| | `"The name of the project"` | `string` | `"playground"` | yes | +| | `"The name of description"` | `string` | `"A project to represent development resources."` | no | +| | `"A purpose for the project"` | `string` | `"Web Application"` | no | +| | `"Kind of dev, qa or prod"` | `string` | `"development"` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| | The id of the project | +| | the unique universal identifier of the project owner. | diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index b8919580a..f7f6ce01b 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -7,8 +7,8 @@ terraform { } } resource "digitalocean_project" "project" { - name = var.name - description = var.description - purpose = var.purpose - environment = var.environment + project_name = var.name + project_description = var.description + project_purpose = var.purpose + project_environment = var.environment } \ No newline at end of file diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index c0317a5fd..0b1a3e174 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -4,6 +4,6 @@ output "project_id" { } output "project_owner_uuid" { - description = "the unique universal identifier of the project owner." + description = "The unique universal identifier of the project owner." value = digitalocean_project.project.owner_uuid } diff --git a/terraform-modules/digitalocean/project/variables.tf b/terraform-modules/digitalocean/project/variables.tf index 372492fef..802c49db5 100644 --- a/terraform-modules/digitalocean/project/variables.tf +++ b/terraform-modules/digitalocean/project/variables.tf @@ -1,22 +1,22 @@ -variable "name" { +variable "project_name" { type = string description = "The name of the project" default = "playground" } -variable "description" { +variable "project_description" { type = string description = "The name of description" default = "A project to represent development resources." } -variable "purpose" { +variable "project_purpose" { type = string description = "A purpose for the project" default = "Web Application" } -variable "environment" { +variable "project_environment" { type = string description = "Kind of dev, qa or prod" default = "development" From 4136eb2f62528b2a5e85431c73574ee6a1e33bf7 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 20:22:27 -0600 Subject: [PATCH 22/41] repair documentation --- terraform-modules/digitalocean/project/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/terraform-modules/digitalocean/project/README.md b/terraform-modules/digitalocean/project/README.md index 1e8e82e67..17fa39f8c 100644 --- a/terraform-modules/digitalocean/project/README.md +++ b/terraform-modules/digitalocean/project/README.md @@ -20,14 +20,14 @@ No resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| | `"The name of the project"` | `string` | `"playground"` | yes | -| | `"The name of description"` | `string` | `"A project to represent development resources."` | no | -| | `"A purpose for the project"` | `string` | `"Web Application"` | no | -| | `"Kind of dev, qa or prod"` | `string` | `"development"` | no | +| `project_name` | `"The name of the project"` | `string` | `"playground"` | yes | +| `project_description` | `"The name of description"` | `string` | `"A project to represent development resources."` | no | +| `project_purpose` | `"A purpose for the project"` | `string` | `"Web Application"` | no | +| `project_environment` | `"Kind of dev, qa or prod"` | `string` | `"development"` | no | ## Outputs | Name | Description | |------|-------------| -| | The id of the project | -| | the unique universal identifier of the project owner. | +| `project_id` | The id of the project | +| `project_owner_uuid` | the unique universal identifier of the project owner. | From 8104c4051c794c90835b9fc8ffc2fdbc53767300 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 20:27:45 -0600 Subject: [PATCH 23/41] complete module description digital ocean --- terraform-modules/digitalocean/project/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terraform-modules/digitalocean/project/README.md b/terraform-modules/digitalocean/project/README.md index 17fa39f8c..ee80b795a 100644 --- a/terraform-modules/digitalocean/project/README.md +++ b/terraform-modules/digitalocean/project/README.md @@ -1,3 +1,7 @@ +## Description +The module is capable of creating a project to group a set of digital ocean resources +Module in digital ocean: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project + ## Requirements No requirements. From fb9692c9c8744fae3f180ec5ae63467a4050a5ef Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 22 May 2022 20:47:49 -0600 Subject: [PATCH 24/41] freeze 2.19 module --- terraform-modules/digitalocean/project/README.md | 3 +-- terraform-modules/digitalocean/project/main.tf | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform-modules/digitalocean/project/README.md b/terraform-modules/digitalocean/project/README.md index ee80b795a..523ef36a1 100644 --- a/terraform-modules/digitalocean/project/README.md +++ b/terraform-modules/digitalocean/project/README.md @@ -1,6 +1,5 @@ ## Description The module is capable of creating a project to group a set of digital ocean resources -Module in digital ocean: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project ## Requirements @@ -14,7 +13,7 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [project](#module\digitalocean_project) | [terraform-aws-modules/vpc/aws](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project) | x.x.x | +| digitalocean_project | [registry.terraform.io/providers/digitalocean/project](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project) | 2.19.0 | ## Resources diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index f7f6ce01b..7eae812f1 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -2,7 +2,7 @@ terraform { required_providers { digitalocean = { source = "digitalocean/digitalocean" - version = "~> 2.0" + version = "2.19.0" } } } From 1438239ca9cca20362d90785dd324a8b8aa17f10 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sat, 28 May 2022 13:09:45 -0600 Subject: [PATCH 25/41] Vpc Module --- terraform-modules/digitalocean/vpc/README.md | 2 +- terraform-modules/digitalocean/vpc/main.tf | 27 +++++++++++++++++++ terraform-modules/digitalocean/vpc/output.tf | 12 +++++++++ .../digitalocean/vpc/variables.tf | 24 +++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 terraform-modules/digitalocean/vpc/main.tf create mode 100644 terraform-modules/digitalocean/vpc/output.tf create mode 100644 terraform-modules/digitalocean/vpc/variables.tf diff --git a/terraform-modules/digitalocean/vpc/README.md b/terraform-modules/digitalocean/vpc/README.md index 7659eb0e3..6ff2a9f1e 100644 --- a/terraform-modules/digitalocean/vpc/README.md +++ b/terraform-modules/digitalocean/vpc/README.md @@ -1,2 +1,2 @@ -# Module under construction +# Documentation under construction 🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/main.tf b/terraform-modules/digitalocean/vpc/main.tf new file mode 100644 index 000000000..2c8564ce4 --- /dev/null +++ b/terraform-modules/digitalocean/vpc/main.tf @@ -0,0 +1,27 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} +#Create vpc in digital ocean +resource "digitalocean_vpc" "vpc" { + name = var.vpc_name + description = var.vpc_description + region = var.vpc_region + ip_range = var.vpc_ip_range +} + +data "digitalocean_project" "project" { + id = vpc_project_id +} + +#Asociate vpc to project +resource "digitalocean_project_resources" "project_associate" { + project = data.digitalocean_project.project.id + resources = [ + digitalocean_vpc.vpc.urn + ] +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/output.tf b/terraform-modules/digitalocean/vpc/output.tf new file mode 100644 index 000000000..a113cc139 --- /dev/null +++ b/terraform-modules/digitalocean/vpc/output.tf @@ -0,0 +1,12 @@ +output "vpc_id" { + description = "The unique identifier for the VPC." + value = vpc.id +} +output "vpc_urn" { + description = "The uniform resource name (URN) for the VPC." + value = vpc.urn +} +output "vpc_default" { + description = "A boolean indicating whether or not the VPC is the default one for the region." + value = vpc.defaul +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/variables.tf b/terraform-modules/digitalocean/vpc/variables.tf new file mode 100644 index 000000000..c3fba0743 --- /dev/null +++ b/terraform-modules/digitalocean/vpc/variables.tf @@ -0,0 +1,24 @@ +variable "vpc_name" { + type = string + description = " A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only." +} + +variable "vpc_region" { + type = string + description = "The DigitalOcean region slug for the VPC's location." +} + +variable "vpc_description" { + type = string + description = "A free-form text field up to a limit of 255 characters to describe the VPC." + default = "Your new vpc" +} +variable "vpc_ip_range" { + type = string + description = "The range of IP addresses for the VPC in CIDR notation." + default = "10.10.10.0/24" +} +variable "vpc_project_id" { + type = string + description = "The id of the project where the vpc will be associated" +} \ No newline at end of file From b0cc99b9440314100a6433c2c49a0508e956c7a8 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 20:31:54 -0600 Subject: [PATCH 26/41] refactor variables --- terraform-modules/digitalocean/vpc/main.tf | 6 +----- terraform-modules/digitalocean/vpc/output.tf | 6 +++--- terraform-modules/digitalocean/vpc/variables.tf | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/terraform-modules/digitalocean/vpc/main.tf b/terraform-modules/digitalocean/vpc/main.tf index 2c8564ce4..8529733b7 100644 --- a/terraform-modules/digitalocean/vpc/main.tf +++ b/terraform-modules/digitalocean/vpc/main.tf @@ -14,13 +14,9 @@ resource "digitalocean_vpc" "vpc" { ip_range = var.vpc_ip_range } -data "digitalocean_project" "project" { - id = vpc_project_id -} - #Asociate vpc to project resource "digitalocean_project_resources" "project_associate" { - project = data.digitalocean_project.project.id + project = var.project_id resources = [ digitalocean_vpc.vpc.urn ] diff --git a/terraform-modules/digitalocean/vpc/output.tf b/terraform-modules/digitalocean/vpc/output.tf index a113cc139..6f50deed4 100644 --- a/terraform-modules/digitalocean/vpc/output.tf +++ b/terraform-modules/digitalocean/vpc/output.tf @@ -1,12 +1,12 @@ output "vpc_id" { description = "The unique identifier for the VPC." - value = vpc.id + value = digitalocean_project.vpc.id } output "vpc_urn" { description = "The uniform resource name (URN) for the VPC." - value = vpc.urn + value = digitalocean_project.vpc.urn } output "vpc_default" { description = "A boolean indicating whether or not the VPC is the default one for the region." - value = vpc.defaul + value = digitalocean_project.vpc.default } \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/variables.tf b/terraform-modules/digitalocean/vpc/variables.tf index c3fba0743..ba8c28718 100644 --- a/terraform-modules/digitalocean/vpc/variables.tf +++ b/terraform-modules/digitalocean/vpc/variables.tf @@ -18,7 +18,7 @@ variable "vpc_ip_range" { description = "The range of IP addresses for the VPC in CIDR notation." default = "10.10.10.0/24" } -variable "vpc_project_id" { +variable "project_id" { type = string description = "The id of the project where the vpc will be associated" } \ No newline at end of file From 80365db6f1fcc3110a41dd3a1f2fbc72476f97c9 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 20:40:41 -0600 Subject: [PATCH 27/41] refactor digitalocean_vpc --- terraform-modules/digitalocean/vpc/output.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terraform-modules/digitalocean/vpc/output.tf b/terraform-modules/digitalocean/vpc/output.tf index 6f50deed4..537ad1341 100644 --- a/terraform-modules/digitalocean/vpc/output.tf +++ b/terraform-modules/digitalocean/vpc/output.tf @@ -1,12 +1,12 @@ output "vpc_id" { description = "The unique identifier for the VPC." - value = digitalocean_project.vpc.id + value = digitalocean_vpc.vpc.id } output "vpc_urn" { description = "The uniform resource name (URN) for the VPC." - value = digitalocean_project.vpc.urn + value = digitalocean_vpc.vpc.urn } output "vpc_default" { description = "A boolean indicating whether or not the VPC is the default one for the region." - value = digitalocean_project.vpc.default + value = digitalocean_vpc.vpc.default } \ No newline at end of file From 72b2cfa61c36854043cc5a4221bbd6e79e739140 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 21:00:52 -0600 Subject: [PATCH 28/41] remove associate vpc to project --- terraform-modules/digitalocean/vpc/main.tf | 7 ------- 1 file changed, 7 deletions(-) diff --git a/terraform-modules/digitalocean/vpc/main.tf b/terraform-modules/digitalocean/vpc/main.tf index 8529733b7..ebd95d4fd 100644 --- a/terraform-modules/digitalocean/vpc/main.tf +++ b/terraform-modules/digitalocean/vpc/main.tf @@ -14,10 +14,3 @@ resource "digitalocean_vpc" "vpc" { ip_range = var.vpc_ip_range } -#Asociate vpc to project -resource "digitalocean_project_resources" "project_associate" { - project = var.project_id - resources = [ - digitalocean_vpc.vpc.urn - ] -} \ No newline at end of file From 34886d92115f022a7d396e547aab3a1c8467f788 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 21:23:07 -0600 Subject: [PATCH 29/41] vpc module --- .../terragrunt-dev/SFO3/region.hcl | 2 +- .../0100-vpc/.terraform.lock.hcl | 44 +++++++++++++++++++ .../terragrunt-dev/0100-vpc/terragrunt.hcl | 38 ++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/.terraform.lock.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl index 809d606cc..07d818aae 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/region.hcl @@ -1,4 +1,4 @@ locals { - digitalocean_region = "SFO3" + digitalocean_region = "sfo3" aws_region = "us-east-1" } \ No newline at end of file diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/.terraform.lock.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/.terraform.lock.hcl new file mode 100644 index 000000000..16ad5323d --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/.terraform.lock.hcl @@ -0,0 +1,44 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.19.0" + constraints = "2.19.0" + hashes = [ + "h1:XcLoKA2a1MR4foSFeFbJgCADRvsXtN9SyIiJX0fSGys=", + "zh:01cee85343dee2dfc01499e19ef4e56b0c9260eee0a47329231cf500c07b4386", + "zh:099eeddf9baf9c282430231da501a8b96b3fb28507ce3b78e3a185cc9d4b3860", + "zh:191e090e8553355d91842163737d71051aeb499c8ddb23d2e8aae9dab2f8a1a5", + "zh:25356abb47769270730b0ddb0a3eb89aec637395cdcb77c309d23e55839e4461", + "zh:28876afb75ba5367d20e508e05c7657f90922142ff80d8a81a4d68b3381adb86", + "zh:404a304e37c3dec8017318b16ab701553e5242dc2460211346a9dd39242709a6", + "zh:40f53111b01fc78fdc7a6ba47a80d51c9a45e77e5b7d7d5bcae3a0c6f58ffbdf", + "zh:48f212068234df3dcfe5544c96b10403b15a190203742756d7d0573ee0857c17", + "zh:5189fe4fffdbff5c280f6741f55b2de9cb2b8c653cda0b2339c28cd1e3bc7884", + "zh:a7d5840ca789a03a285c67d2838af4d8687c99f3e8fac4ce56fcd23802a66156", + "zh:c0bd3c4555e5d7e6c96d3add3ddd8e41aa0df9e4a4518ad3b7f1d726a4e0a9f4", + "zh:d70a903a6d75533aa4713e255c9c967ec453195f2209439981f015f203805a6e", + "zh:db8110736bd47f99213d72309ebb720718a80b15ddd46e34a8ee9b2125903079", + "zh:e2180f334506601e0a6af8863159cc719ce584fdb23bd45ddc120f33d22cec19", + "zh:eb515a24d231e7f1ef344b9b88fa2071f760ec34fbb47d80bbacdf7e35f3daca", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.16.0" + hashes = [ + "h1:6V8jLqXdtHjCkMIuxg77BrTVchqpaRK1UUYeTuXDPmE=", + "zh:0aa204fead7c431796386cc9e73ccda9a185f37e46d4b6475ff3f56ad4f15101", + "zh:130396f5da1650f4d6949e67ec44e0f408a529b7f76c48701a7bf21ba6949bbc", + "zh:271bfa95bc1332676a81d3f01ba1b5a188abf26df475ca9f25972c68935b6ee9", + "zh:51bc600c6c00292c6cb00ca460c555fb2cafd11d5fe9c5dc7d4ce62ec71874f8", + "zh:6ece49ba67e484777e1588a08b043c186aa896b5189b0a5056eb7838c566f63e", + "zh:994402e0973b12f2266f2d3ad00f000b2e2f3ee6961631aeab32688c0c4e07fd", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9e9ef874b11dfb1960aa18e1254ee430142cb583f721a2ed44b608ddf652db57", + "zh:bb1755cd1dd39e0caf98efb1ccb5b03323f77ba13b3f5531bfe28aded7750db0", + "zh:e5e73ddc1e3d0c0311be90176152c07f0d27af377a95baab72c6f00622461f46", + "zh:e7fd8313107ab7f63297b8440b0ccf08a7b56a329ae110ad9b6ef51959939a20", + "zh:f095a3f10331b3a91527822a2a881a6714c2e40ee20a14b3c127340c540e37e5", + ] +} diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl new file mode 100644 index 000000000..8a3feb9db --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl @@ -0,0 +1,38 @@ +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +terraform { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/vpc?ref=digitalocean-kube-ops" +} + +dependency "project" { + config_path = "${get_terragrunt_dir()}/../050-project" +} + +# --------------------------------------------------------------------------------------------------------------------- +# Locals are named constants that are reusable within the configuration. +# --------------------------------------------------------------------------------------------------------------------- +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + + # Load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) +} + +# --------------------------------------------------------------------------------------------------------------------- +# MODULE PARAMETERS +# These are the variables we have to pass in to use the module specified in the terragrunt configuration above +# --------------------------------------------------------------------------------------------------------------------- +inputs = { + vpc_name = "ManageKubeVpc" + vpc_region = local.region_vars.locals.digitalocean_region + vpc_description = "Vpc for testing ManageKube in Digital Ocean" + vpc_ip_range = "10.10.10.0/24" + project_id = dependency.project.outputs.project_id +} \ No newline at end of file From f7fa0a6c51e912584c2da48de27979a02b2c4a7f Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:12:15 -0600 Subject: [PATCH 30/41] volume module --- .../digitalocean/project/main.tf | 2 +- .../digitalocean/project/output.tf | 4 +-- .../digitalocean/project/variables.tf | 8 +++--- .../digitalocean/volume/README.md | 5 ++-- terraform-modules/digitalocean/volume/main.tf | 16 ++++++++++++ .../digitalocean/volume/output.tf | 8 ++++++ .../digitalocean/volume/variables.tf | 25 +++++++++++++++++++ terraform-modules/digitalocean/vpc/main.tf | 2 +- terraform-modules/digitalocean/vpc/output.tf | 6 ++--- .../digitalocean/vpc/variables.tf | 10 ++++---- 10 files changed, 68 insertions(+), 18 deletions(-) create mode 100644 terraform-modules/digitalocean/volume/main.tf create mode 100644 terraform-modules/digitalocean/volume/output.tf create mode 100644 terraform-modules/digitalocean/volume/variables.tf diff --git a/terraform-modules/digitalocean/project/main.tf b/terraform-modules/digitalocean/project/main.tf index 7eae812f1..46c44bf73 100644 --- a/terraform-modules/digitalocean/project/main.tf +++ b/terraform-modules/digitalocean/project/main.tf @@ -6,7 +6,7 @@ terraform { } } } -resource "digitalocean_project" "project" { +resource "digitalocean_project" "this" { project_name = var.name project_description = var.description project_purpose = var.purpose diff --git a/terraform-modules/digitalocean/project/output.tf b/terraform-modules/digitalocean/project/output.tf index 0b1a3e174..cb03f9873 100644 --- a/terraform-modules/digitalocean/project/output.tf +++ b/terraform-modules/digitalocean/project/output.tf @@ -1,9 +1,9 @@ output "project_id" { description = "The id of the project" - value = digitalocean_project.project.id + value = digitalocean_project.this.id } output "project_owner_uuid" { description = "The unique universal identifier of the project owner." - value = digitalocean_project.project.owner_uuid + value = digitalocean_project.this.owner_uuid } diff --git a/terraform-modules/digitalocean/project/variables.tf b/terraform-modules/digitalocean/project/variables.tf index 802c49db5..9db503c1b 100644 --- a/terraform-modules/digitalocean/project/variables.tf +++ b/terraform-modules/digitalocean/project/variables.tf @@ -1,23 +1,23 @@ variable "project_name" { type = string - description = "The name of the project" + description = "(Required) The name of the project" default = "playground" } variable "project_description" { type = string - description = "The name of description" + description = "(Optional) The name of description" default = "A project to represent development resources." } variable "project_purpose" { type = string - description = "A purpose for the project" + description = "(Optional) A purpose for the project" default = "Web Application" } variable "project_environment" { type = string - description = "Kind of dev, qa or prod" + description = "(Optional) Kind of dev, qa or prod" default = "development" } \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/README.md b/terraform-modules/digitalocean/volume/README.md index 7659eb0e3..446e4099b 100644 --- a/terraform-modules/digitalocean/volume/README.md +++ b/terraform-modules/digitalocean/volume/README.md @@ -1,2 +1,3 @@ -# Module under construction -🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file +# Volume +NOTE: +Volumes can be attached either directly on the digitalocean_droplet resource, or using the digitalocean_volume_attachment resource - but the two cannot be used together. If both are used against the same Droplet, the volume attachments will constantly drift. \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/main.tf b/terraform-modules/digitalocean/volume/main.tf new file mode 100644 index 000000000..60330f73c --- /dev/null +++ b/terraform-modules/digitalocean/volume/main.tf @@ -0,0 +1,16 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} + +resource "digitalocean_volume" "this" { + region = var.volume_region + name = var.volume_name + size = var.volume_size + initial_filesystem_type = var.volume_initial_filesystem_type + description = var.volume_description +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/output.tf b/terraform-modules/digitalocean/volume/output.tf new file mode 100644 index 000000000..ce2be9521 --- /dev/null +++ b/terraform-modules/digitalocean/volume/output.tf @@ -0,0 +1,8 @@ +output "volume_id" { + description = "The unique identifier for the volume." + value = digitalocean_volume.this.id +} +output "volume_urn" { + description = "The uniform resource name for the volume." + value = digitalocean_volume.this.urn +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/variables.tf b/terraform-modules/digitalocean/volume/variables.tf new file mode 100644 index 000000000..6b2cf7080 --- /dev/null +++ b/terraform-modules/digitalocean/volume/variables.tf @@ -0,0 +1,25 @@ +variable "volume_name" { + type = string + description = "(Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters." +} + +variable "volume_region" { + type = string + description = "(Required) The region that the block storage volume will be created in." +} + +variable "volume_size" { + type = number + description = "(Required) The size of the block storage volume in GiB. If updated, can only be expanded." +} + +variable "volume_initial_filesystem_type" { + type = string + description = "(Optional) Initial filesystem type (xfs or ext4) for the block storage volume." +} + +variable "volume_description" { + type = string + description = "(Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.." +} + diff --git a/terraform-modules/digitalocean/vpc/main.tf b/terraform-modules/digitalocean/vpc/main.tf index ebd95d4fd..61d0de6fc 100644 --- a/terraform-modules/digitalocean/vpc/main.tf +++ b/terraform-modules/digitalocean/vpc/main.tf @@ -7,7 +7,7 @@ terraform { } } #Create vpc in digital ocean -resource "digitalocean_vpc" "vpc" { +resource "digitalocean_vpc" "this" { name = var.vpc_name description = var.vpc_description region = var.vpc_region diff --git a/terraform-modules/digitalocean/vpc/output.tf b/terraform-modules/digitalocean/vpc/output.tf index 537ad1341..c5c7b7e7b 100644 --- a/terraform-modules/digitalocean/vpc/output.tf +++ b/terraform-modules/digitalocean/vpc/output.tf @@ -1,12 +1,12 @@ output "vpc_id" { description = "The unique identifier for the VPC." - value = digitalocean_vpc.vpc.id + value = digitalocean_vpc.this.id } output "vpc_urn" { description = "The uniform resource name (URN) for the VPC." - value = digitalocean_vpc.vpc.urn + value = digitalocean_vpc.this.urn } output "vpc_default" { description = "A boolean indicating whether or not the VPC is the default one for the region." - value = digitalocean_vpc.vpc.default + value = digitalocean_vpc.this.default } \ No newline at end of file diff --git a/terraform-modules/digitalocean/vpc/variables.tf b/terraform-modules/digitalocean/vpc/variables.tf index ba8c28718..f71746c1a 100644 --- a/terraform-modules/digitalocean/vpc/variables.tf +++ b/terraform-modules/digitalocean/vpc/variables.tf @@ -1,24 +1,24 @@ variable "vpc_name" { type = string - description = " A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only." + description = "(Required) A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only." } variable "vpc_region" { type = string - description = "The DigitalOcean region slug for the VPC's location." + description = "(Required) The DigitalOcean region slug for the VPC's location." } variable "vpc_description" { type = string - description = "A free-form text field up to a limit of 255 characters to describe the VPC." + description = "(Optional) A free-form text field up to a limit of 255 characters to describe the VPC." default = "Your new vpc" } variable "vpc_ip_range" { type = string - description = "The range of IP addresses for the VPC in CIDR notation." + description = "(Optional) The range of IP addresses for the VPC in CIDR notation." default = "10.10.10.0/24" } variable "project_id" { type = string - description = "The id of the project where the vpc will be associated" + description = "(Optional) The id of the project where the vpc will be associated" } \ No newline at end of file From 386766a5ca89d6d6947b1ba2eb5be56bb23c197d Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:23:48 -0600 Subject: [PATCH 31/41] droplet module --- .../digitalocean/droplet/README.md | 4 +-- .../digitalocean/droplet/main.tf | 17 ++++++++++ .../digitalocean/droplet/output.tf | 8 +++++ .../digitalocean/droplet/variables.tf | 32 +++++++++++++++++++ 4 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 terraform-modules/digitalocean/droplet/main.tf create mode 100644 terraform-modules/digitalocean/droplet/output.tf create mode 100644 terraform-modules/digitalocean/droplet/variables.tf diff --git a/terraform-modules/digitalocean/droplet/README.md b/terraform-modules/digitalocean/droplet/README.md index 7659eb0e3..1b2337d06 100644 --- a/terraform-modules/digitalocean/droplet/README.md +++ b/terraform-modules/digitalocean/droplet/README.md @@ -1,2 +1,2 @@ -# Module under construction -🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file +# Droplet +Docs: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/droplet diff --git a/terraform-modules/digitalocean/droplet/main.tf b/terraform-modules/digitalocean/droplet/main.tf new file mode 100644 index 000000000..b5854c070 --- /dev/null +++ b/terraform-modules/digitalocean/droplet/main.tf @@ -0,0 +1,17 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} + +resource "digitalocean_droplet" "this" { + image = var.droplet_image + name = var.droplet_name + region = var.droplet_region + size = var.droplet_size + monitoring = var.droplet_monitoring + vpc_uuid = var.droplet_vpc_uuid +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/output.tf b/terraform-modules/digitalocean/droplet/output.tf new file mode 100644 index 000000000..6cba1c756 --- /dev/null +++ b/terraform-modules/digitalocean/droplet/output.tf @@ -0,0 +1,8 @@ +output "droplet_id" { + description = "The ID of the Droplet" + value = digitalocean_droplet.this.id +} +output "droplet_urn" { + description = "The uniform resource name of the Droplet" + value = digitalocean_droplet.this.urn +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/variables.tf b/terraform-modules/digitalocean/droplet/variables.tf new file mode 100644 index 000000000..de05a4bb8 --- /dev/null +++ b/terraform-modules/digitalocean/droplet/variables.tf @@ -0,0 +1,32 @@ +variable "droplet_name" { + type = string + description = "(Required) The Droplet name." +} + +variable "droplet_image" { + type = string + description = "(Required) The Droplet image ID or slug" +} + +variable "droplet_region" { + type = string + description = "(Required) The region to start in." +} + +variable "droplet_size" { + type = string + description = "(Required) The unique slug that indentifies the type of Droplet. You can find a list of available slugs on DigitalOcean API documentation." +} + +variable "droplet_monitoring" { + type = bool + description = "(Optional) Boolean controlling whether monitoring agent is installed. Defaults to false. If set to true, you can configure monitor alert policies monitor alert" + default = false +} + +variable "droplet_vpc_uuid" { + type = string + description = "The ID of the VPC where the Droplet will be located." + default = null +} + \ No newline at end of file From baf987e3a98f67c6e3b361f86a0e0a6810642133 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:24:40 -0600 Subject: [PATCH 32/41] folder droplet_volume --- terraform-modules/digitalocean/droplet_module/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 terraform-modules/digitalocean/droplet_module/README.md diff --git a/terraform-modules/digitalocean/droplet_module/README.md b/terraform-modules/digitalocean/droplet_module/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/droplet_module/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file From 7c1b0143150a163ee0e5562d36f4d9b3c27c851e Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:25:07 -0600 Subject: [PATCH 33/41] droplet volume --- .../digitalocean/{droplet_module => droplet_volume}/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename terraform-modules/digitalocean/{droplet_module => droplet_volume}/README.md (100%) diff --git a/terraform-modules/digitalocean/droplet_module/README.md b/terraform-modules/digitalocean/droplet_volume/README.md similarity index 100% rename from terraform-modules/digitalocean/droplet_module/README.md rename to terraform-modules/digitalocean/droplet_volume/README.md From b9f134fb0fed414a769799b3d06adb01f99a7806 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:29:34 -0600 Subject: [PATCH 34/41] dropplet volume attachment --- .../digitalocean/droplet_volume/README.md | 4 ++-- .../digitalocean/droplet_volume/main.tf | 13 +++++++++++++ .../digitalocean/droplet_volume/output.tf | 4 ++++ .../digitalocean/droplet_volume/variables.tf | 10 ++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 terraform-modules/digitalocean/droplet_volume/main.tf create mode 100644 terraform-modules/digitalocean/droplet_volume/output.tf create mode 100644 terraform-modules/digitalocean/droplet_volume/variables.tf diff --git a/terraform-modules/digitalocean/droplet_volume/README.md b/terraform-modules/digitalocean/droplet_volume/README.md index 7659eb0e3..62fa3469a 100644 --- a/terraform-modules/digitalocean/droplet_volume/README.md +++ b/terraform-modules/digitalocean/droplet_volume/README.md @@ -1,2 +1,2 @@ -# Module under construction -🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file +# Attach Volume to Droplet +Docs: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/volume_attachment diff --git a/terraform-modules/digitalocean/droplet_volume/main.tf b/terraform-modules/digitalocean/droplet_volume/main.tf new file mode 100644 index 000000000..c8194a858 --- /dev/null +++ b/terraform-modules/digitalocean/droplet_volume/main.tf @@ -0,0 +1,13 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} + +resource "digitalocean_volume_attachment" "this" { + droplet_id = var.droplet_id + volume_id = var.volume_id +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet_volume/output.tf b/terraform-modules/digitalocean/droplet_volume/output.tf new file mode 100644 index 000000000..9aef5fc5c --- /dev/null +++ b/terraform-modules/digitalocean/droplet_volume/output.tf @@ -0,0 +1,4 @@ +output "droplet_volume_attachment" { + description = "The unique identifier for the volume attachment." + value = digitalocean_volume_attachment.this.id +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet_volume/variables.tf b/terraform-modules/digitalocean/droplet_volume/variables.tf new file mode 100644 index 000000000..e20ba8eb5 --- /dev/null +++ b/terraform-modules/digitalocean/droplet_volume/variables.tf @@ -0,0 +1,10 @@ +variable "droplet_id" { + type = string + description = "(Required) ID of the Droplet to attach the volume to." +} + +variable "volume_id" { + type = string + description = "(Required) ID of the Volume to be attached to the Droplet." +} + From 2944eb8925cde38665682f91597f313183b7c8a6 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Tue, 31 May 2022 22:30:56 -0600 Subject: [PATCH 35/41] kubernetes autoscaler folder --- terraform-modules/digitalocean/kubernetes_autoscaler/README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 terraform-modules/digitalocean/kubernetes_autoscaler/README.md diff --git a/terraform-modules/digitalocean/kubernetes_autoscaler/README.md b/terraform-modules/digitalocean/kubernetes_autoscaler/README.md new file mode 100644 index 000000000..7659eb0e3 --- /dev/null +++ b/terraform-modules/digitalocean/kubernetes_autoscaler/README.md @@ -0,0 +1,2 @@ +# Module under construction +🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file From 035310b6e74c41dbf5414f8a66b1cce920852f22 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 17:03:29 -0600 Subject: [PATCH 36/41] add terraform docs --- .../digitalocean/droplet/README.md | 43 +++++++++++++++++++ .../digitalocean/droplet/variables.tf | 5 +++ .../digitalocean/droplet_volume/README.md | 37 ++++++++++++++++ .../digitalocean/project/README.md | 40 +++++++++++++++++ .../digitalocean/volume/README.md | 43 +++++++++++++++++-- .../digitalocean/volume/variables.tf | 4 +- terraform-modules/digitalocean/vpc/README.md | 43 ++++++++++++++++++- 7 files changed, 209 insertions(+), 6 deletions(-) diff --git a/terraform-modules/digitalocean/droplet/README.md b/terraform-modules/digitalocean/droplet/README.md index 1b2337d06..3aef51669 100644 --- a/terraform-modules/digitalocean/droplet/README.md +++ b/terraform-modules/digitalocean/droplet/README.md @@ -1,2 +1,45 @@ # Droplet Docs: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/droplet + + +## Requirements + +| Name | Version | +|------|---------| +| [digitalocean](#requirement\_digitalocean) | 2.19.0 | + +## Providers + +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | 2.19.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [digitalocean_droplet.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/droplet) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [droplet\_image](#input\_droplet\_image) | (Required) The Droplet image ID or slug | `string` | n/a | yes | +| [droplet\_monitoring](#input\_droplet\_monitoring) | (Optional) Boolean controlling whether monitoring agent is installed. Defaults to false. If set to true, you can configure monitor alert policies monitor alert | `bool` | `false` | no | +| [droplet\_name](#input\_droplet\_name) | (Required) The Droplet name. | `string` | n/a | yes | +| [droplet\_region](#input\_droplet\_region) | (Required) The region to start in. | `string` | n/a | yes | +| [droplet\_size](#input\_droplet\_size) | (Required) The unique slug that indentifies the type of Droplet. You can find a list of available slugs on DigitalOcean API documentation. | `string` | n/a | yes | +| [droplet\_user\_data](#input\_droplet\_user\_data) | (Optional) A string of the desired User Data for the Droplet. | `string` | n/a | yes | +| [droplet\_vpc\_uuid](#input\_droplet\_vpc\_uuid) | The ID of the VPC where the Droplet will be located. | `string` | `null` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [droplet\_id](#output\_droplet\_id) | The ID of the Droplet | +| [droplet\_urn](#output\_droplet\_urn) | The uniform resource name of the Droplet | + \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/variables.tf b/terraform-modules/digitalocean/droplet/variables.tf index de05a4bb8..54fa21e39 100644 --- a/terraform-modules/digitalocean/droplet/variables.tf +++ b/terraform-modules/digitalocean/droplet/variables.tf @@ -29,4 +29,9 @@ variable "droplet_vpc_uuid" { description = "The ID of the VPC where the Droplet will be located." default = null } + +variable "droplet_user_data" { + type = string + description = "(Optional) A string of the desired User Data for the Droplet." +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet_volume/README.md b/terraform-modules/digitalocean/droplet_volume/README.md index 62fa3469a..d32a1e47d 100644 --- a/terraform-modules/digitalocean/droplet_volume/README.md +++ b/terraform-modules/digitalocean/droplet_volume/README.md @@ -1,2 +1,39 @@ # Attach Volume to Droplet Docs: https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/volume_attachment + + +## Requirements + +| Name | Version | +|------|---------| +| [digitalocean](#requirement\_digitalocean) | 2.19.0 | + +## Providers + +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | 2.19.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [digitalocean_volume_attachment.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/volume_attachment) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [droplet\_id](#input\_droplet\_id) | (Required) ID of the Droplet to attach the volume to. | `string` | n/a | yes | +| [volume\_id](#input\_volume\_id) | (Required) ID of the Volume to be attached to the Droplet. | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [droplet\_volume\_attachment](#output\_droplet\_volume\_attachment) | The unique identifier for the volume attachment. | + \ No newline at end of file diff --git a/terraform-modules/digitalocean/project/README.md b/terraform-modules/digitalocean/project/README.md index 523ef36a1..0c7144ddb 100644 --- a/terraform-modules/digitalocean/project/README.md +++ b/terraform-modules/digitalocean/project/README.md @@ -34,3 +34,43 @@ No resources. |------|-------------| | `project_id` | The id of the project | | `project_owner_uuid` | the unique universal identifier of the project owner. | + + +## Requirements + +| Name | Version | +|------|---------| +| [digitalocean](#requirement\_digitalocean) | 2.19.0 | + +## Providers + +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | 2.19.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [digitalocean_project.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/project) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [project\_description](#input\_project\_description) | (Optional) The name of description | `string` | `"A project to represent development resources."` | no | +| [project\_environment](#input\_project\_environment) | (Optional) Kind of dev, qa or prod | `string` | `"development"` | no | +| [project\_name](#input\_project\_name) | (Required) The name of the project | `string` | `"playground"` | no | +| [project\_purpose](#input\_project\_purpose) | (Optional) A purpose for the project | `string` | `"Web Application"` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [project\_id](#output\_project\_id) | The id of the project | +| [project\_owner\_uuid](#output\_project\_owner\_uuid) | The unique universal identifier of the project owner. | + \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/README.md b/terraform-modules/digitalocean/volume/README.md index 446e4099b..877a4034a 100644 --- a/terraform-modules/digitalocean/volume/README.md +++ b/terraform-modules/digitalocean/volume/README.md @@ -1,3 +1,40 @@ -# Volume -NOTE: -Volumes can be attached either directly on the digitalocean_droplet resource, or using the digitalocean_volume_attachment resource - but the two cannot be used together. If both are used against the same Droplet, the volume attachments will constantly drift. \ No newline at end of file + +## Requirements + +| Name | Version | +|------|---------| +| [digitalocean](#requirement\_digitalocean) | 2.19.0 | + +## Providers + +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | 2.19.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [digitalocean_volume.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/volume) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [volume\_description](#input\_volume\_description) | (Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.. | `string` | n/a | yes | +| [volume\_initial\_filesystem\_type](#input\_volume\_initial\_filesystem\_type) | (Optional) Initial filesystem type (xfs or ext4) for the block storage volume. | `string` | n/a | yes | +| [volume\_name](#input\_volume\_name) | (Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and -, up to a limit of 64 characters. | `string` | n/a | yes | +| [volume\_region](#input\_volume\_region) | (Required) The region that the block storage volume will be created in. | `string` | n/a | yes | +| [volume\_size](#input\_volume\_size) | (Required) The size of the block storage volume in GiB. If updated, can only be expanded. | `number` | `20` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| [volume\_id](#output\_volume\_id) | The unique identifier for the volume. | +| [volume\_urn](#output\_volume\_urn) | The uniform resource name for the volume. | + \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/variables.tf b/terraform-modules/digitalocean/volume/variables.tf index 6b2cf7080..8ef64cde4 100644 --- a/terraform-modules/digitalocean/volume/variables.tf +++ b/terraform-modules/digitalocean/volume/variables.tf @@ -1,6 +1,7 @@ + variable "volume_name" { type = string - description = "(Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and "-", up to a limit of 64 characters." + description = "(Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and -, up to a limit of 64 characters." } variable "volume_region" { @@ -10,6 +11,7 @@ variable "volume_region" { variable "volume_size" { type = number + default = 20 description = "(Required) The size of the block storage volume in GiB. If updated, can only be expanded." } diff --git a/terraform-modules/digitalocean/vpc/README.md b/terraform-modules/digitalocean/vpc/README.md index 6ff2a9f1e..07643083e 100644 --- a/terraform-modules/digitalocean/vpc/README.md +++ b/terraform-modules/digitalocean/vpc/README.md @@ -1,2 +1,41 @@ -# Documentation under construction -🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃🏃 \ No newline at end of file + +## Requirements + +| Name | Version | +|------|---------| +| [digitalocean](#requirement\_digitalocean) | 2.19.0 | + +## Providers + +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | 2.19.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [digitalocean_vpc.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/vpc) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [project\_id](#input\_project\_id) | (Optional) The id of the project where the vpc will be associated | `string` | n/a | yes | +| [vpc\_description](#input\_vpc\_description) | (Optional) A free-form text field up to a limit of 255 characters to describe the VPC. | `string` | `"Your new vpc"` | no | +| [vpc\_ip\_range](#input\_vpc\_ip\_range) | (Optional) The range of IP addresses for the VPC in CIDR notation. | `string` | `"10.10.10.0/24"` | no | +| [vpc\_name](#input\_vpc\_name) | (Required) A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only. | `string` | n/a | yes | +| [vpc\_region](#input\_vpc\_region) | (Required) The DigitalOcean region slug for the VPC's location. | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [vpc\_default](#output\_vpc\_default) | A boolean indicating whether or not the VPC is the default one for the region. | +| [vpc\_id](#output\_vpc\_id) | The unique identifier for the VPC. | +| [vpc\_urn](#output\_vpc\_urn) | The uniform resource name (URN) for the VPC. | + \ No newline at end of file From 5ce428c3065aa1c6ac7be1fdbd72520619788bd2 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 17:28:30 -0600 Subject: [PATCH 37/41] vpc and volumens docs refactor and new volumen env --- .../terragrunt-dev/0100-vpc/terragrunt.hcl | 5 --- .../terragrunt-dev/0200-volume/terragrunt.hcl | 37 +++++++++++++++++++ .../digitalocean/volume/README.md | 2 + terraform-modules/digitalocean/volume/main.tf | 7 ++++ .../digitalocean/volume/variables.tf | 4 ++ terraform-modules/digitalocean/vpc/README.md | 1 - .../digitalocean/vpc/variables.tf | 4 -- 7 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl index 8a3feb9db..7dd412c9e 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/terragrunt.hcl @@ -7,10 +7,6 @@ terraform { source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/vpc?ref=digitalocean-kube-ops" } -dependency "project" { - config_path = "${get_terragrunt_dir()}/../050-project" -} - # --------------------------------------------------------------------------------------------------------------------- # Locals are named constants that are reusable within the configuration. # --------------------------------------------------------------------------------------------------------------------- @@ -34,5 +30,4 @@ inputs = { vpc_region = local.region_vars.locals.digitalocean_region vpc_description = "Vpc for testing ManageKube in Digital Ocean" vpc_ip_range = "10.10.10.0/24" - project_id = dependency.project.outputs.project_id } \ No newline at end of file diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl new file mode 100644 index 000000000..107f17901 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl @@ -0,0 +1,37 @@ +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +terraform { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/volume?ref=digitalocean-kube-ops" +} + +dependency "project" { + config_path = "${get_terragrunt_dir()}/../050-project" +} + +# --------------------------------------------------------------------------------------------------------------------- +# Locals are named constants that are reusable within the configuration. +# --------------------------------------------------------------------------------------------------------------------- +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + + # Load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) +} + +# --------------------------------------------------------------------------------------------------------------------- +# MODULE PARAMETERS +# These are the variables we have to pass in to use the module specified in the terragrunt configuration above +# --------------------------------------------------------------------------------------------------------------------- +inputs = { + volume_name = "vol-${local.environment_vars.locals.project_name}" + volume_region = local.region_vars.locals.digitalocean_region + volume_description = "Volumen of ${local.environment_vars.locals.project_name} in region: ${local.region_vars.locals.digitalocean_region}" + volume_project_id = dependency.project.outputs.project_id +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/README.md b/terraform-modules/digitalocean/volume/README.md index 877a4034a..d71190850 100644 --- a/terraform-modules/digitalocean/volume/README.md +++ b/terraform-modules/digitalocean/volume/README.md @@ -19,6 +19,7 @@ No modules. | Name | Type | |------|------| +| [digitalocean_project_resources.project](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/project_resources) | resource | | [digitalocean_volume.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/volume) | resource | ## Inputs @@ -28,6 +29,7 @@ No modules. | [volume\_description](#input\_volume\_description) | (Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.. | `string` | n/a | yes | | [volume\_initial\_filesystem\_type](#input\_volume\_initial\_filesystem\_type) | (Optional) Initial filesystem type (xfs or ext4) for the block storage volume. | `string` | n/a | yes | | [volume\_name](#input\_volume\_name) | (Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and -, up to a limit of 64 characters. | `string` | n/a | yes | +| [volume\_project\_id](#input\_volume\_project\_id) | (Optional) The id of the project where the vpc will be associated | `string` | n/a | yes | | [volume\_region](#input\_volume\_region) | (Required) The region that the block storage volume will be created in. | `string` | n/a | yes | | [volume\_size](#input\_volume\_size) | (Required) The size of the block storage volume in GiB. If updated, can only be expanded. | `number` | `20` | no | diff --git a/terraform-modules/digitalocean/volume/main.tf b/terraform-modules/digitalocean/volume/main.tf index 60330f73c..f29096ec4 100644 --- a/terraform-modules/digitalocean/volume/main.tf +++ b/terraform-modules/digitalocean/volume/main.tf @@ -13,4 +13,11 @@ resource "digitalocean_volume" "this" { size = var.volume_size initial_filesystem_type = var.volume_initial_filesystem_type description = var.volume_description +} + +resource "digitalocean_project_resources" "project" { + project = var.volume_project_id + resources = [ + digitalocean_volume.this.urn + ] } \ No newline at end of file diff --git a/terraform-modules/digitalocean/volume/variables.tf b/terraform-modules/digitalocean/volume/variables.tf index 8ef64cde4..a3735549c 100644 --- a/terraform-modules/digitalocean/volume/variables.tf +++ b/terraform-modules/digitalocean/volume/variables.tf @@ -25,3 +25,7 @@ variable "volume_description" { description = "(Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.." } +variable "volume_project_id" { + type = string + description = "(Optional) The id of the project where the vpc will be associated" +} diff --git a/terraform-modules/digitalocean/vpc/README.md b/terraform-modules/digitalocean/vpc/README.md index 07643083e..63f55761a 100644 --- a/terraform-modules/digitalocean/vpc/README.md +++ b/terraform-modules/digitalocean/vpc/README.md @@ -25,7 +25,6 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [project\_id](#input\_project\_id) | (Optional) The id of the project where the vpc will be associated | `string` | n/a | yes | | [vpc\_description](#input\_vpc\_description) | (Optional) A free-form text field up to a limit of 255 characters to describe the VPC. | `string` | `"Your new vpc"` | no | | [vpc\_ip\_range](#input\_vpc\_ip\_range) | (Optional) The range of IP addresses for the VPC in CIDR notation. | `string` | `"10.10.10.0/24"` | no | | [vpc\_name](#input\_vpc\_name) | (Required) A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only. | `string` | n/a | yes | diff --git a/terraform-modules/digitalocean/vpc/variables.tf b/terraform-modules/digitalocean/vpc/variables.tf index f71746c1a..e6de089f1 100644 --- a/terraform-modules/digitalocean/vpc/variables.tf +++ b/terraform-modules/digitalocean/vpc/variables.tf @@ -18,7 +18,3 @@ variable "vpc_ip_range" { description = "(Optional) The range of IP addresses for the VPC in CIDR notation." default = "10.10.10.0/24" } -variable "project_id" { - type = string - description = "(Optional) The id of the project where the vpc will be associated" -} \ No newline at end of file From 42a7ab0c1365107d45b8a504645080eef81e4f31 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 17:47:37 -0600 Subject: [PATCH 38/41] xfs volume --- .../0200-volume/.terraform.lock.hcl | 44 +++++++++++++++++++ .../terragrunt-dev/0200-volume/terragrunt.hcl | 1 + 2 files changed, 45 insertions(+) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/.terraform.lock.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/.terraform.lock.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/.terraform.lock.hcl new file mode 100644 index 000000000..200239851 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/.terraform.lock.hcl @@ -0,0 +1,44 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.19.0" + constraints = "2.19.0" + hashes = [ + "h1:XcLoKA2a1MR4foSFeFbJgCADRvsXtN9SyIiJX0fSGys=", + "zh:01cee85343dee2dfc01499e19ef4e56b0c9260eee0a47329231cf500c07b4386", + "zh:099eeddf9baf9c282430231da501a8b96b3fb28507ce3b78e3a185cc9d4b3860", + "zh:191e090e8553355d91842163737d71051aeb499c8ddb23d2e8aae9dab2f8a1a5", + "zh:25356abb47769270730b0ddb0a3eb89aec637395cdcb77c309d23e55839e4461", + "zh:28876afb75ba5367d20e508e05c7657f90922142ff80d8a81a4d68b3381adb86", + "zh:404a304e37c3dec8017318b16ab701553e5242dc2460211346a9dd39242709a6", + "zh:40f53111b01fc78fdc7a6ba47a80d51c9a45e77e5b7d7d5bcae3a0c6f58ffbdf", + "zh:48f212068234df3dcfe5544c96b10403b15a190203742756d7d0573ee0857c17", + "zh:5189fe4fffdbff5c280f6741f55b2de9cb2b8c653cda0b2339c28cd1e3bc7884", + "zh:a7d5840ca789a03a285c67d2838af4d8687c99f3e8fac4ce56fcd23802a66156", + "zh:c0bd3c4555e5d7e6c96d3add3ddd8e41aa0df9e4a4518ad3b7f1d726a4e0a9f4", + "zh:d70a903a6d75533aa4713e255c9c967ec453195f2209439981f015f203805a6e", + "zh:db8110736bd47f99213d72309ebb720718a80b15ddd46e34a8ee9b2125903079", + "zh:e2180f334506601e0a6af8863159cc719ce584fdb23bd45ddc120f33d22cec19", + "zh:eb515a24d231e7f1ef344b9b88fa2071f760ec34fbb47d80bbacdf7e35f3daca", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.19.0" + hashes = [ + "h1:Q1pATpL2UxF68UEvZ95Ocsf4HzdMuzuWu8SjV/8WR40=", + "zh:22820bfa0065f583298015367f8dc015dffa5b19b76dbd78ecf5da8d7d599573", + "zh:31a5c5fade4bd30dbc2b15f448cebb9ed527793c607e8687d3b2101bcf2c4471", + "zh:37c9e469e51aa835a5542510561397541de08b62fc15292588382932624fcf88", + "zh:398bfe1ba7428ef03293c6618067ddd8c0aaae8bbe764177ae951259228af724", + "zh:4610f5a93ef956103d719ae73872a52ecd6cb321452c26a879896348bc27eed9", + "zh:4a0d570dc5f01f41538b4eb70086a00dfb25c5d00fd27c950ac209d3609486f6", + "zh:4fb65ce84801f82a3beb4e2cb72c5d52ca04d4717ed3890b206da346f02d5def", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9bb3919bd6d94fb22025540f0c1db5eceec8927bd71b8fbdcd295609c999065f", + "zh:ce2623a13f74677cdb948607e456ce00407c57333b8310d5c9d053fc3defbc78", + "zh:e0d57e8784e6ccfa96fdd07ae1ddcc947be242bc11e7a5dd16b520b4204e0d09", + "zh:f988b7c37e95a5b3a493a6b9dcc5ed270136f97d5c0effa84a51940f71626c12", + ] +} diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl index 107f17901..e7e489132 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl @@ -33,5 +33,6 @@ inputs = { volume_name = "vol-${local.environment_vars.locals.project_name}" volume_region = local.region_vars.locals.digitalocean_region volume_description = "Volumen of ${local.environment_vars.locals.project_name} in region: ${local.region_vars.locals.digitalocean_region}" + volume_initial_filesystem_type = "xfs" volume_project_id = dependency.project.outputs.project_id } \ No newline at end of file From 482b56c41dbdaf18ab1d38011faf2ceea7b2817a Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 18:14:37 -0600 Subject: [PATCH 39/41] droplet sutff --- .../terragrunt-dev/0200-volume/terragrunt.hcl | 2 + .../0201-droplet-1/terragrunt.hcl | 50 +++++++++++++++++++ .../digitalocean/droplet/README.md | 2 + .../digitalocean/droplet/main.tf | 7 +++ .../digitalocean/droplet/variables.tf | 6 ++- .../digitalocean/volume/README.md | 2 +- .../digitalocean/volume/variables.tf | 2 +- 7 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl index e7e489132..9039725ac 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl @@ -23,6 +23,8 @@ locals { # Load environment-level variables environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) + + } # --------------------------------------------------------------------------------------------------------------------- diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl new file mode 100644 index 000000000..0f08c9864 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl @@ -0,0 +1,50 @@ +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +terraform { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/droplet?ref=digitalocean-kube-ops" +} + +dependency "project" { + config_path = "${get_terragrunt_dir()}/../050-project" +} + +dependency "vpc" { + config_path = "${get_terragrunt_dir()}/../0100-project" +} + +# --------------------------------------------------------------------------------------------------------------------- +# Locals are named constants that are reusable within the configuration. +# --------------------------------------------------------------------------------------------------------------------- +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + + # Load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) + + # Project name + project_name = local.environment_vars.locals.project_name + + # Region name + region_name=local.region_vars.locals.digitalocean_region +} + +# --------------------------------------------------------------------------------------------------------------------- +# MODULE PARAMETERS +# These are the variables we have to pass in to use the module specified in the terragrunt configuration above +# --------------------------------------------------------------------------------------------------------------------- +inputs = { + droplet_name = "drop-${local.project_name}" + droplet_image = "ubuntu-18-04-x64" + droplet_monitoring = true + droplet_region = "${local.region_name}" + droplet_size = "s-1vcpu-1gb" + droplet_user_data = "" + droplet_vpc_uuid = dependency.project.outputs.project_id +} \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/README.md b/terraform-modules/digitalocean/droplet/README.md index 3aef51669..d75bc0f53 100644 --- a/terraform-modules/digitalocean/droplet/README.md +++ b/terraform-modules/digitalocean/droplet/README.md @@ -23,6 +23,7 @@ No modules. | Name | Type | |------|------| | [digitalocean_droplet.this](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/droplet) | resource | +| [digitalocean_project_resources.project](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/project_resources) | resource | ## Inputs @@ -31,6 +32,7 @@ No modules. | [droplet\_image](#input\_droplet\_image) | (Required) The Droplet image ID or slug | `string` | n/a | yes | | [droplet\_monitoring](#input\_droplet\_monitoring) | (Optional) Boolean controlling whether monitoring agent is installed. Defaults to false. If set to true, you can configure monitor alert policies monitor alert | `bool` | `false` | no | | [droplet\_name](#input\_droplet\_name) | (Required) The Droplet name. | `string` | n/a | yes | +| [droplet\_project\_id](#input\_droplet\_project\_id) | (Optional) The id of the project where the droplet will be associated | `string` | n/a | yes | | [droplet\_region](#input\_droplet\_region) | (Required) The region to start in. | `string` | n/a | yes | | [droplet\_size](#input\_droplet\_size) | (Required) The unique slug that indentifies the type of Droplet. You can find a list of available slugs on DigitalOcean API documentation. | `string` | n/a | yes | | [droplet\_user\_data](#input\_droplet\_user\_data) | (Optional) A string of the desired User Data for the Droplet. | `string` | n/a | yes | diff --git a/terraform-modules/digitalocean/droplet/main.tf b/terraform-modules/digitalocean/droplet/main.tf index b5854c070..9d4be002b 100644 --- a/terraform-modules/digitalocean/droplet/main.tf +++ b/terraform-modules/digitalocean/droplet/main.tf @@ -14,4 +14,11 @@ resource "digitalocean_droplet" "this" { size = var.droplet_size monitoring = var.droplet_monitoring vpc_uuid = var.droplet_vpc_uuid +} + +resource "digitalocean_project_resources" "project" { + project = var.droplet_project_id + resources = [ + digitalocean_droplet.this.urn + ] } \ No newline at end of file diff --git a/terraform-modules/digitalocean/droplet/variables.tf b/terraform-modules/digitalocean/droplet/variables.tf index 54fa21e39..745f02227 100644 --- a/terraform-modules/digitalocean/droplet/variables.tf +++ b/terraform-modules/digitalocean/droplet/variables.tf @@ -34,4 +34,8 @@ variable "droplet_user_data" { type = string description = "(Optional) A string of the desired User Data for the Droplet." } - \ No newline at end of file + +variable "droplet_project_id" { + type = string + description = "(Optional) The id of the project where the droplet will be associated" +} diff --git a/terraform-modules/digitalocean/volume/README.md b/terraform-modules/digitalocean/volume/README.md index d71190850..cd9245bbe 100644 --- a/terraform-modules/digitalocean/volume/README.md +++ b/terraform-modules/digitalocean/volume/README.md @@ -29,7 +29,7 @@ No modules. | [volume\_description](#input\_volume\_description) | (Optional) A free-form text field up to a limit of 1024 bytes to describe a block storage volume.. | `string` | n/a | yes | | [volume\_initial\_filesystem\_type](#input\_volume\_initial\_filesystem\_type) | (Optional) Initial filesystem type (xfs or ext4) for the block storage volume. | `string` | n/a | yes | | [volume\_name](#input\_volume\_name) | (Required) A name for the block storage volume. Must be lowercase and be composed only of numbers, letters and -, up to a limit of 64 characters. | `string` | n/a | yes | -| [volume\_project\_id](#input\_volume\_project\_id) | (Optional) The id of the project where the vpc will be associated | `string` | n/a | yes | +| [volume\_project\_id](#input\_volume\_project\_id) | (Optional) The id of the project where the volume will be associated | `string` | n/a | yes | | [volume\_region](#input\_volume\_region) | (Required) The region that the block storage volume will be created in. | `string` | n/a | yes | | [volume\_size](#input\_volume\_size) | (Required) The size of the block storage volume in GiB. If updated, can only be expanded. | `number` | `20` | no | diff --git a/terraform-modules/digitalocean/volume/variables.tf b/terraform-modules/digitalocean/volume/variables.tf index a3735549c..6c3acd4b4 100644 --- a/terraform-modules/digitalocean/volume/variables.tf +++ b/terraform-modules/digitalocean/volume/variables.tf @@ -27,5 +27,5 @@ variable "volume_description" { variable "volume_project_id" { type = string - description = "(Optional) The id of the project where the vpc will be associated" + description = "(Optional) The id of the project where the volume will be associated" } From afc3cfed70e3138235844a002b5cec3137d5c47b Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 18:39:06 -0600 Subject: [PATCH 40/41] droplet lock --- .../0201-droplet/.terraform.lock.hcl | 44 +++++++++++++++++++ .../terragrunt.hcl | 5 ++- 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/.terraform.lock.hcl rename terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/{0201-droplet-1 => 0201-droplet}/terragrunt.hcl (91%) diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/.terraform.lock.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/.terraform.lock.hcl new file mode 100644 index 000000000..200239851 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/.terraform.lock.hcl @@ -0,0 +1,44 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.19.0" + constraints = "2.19.0" + hashes = [ + "h1:XcLoKA2a1MR4foSFeFbJgCADRvsXtN9SyIiJX0fSGys=", + "zh:01cee85343dee2dfc01499e19ef4e56b0c9260eee0a47329231cf500c07b4386", + "zh:099eeddf9baf9c282430231da501a8b96b3fb28507ce3b78e3a185cc9d4b3860", + "zh:191e090e8553355d91842163737d71051aeb499c8ddb23d2e8aae9dab2f8a1a5", + "zh:25356abb47769270730b0ddb0a3eb89aec637395cdcb77c309d23e55839e4461", + "zh:28876afb75ba5367d20e508e05c7657f90922142ff80d8a81a4d68b3381adb86", + "zh:404a304e37c3dec8017318b16ab701553e5242dc2460211346a9dd39242709a6", + "zh:40f53111b01fc78fdc7a6ba47a80d51c9a45e77e5b7d7d5bcae3a0c6f58ffbdf", + "zh:48f212068234df3dcfe5544c96b10403b15a190203742756d7d0573ee0857c17", + "zh:5189fe4fffdbff5c280f6741f55b2de9cb2b8c653cda0b2339c28cd1e3bc7884", + "zh:a7d5840ca789a03a285c67d2838af4d8687c99f3e8fac4ce56fcd23802a66156", + "zh:c0bd3c4555e5d7e6c96d3add3ddd8e41aa0df9e4a4518ad3b7f1d726a4e0a9f4", + "zh:d70a903a6d75533aa4713e255c9c967ec453195f2209439981f015f203805a6e", + "zh:db8110736bd47f99213d72309ebb720718a80b15ddd46e34a8ee9b2125903079", + "zh:e2180f334506601e0a6af8863159cc719ce584fdb23bd45ddc120f33d22cec19", + "zh:eb515a24d231e7f1ef344b9b88fa2071f760ec34fbb47d80bbacdf7e35f3daca", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.19.0" + hashes = [ + "h1:Q1pATpL2UxF68UEvZ95Ocsf4HzdMuzuWu8SjV/8WR40=", + "zh:22820bfa0065f583298015367f8dc015dffa5b19b76dbd78ecf5da8d7d599573", + "zh:31a5c5fade4bd30dbc2b15f448cebb9ed527793c607e8687d3b2101bcf2c4471", + "zh:37c9e469e51aa835a5542510561397541de08b62fc15292588382932624fcf88", + "zh:398bfe1ba7428ef03293c6618067ddd8c0aaae8bbe764177ae951259228af724", + "zh:4610f5a93ef956103d719ae73872a52ecd6cb321452c26a879896348bc27eed9", + "zh:4a0d570dc5f01f41538b4eb70086a00dfb25c5d00fd27c950ac209d3609486f6", + "zh:4fb65ce84801f82a3beb4e2cb72c5d52ca04d4717ed3890b206da346f02d5def", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9bb3919bd6d94fb22025540f0c1db5eceec8927bd71b8fbdcd295609c999065f", + "zh:ce2623a13f74677cdb948607e456ce00407c57333b8310d5c9d053fc3defbc78", + "zh:e0d57e8784e6ccfa96fdd07ae1ddcc947be242bc11e7a5dd16b520b4204e0d09", + "zh:f988b7c37e95a5b3a493a6b9dcc5ed270136f97d5c0effa84a51940f71626c12", + ] +} diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/terragrunt.hcl similarity index 91% rename from terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl rename to terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/terragrunt.hcl index 0f08c9864..0f7192dcd 100644 --- a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet-1/terragrunt.hcl +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/terragrunt.hcl @@ -12,7 +12,7 @@ dependency "project" { } dependency "vpc" { - config_path = "${get_terragrunt_dir()}/../0100-project" + config_path = "${get_terragrunt_dir()}/../0100-vpc" } # --------------------------------------------------------------------------------------------------------------------- @@ -46,5 +46,6 @@ inputs = { droplet_region = "${local.region_name}" droplet_size = "s-1vcpu-1gb" droplet_user_data = "" - droplet_vpc_uuid = dependency.project.outputs.project_id + droplet_vpc_uuid = dependency.vpc.outputs.vpc_id + droplet_project_id = dependency.project.outputs.project_id } \ No newline at end of file From 3257b5afc7c1040fb3bb2a479728943f9c865111 Mon Sep 17 00:00:00 2001 From: bcarranza Date: Sun, 19 Jun 2022 20:05:57 -0600 Subject: [PATCH 41/41] droplet volume --- .../0202-droplet-volume/.terraform.lock.hcl | 44 ++++++++++++++++++ .../0202-droplet-volume/terragrunt.hcl | 45 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/.terraform.lock.hcl create mode 100644 terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/terragrunt.hcl diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/.terraform.lock.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/.terraform.lock.hcl new file mode 100644 index 000000000..200239851 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/.terraform.lock.hcl @@ -0,0 +1,44 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/digitalocean/digitalocean" { + version = "2.19.0" + constraints = "2.19.0" + hashes = [ + "h1:XcLoKA2a1MR4foSFeFbJgCADRvsXtN9SyIiJX0fSGys=", + "zh:01cee85343dee2dfc01499e19ef4e56b0c9260eee0a47329231cf500c07b4386", + "zh:099eeddf9baf9c282430231da501a8b96b3fb28507ce3b78e3a185cc9d4b3860", + "zh:191e090e8553355d91842163737d71051aeb499c8ddb23d2e8aae9dab2f8a1a5", + "zh:25356abb47769270730b0ddb0a3eb89aec637395cdcb77c309d23e55839e4461", + "zh:28876afb75ba5367d20e508e05c7657f90922142ff80d8a81a4d68b3381adb86", + "zh:404a304e37c3dec8017318b16ab701553e5242dc2460211346a9dd39242709a6", + "zh:40f53111b01fc78fdc7a6ba47a80d51c9a45e77e5b7d7d5bcae3a0c6f58ffbdf", + "zh:48f212068234df3dcfe5544c96b10403b15a190203742756d7d0573ee0857c17", + "zh:5189fe4fffdbff5c280f6741f55b2de9cb2b8c653cda0b2339c28cd1e3bc7884", + "zh:a7d5840ca789a03a285c67d2838af4d8687c99f3e8fac4ce56fcd23802a66156", + "zh:c0bd3c4555e5d7e6c96d3add3ddd8e41aa0df9e4a4518ad3b7f1d726a4e0a9f4", + "zh:d70a903a6d75533aa4713e255c9c967ec453195f2209439981f015f203805a6e", + "zh:db8110736bd47f99213d72309ebb720718a80b15ddd46e34a8ee9b2125903079", + "zh:e2180f334506601e0a6af8863159cc719ce584fdb23bd45ddc120f33d22cec19", + "zh:eb515a24d231e7f1ef344b9b88fa2071f760ec34fbb47d80bbacdf7e35f3daca", + ] +} + +provider "registry.terraform.io/hashicorp/aws" { + version = "4.19.0" + hashes = [ + "h1:Q1pATpL2UxF68UEvZ95Ocsf4HzdMuzuWu8SjV/8WR40=", + "zh:22820bfa0065f583298015367f8dc015dffa5b19b76dbd78ecf5da8d7d599573", + "zh:31a5c5fade4bd30dbc2b15f448cebb9ed527793c607e8687d3b2101bcf2c4471", + "zh:37c9e469e51aa835a5542510561397541de08b62fc15292588382932624fcf88", + "zh:398bfe1ba7428ef03293c6618067ddd8c0aaae8bbe764177ae951259228af724", + "zh:4610f5a93ef956103d719ae73872a52ecd6cb321452c26a879896348bc27eed9", + "zh:4a0d570dc5f01f41538b4eb70086a00dfb25c5d00fd27c950ac209d3609486f6", + "zh:4fb65ce84801f82a3beb4e2cb72c5d52ca04d4717ed3890b206da346f02d5def", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9bb3919bd6d94fb22025540f0c1db5eceec8927bd71b8fbdcd295609c999065f", + "zh:ce2623a13f74677cdb948607e456ce00407c57333b8310d5c9d053fc3defbc78", + "zh:e0d57e8784e6ccfa96fdd07ae1ddcc947be242bc11e7a5dd16b520b4204e0d09", + "zh:f988b7c37e95a5b3a493a6b9dcc5ed270136f97d5c0effa84a51940f71626c12", + ] +} diff --git a/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/terragrunt.hcl new file mode 100644 index 000000000..683138307 --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0202-droplet-volume/terragrunt.hcl @@ -0,0 +1,45 @@ +# Include all settings from the root terragrunt.hcl file +include { + path = find_in_parent_folders() +} + +terraform { + source = "github.com/ManagedKube/kubernetes-ops//terraform-modules/digitalocean/droplet_volume?ref=digitalocean-kube-ops" +} + +dependency "volume" { + config_path = "${get_terragrunt_dir()}/../0200-volume" +} + +dependency "droplet" { + config_path = "${get_terragrunt_dir()}/../0201-droplet" +} + +# --------------------------------------------------------------------------------------------------------------------- +# Locals are named constants that are reusable within the configuration. +# --------------------------------------------------------------------------------------------------------------------- +locals { + # Load common variables shared across all accounts + common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl")) + + # Load region-level variables + region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl")) + + # Load environment-level variables + environment_vars = read_terragrunt_config(find_in_parent_folders("environment.hcl")) + + # Project name + project_name = local.environment_vars.locals.project_name + + # Region name + region_name=local.region_vars.locals.digitalocean_region +} + +# --------------------------------------------------------------------------------------------------------------------- +# MODULE PARAMETERS +# These are the variables we have to pass in to use the module specified in the terragrunt configuration above +# --------------------------------------------------------------------------------------------------------------------- +inputs = { + droplet_id = dependency.droplet.outputs.droplet_id + volume_id = dependency.volume.outputs.volume_id +} \ No newline at end of file