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..07d818aae --- /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/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..7dd412c9e --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0100-vpc/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/vpc?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 = { + 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" +} \ No newline at end of file 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 new file mode 100644 index 000000000..9039725ac --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0200-volume/terragrunt.hcl @@ -0,0 +1,40 @@ +# 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_initial_filesystem_type = "xfs" + volume_project_id = dependency.project.outputs.project_id +} \ No newline at end of file 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/terragrunt.hcl b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/terragrunt.hcl new file mode 100644 index 000000000..0f7192dcd --- /dev/null +++ b/terraform-environments/digitalocean/terragrunt-dev/SFO3/terragrunt-dev/0201-droplet/terragrunt.hcl @@ -0,0 +1,51 @@ +# 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-vpc" +} + +# --------------------------------------------------------------------------------------------------------------------- +# 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.vpc.outputs.vpc_id + droplet_project_id = dependency.project.outputs.project_id +} \ No newline at end of file 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 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-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..4a44ffb5c --- /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.locals.project_name + description = "Digital Ocean Managed Kube" + purpose = "Infra Testing" + environment = "development" +} \ 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 = < +## 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 | +| [digitalocean_project_resources.project](https://registry.terraform.io/providers/digitalocean/digitalocean/2.19.0/docs/resources/project_resources) | 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\_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 | +| [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/main.tf b/terraform-modules/digitalocean/droplet/main.tf new file mode 100644 index 000000000..9d4be002b --- /dev/null +++ b/terraform-modules/digitalocean/droplet/main.tf @@ -0,0 +1,24 @@ +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 +} + +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/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..745f02227 --- /dev/null +++ b/terraform-modules/digitalocean/droplet/variables.tf @@ -0,0 +1,41 @@ +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 +} + +variable "droplet_user_data" { + type = string + description = "(Optional) A string of the desired User Data for the Droplet." +} + +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/droplet_volume/README.md b/terraform-modules/digitalocean/droplet_volume/README.md new file mode 100644 index 000000000..d32a1e47d --- /dev/null +++ b/terraform-modules/digitalocean/droplet_volume/README.md @@ -0,0 +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/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." +} + 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/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 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/project/README.md b/terraform-modules/digitalocean/project/README.md new file mode 100644 index 000000000..0c7144ddb --- /dev/null +++ b/terraform-modules/digitalocean/project/README.md @@ -0,0 +1,76 @@ +## Description +The module is capable of creating a project to group a set of digital ocean resources + +## Requirements + +No requirements. + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| digitalocean_project | [registry.terraform.io/providers/digitalocean/project](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project) | 2.19.0 | + +## Resources + +No resources. + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| `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 | +|------|-------------| +| `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/project/main.tf b/terraform-modules/digitalocean/project/main.tf new file mode 100644 index 000000000..46c44bf73 --- /dev/null +++ b/terraform-modules/digitalocean/project/main.tf @@ -0,0 +1,14 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} +resource "digitalocean_project" "this" { + 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 new file mode 100644 index 000000000..cb03f9873 --- /dev/null +++ b/terraform-modules/digitalocean/project/output.tf @@ -0,0 +1,9 @@ +output "project_id" { + description = "The id of the project" + value = digitalocean_project.this.id +} + +output "project_owner_uuid" { + description = "The unique universal identifier of the project owner." + value = digitalocean_project.this.owner_uuid +} diff --git a/terraform-modules/digitalocean/project/variables.tf b/terraform-modules/digitalocean/project/variables.tf new file mode 100644 index 000000000..9db503c1b --- /dev/null +++ b/terraform-modules/digitalocean/project/variables.tf @@ -0,0 +1,23 @@ +variable "project_name" { + type = string + description = "(Required) The name of the project" + default = "playground" +} + +variable "project_description" { + type = string + description = "(Optional) The name of description" + default = "A project to represent development resources." +} + +variable "project_purpose" { + type = string + description = "(Optional) A purpose for the project" + default = "Web Application" +} + +variable "project_environment" { + type = string + description = "(Optional) Kind of dev, qa or prod" + default = "development" +} \ 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..cd9245bbe --- /dev/null +++ b/terraform-modules/digitalocean/volume/README.md @@ -0,0 +1,42 @@ + +## 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_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 + +| 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\_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 | + +## 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/main.tf b/terraform-modules/digitalocean/volume/main.tf new file mode 100644 index 000000000..f29096ec4 --- /dev/null +++ b/terraform-modules/digitalocean/volume/main.tf @@ -0,0 +1,23 @@ +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 +} + +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/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..6c3acd4b4 --- /dev/null +++ b/terraform-modules/digitalocean/volume/variables.tf @@ -0,0 +1,31 @@ + +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 + default = 20 + 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.." +} + +variable "volume_project_id" { + type = string + description = "(Optional) The id of the project where the volume will be associated" +} diff --git a/terraform-modules/digitalocean/vpc/README.md b/terraform-modules/digitalocean/vpc/README.md new file mode 100644 index 000000000..63f55761a --- /dev/null +++ b/terraform-modules/digitalocean/vpc/README.md @@ -0,0 +1,40 @@ + +## 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 | +|------|-------------|------|---------|:--------:| +| [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 diff --git a/terraform-modules/digitalocean/vpc/main.tf b/terraform-modules/digitalocean/vpc/main.tf new file mode 100644 index 000000000..61d0de6fc --- /dev/null +++ b/terraform-modules/digitalocean/vpc/main.tf @@ -0,0 +1,16 @@ +terraform { + required_providers { + digitalocean = { + source = "digitalocean/digitalocean" + version = "2.19.0" + } + } +} +#Create vpc in digital ocean +resource "digitalocean_vpc" "this" { + name = var.vpc_name + description = var.vpc_description + region = var.vpc_region + ip_range = var.vpc_ip_range +} + diff --git a/terraform-modules/digitalocean/vpc/output.tf b/terraform-modules/digitalocean/vpc/output.tf new file mode 100644 index 000000000..c5c7b7e7b --- /dev/null +++ b/terraform-modules/digitalocean/vpc/output.tf @@ -0,0 +1,12 @@ +output "vpc_id" { + description = "The unique identifier for the VPC." + value = digitalocean_vpc.this.id +} +output "vpc_urn" { + description = "The uniform resource name (URN) for the VPC." + 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.this.default +} \ 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..e6de089f1 --- /dev/null +++ b/terraform-modules/digitalocean/vpc/variables.tf @@ -0,0 +1,20 @@ +variable "vpc_name" { + type = string + description = "(Required) A name for the VPC. Must be unique and contain alphanumeric characters, dashes, and periods only." +} + +variable "vpc_region" { + type = string + description = "(Required) The DigitalOcean region slug for the VPC's location." +} + +variable "vpc_description" { + type = string + 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 = "(Optional) The range of IP addresses for the VPC in CIDR notation." + default = "10.10.10.0/24" +}