From aca1b5ae32fdf05114bbbf4283dce8f1588b0d7a Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 13:14:32 +0100 Subject: [PATCH 01/19] main variable outputs versions example --- examples/example_of_use/main.tf | 45 ++++++++++++++++++++- examples/example_of_use/versions.tf | 14 +++---- main.tf | 28 ++++++++++++- outputs.tf | 18 +++++++-- variables.tf | 63 +++++++++++++++++++++++------ versions.tf | 14 +++---- 6 files changed, 145 insertions(+), 37 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 9eda987..392943e 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -1,4 +1,45 @@ -module "module_name" { - source = "../../" +module "digitalocean_droplet" { + source = "github.com/opsd-io/terraform-module-digitalocean-droplet?ref=MB_droplet_creation" + image = "ubuntu-20-04-x64" + name = "web-1" + region = "nyc1" + size = "s-1vcpu-1gb" +} +module "digitalocean_loadbalancer" { + source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" + name = var.name + region = var.region + size = var.size + size_unit = var.size_unit + vpc_uuid = var.vpc_uuid + droplet_ids = var.droplet_ids + droplet_tag = var.droplet_tag } + +# resource "digitalocean_droplet" "web" { +# name = "web-1" +# size = "s-1vcpu-1gb" +# image = "ubuntu-18-04-x64" +# region = "nyc3" +# } + +# resource "digitalocean_loadbalancer" "public" { +# name = "loadbalancer-1" +# region = "nyc3" + +# forwarding_rule { +# entry_port = 80 +# entry_protocol = "http" + +# target_port = 80 +# target_protocol = "http" +# } + +# healthcheck { +# port = 22 +# protocol = "tcp" +# } + +# droplet_ids = [digitalocean_droplet.web.id] +# } \ No newline at end of file diff --git a/examples/example_of_use/versions.tf b/examples/example_of_use/versions.tf index b7d3369..1c9de3c 100644 --- a/examples/example_of_use/versions.tf +++ b/examples/example_of_use/versions.tf @@ -1,13 +1,9 @@ terraform { - required_version = ">= 1.3.1" + required_version = ">= 1.5.7" required_providers { - # github = { - # source = "integrations/github" - # version = ">= 5.3.0" - # } - # azurerm = { - # source = "hashicorp/azurerm" - # version = ">= 3.22.0" - # } + digitalocean = { + source = "digitalocean/digitalocean" + version = ">= 2.34.1" + } } } diff --git a/main.tf b/main.tf index 1c6a2e5..dedf17f 100644 --- a/main.tf +++ b/main.tf @@ -1 +1,27 @@ -# Terraform code goes here +resource "digitalocean_loadbalancer" "main" { + name = var.name + region = var.region + size = var.size + size_unit = var.size_unit + vpc_uuid = var.vpc_uuid + droplet_ids = var.droplet_ids + droplet_tag = var.droplet_tag + + dynamic "forwarding_rule" { + for_each = var.forwarding_rule + content { + entry_port = forwarding_rule.value.entry_port + entry_protocol = forwarding_rule.value.entry_protocol + target_port = forwarding_rule.value.target_port + target_protocol = forwarding_rule.value.target_protocol + } + } + + dynamic "firewall" { + for_each = var.firewall + content { + deny = lookup(firewall.value, "deny", null) + allow = lookup(firewall.value, "allow", null) + } + } + } \ No newline at end of file diff --git a/outputs.tf b/outputs.tf index 47cec5f..5acdf6a 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,14 @@ -# output "variable" { -# description = "output variable description" -# value = variable.main.name -# } +output "id" { + description = "The ID of the Load Balancer." + value = digitalocean_loadbalancer.main.id +} + +output "ip" { + description = "The ip of the Load Balancer." + value = digitalocean_loadbalancer.main.ip +} + +output "urn" { + description = "The urn for the Load Balancer." + value = digitalocean_loadbalancer.main.urn +} \ No newline at end of file diff --git a/variables.tf b/variables.tf index a27d76b..cf952d4 100644 --- a/variables.tf +++ b/variables.tf @@ -1,12 +1,51 @@ -# variable "variable_name" { -# description = "variable description" -# type = number -# default = 1 -# } - -# variable "variable_password" { -# description = "variable description" -# type = string -# sensitive = true -# default = "abc" -# } +variable "name" { + description = "The Load Balancer name" + type = string +} + +variable "region" { + description = "The region to start in" + type = string +} + +variable "size" { + description = "The size of the Load Balancer. It must be either lb-small, lb-medium, or lb-large. Defaults to lb-small. Only one of size or size_unit may be provided." + type = string + default = "lb-small" +} + +variable "size_unit" { + description = "The size of the Load Balancer. It must be in the range (1, 100). Defaults to 1. Only one of size or size_unit may be provided." + type = number + default = 1 +} + +variable "vpc_uuid" { + description = "The ID of the VPC where the load balancer will be located." + type = string + default = "" +} + +variable "forwarding_rule" { + description = "List of objects for forwarding_rule." + type = list(any) + default = [] +} + +variable "droplet_ids" { + description = "A list of the IDs of each droplet to be attached to the Load Balancer." + type = list(string) + default = [] +} + +variable "droplet_tag" { + description = "The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer." + type = string + default = null +} + +variable "firewall" { + description = "List of objects that represent the configuration of each healthcheck." + type = list(any) + default = [] +} diff --git a/versions.tf b/versions.tf index b7d3369..1c9de3c 100644 --- a/versions.tf +++ b/versions.tf @@ -1,13 +1,9 @@ terraform { - required_version = ">= 1.3.1" + required_version = ">= 1.5.7" required_providers { - # github = { - # source = "integrations/github" - # version = ">= 5.3.0" - # } - # azurerm = { - # source = "hashicorp/azurerm" - # version = ">= 3.22.0" - # } + digitalocean = { + source = "digitalocean/digitalocean" + version = ">= 2.34.1" + } } } From 97dd03ba312e55e78d3328de1808b8014adf38b4 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:12:31 +0100 Subject: [PATCH 02/19] example changes --- examples/example_of_use/main.tf | 44 +++++++++------------------------ 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 392943e..c4e4fcd 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -8,38 +8,16 @@ module "digitalocean_droplet" { module "digitalocean_loadbalancer" { source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" - name = var.name - region = var.region - size = var.size - size_unit = var.size_unit - vpc_uuid = var.vpc_uuid - droplet_ids = var.droplet_ids - droplet_tag = var.droplet_tag -} - -# resource "digitalocean_droplet" "web" { -# name = "web-1" -# size = "s-1vcpu-1gb" -# image = "ubuntu-18-04-x64" -# region = "nyc3" -# } - -# resource "digitalocean_loadbalancer" "public" { -# name = "loadbalancer-1" -# region = "nyc3" - -# forwarding_rule { -# entry_port = 80 -# entry_protocol = "http" - -# target_port = 80 -# target_protocol = "http" -# } + name = "loadbalancer-1" + region = "nyc1" + droplet_ids = [digitalocean_droplet.main.id] + -# healthcheck { -# port = 22 -# protocol = "tcp" -# } + forwarding_rule { + entry_port = 80 + entry_protocol = "http" -# droplet_ids = [digitalocean_droplet.web.id] -# } \ No newline at end of file + target_port = 80 + target_protocol = "http" + } +} \ No newline at end of file From 7b4506daea22533437a38e75cb308bb8441d4845 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:13:42 +0100 Subject: [PATCH 03/19] python change --- .tool-versions | 1 + 1 file changed, 1 insertion(+) diff --git a/.tool-versions b/.tool-versions index 6396e99..ced047d 100644 --- a/.tool-versions +++ b/.tool-versions @@ -2,3 +2,4 @@ terraform 1.5.7 terraform-docs 0.17.0 tflint 0.50.3 pre-commit 3.6.2 +python 3.12.1 \ No newline at end of file From 580ed628fc5bf13c281608b9d98b828021c0835e Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:14:58 +0100 Subject: [PATCH 04/19] test --- examples/example_of_use/main.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index c4e4fcd..9bf68e3 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -7,11 +7,11 @@ module "digitalocean_droplet" { } module "digitalocean_loadbalancer" { - source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" - name = "loadbalancer-1" - region = "nyc1" + source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" + name = "loadbalancer-1" + region = "nyc1" droplet_ids = [digitalocean_droplet.main.id] - + forwarding_rule { entry_port = 80 @@ -20,4 +20,4 @@ module "digitalocean_loadbalancer" { target_port = 80 target_protocol = "http" } -} \ No newline at end of file +} From 5566557faf6c971643c2a1aeb785798703ef5214 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:18:33 +0100 Subject: [PATCH 05/19] added provider --- examples/example_of_use/main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 9bf68e3..cd57769 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -1,3 +1,7 @@ +provider "digitalocean" { + token = var.do_token +} + module "digitalocean_droplet" { source = "github.com/opsd-io/terraform-module-digitalocean-droplet?ref=MB_droplet_creation" image = "ubuntu-20-04-x64" From 92ced34963c23c7b806474eb8bbbab5ea02113a8 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:20:06 +0100 Subject: [PATCH 06/19] variables --- examples/example_of_use/variables.tf | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 examples/example_of_use/variables.tf diff --git a/examples/example_of_use/variables.tf b/examples/example_of_use/variables.tf new file mode 100644 index 0000000..d02e743 --- /dev/null +++ b/examples/example_of_use/variables.tf @@ -0,0 +1,4 @@ +variable "do_token" { + description = "Token to digitalOcean API" + type = string +} From 3c2c8fb06437e61c43ee635383a0d43db082cbe7 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:25:01 +0100 Subject: [PATCH 07/19] changes precommit --- .tool-versions | 2 +- README.md | 29 ++++++++++++++++++++++++----- main.tf | 26 +++++++++++++------------- outputs.tf | 2 +- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/.tool-versions b/.tool-versions index ced047d..f1ecc83 100644 --- a/.tool-versions +++ b/.tool-versions @@ -2,4 +2,4 @@ terraform 1.5.7 terraform-docs 0.17.0 tflint 0.50.3 pre-commit 3.6.2 -python 3.12.1 \ No newline at end of file +python 3.12.1 diff --git a/README.md b/README.md index a95ff6c..cd8177b 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,14 @@ module "module_name" { | Name | Version | |------|---------| -| [terraform](#requirement\_terraform) | >= 1.3.1 | +| [terraform](#requirement\_terraform) | >= 1.5.7 | +| [digitalocean](#requirement\_digitalocean) | >= 2.34.1 | ## Providers -No providers. +| Name | Version | +|------|---------| +| [digitalocean](#provider\_digitalocean) | >= 2.34.1 | ## Modules @@ -43,15 +46,31 @@ No modules. ## Resources -No resources. +| Name | Type | +|------|------| +| [digitalocean_loadbalancer.main](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/loadbalancer) | resource | ## Inputs -No inputs. +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [droplet\_ids](#input\_droplet\_ids) | A list of the IDs of each droplet to be attached to the Load Balancer. | `list(string)` | `[]` | no | +| [droplet\_tag](#input\_droplet\_tag) | The name of a Droplet tag corresponding to Droplets to be assigned to the Load Balancer. | `string` | `null` | no | +| [firewall](#input\_firewall) | List of objects that represent the configuration of each healthcheck. | `list(any)` | `[]` | no | +| [forwarding\_rule](#input\_forwarding\_rule) | List of objects for forwarding\_rule. | `list(any)` | `[]` | no | +| [name](#input\_name) | The Load Balancer name | `string` | n/a | yes | +| [region](#input\_region) | The region to start in | `string` | n/a | yes | +| [size](#input\_size) | The size of the Load Balancer. It must be either lb-small, lb-medium, or lb-large. Defaults to lb-small. Only one of size or size\_unit may be provided. | `string` | `"lb-small"` | no | +| [size\_unit](#input\_size\_unit) | The size of the Load Balancer. It must be in the range (1, 100). Defaults to 1. Only one of size or size\_unit may be provided. | `number` | `1` | no | +| [vpc\_uuid](#input\_vpc\_uuid) | The ID of the VPC where the load balancer will be located. | `string` | `""` | no | ## Outputs -No outputs. +| Name | Description | +|------|-------------| +| [id](#output\_id) | The ID of the Load Balancer. | +| [ip](#output\_ip) | The ip of the Load Balancer. | +| [urn](#output\_urn) | The urn for the Load Balancer. | ## Examples of usage diff --git a/main.tf b/main.tf index dedf17f..4995f61 100644 --- a/main.tf +++ b/main.tf @@ -1,22 +1,22 @@ resource "digitalocean_loadbalancer" "main" { - name = var.name - region = var.region - size = var.size - size_unit = var.size_unit - vpc_uuid = var.vpc_uuid - droplet_ids = var.droplet_ids - droplet_tag = var.droplet_tag + name = var.name + region = var.region + size = var.size + size_unit = var.size_unit + vpc_uuid = var.vpc_uuid + droplet_ids = var.droplet_ids + droplet_tag = var.droplet_tag dynamic "forwarding_rule" { for_each = var.forwarding_rule content { - entry_port = forwarding_rule.value.entry_port - entry_protocol = forwarding_rule.value.entry_protocol - target_port = forwarding_rule.value.target_port - target_protocol = forwarding_rule.value.target_protocol + entry_port = forwarding_rule.value.entry_port + entry_protocol = forwarding_rule.value.entry_protocol + target_port = forwarding_rule.value.target_port + target_protocol = forwarding_rule.value.target_protocol } } - + dynamic "firewall" { for_each = var.firewall content { @@ -24,4 +24,4 @@ resource "digitalocean_loadbalancer" "main" { allow = lookup(firewall.value, "allow", null) } } - } \ No newline at end of file +} diff --git a/outputs.tf b/outputs.tf index 5acdf6a..4cc37b5 100644 --- a/outputs.tf +++ b/outputs.tf @@ -11,4 +11,4 @@ output "ip" { output "urn" { description = "The urn for the Load Balancer." value = digitalocean_loadbalancer.main.urn -} \ No newline at end of file +} From f652802f332e2f8f4e72e8d7367700fdd7942660 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:31:27 +0100 Subject: [PATCH 08/19] test values forwarding rules --- examples/example_of_use/main.tf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index cd57769..2b0a308 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -17,11 +17,13 @@ module "digitalocean_loadbalancer" { droplet_ids = [digitalocean_droplet.main.id] - forwarding_rule { - entry_port = 80 - entry_protocol = "http" + forwarding_rule = [ + { + entry_port = 80 + entry_protocol = "http" - target_port = 80 - target_protocol = "http" - } + target_port = 80 + target_protocol = "http" + } + ] } From 1a63a49e8149d4363997c76663d8bd560b26c9b6 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:33:54 +0100 Subject: [PATCH 09/19] module corrected --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 2b0a308..606c602 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -14,7 +14,7 @@ module "digitalocean_loadbalancer" { source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" name = "loadbalancer-1" region = "nyc1" - droplet_ids = [digitalocean_droplet.main.id] + droplet_ids = [module.digitalocean_droplet.main.id] forwarding_rule = [ From 7e1e6ee29f6a3bcefa3c361fa5fe7bb59285a95c Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:36:02 +0100 Subject: [PATCH 10/19] test --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 606c602..2b0a308 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -14,7 +14,7 @@ module "digitalocean_loadbalancer" { source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" name = "loadbalancer-1" region = "nyc1" - droplet_ids = [module.digitalocean_droplet.main.id] + droplet_ids = [digitalocean_droplet.main.id] forwarding_rule = [ From a59ffedcc1c79045132181c19fa454fa3eb7149f Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:39:58 +0100 Subject: [PATCH 11/19] var droplet_ids --- examples/example_of_use/variables.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/example_of_use/variables.tf b/examples/example_of_use/variables.tf index d02e743..6bec71f 100644 --- a/examples/example_of_use/variables.tf +++ b/examples/example_of_use/variables.tf @@ -2,3 +2,9 @@ variable "do_token" { description = "Token to digitalOcean API" type = string } + +variable "droplet_ids" { + description = "A list of the IDs of each droplet to be attached to the Load Balancer." + type = list(string) + default = [] +} From a37e1bc6268bafb6c4ec1f5b28589d797be0d4f4 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:41:34 +0100 Subject: [PATCH 12/19] module added --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 2b0a308..606c602 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -14,7 +14,7 @@ module "digitalocean_loadbalancer" { source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" name = "loadbalancer-1" region = "nyc1" - droplet_ids = [digitalocean_droplet.main.id] + droplet_ids = [module.digitalocean_droplet.main.id] forwarding_rule = [ From a4996113faf8830bc3a11b6a8c29aa7d53396e9a Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 16:46:14 +0100 Subject: [PATCH 13/19] test --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 606c602..1396627 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -14,7 +14,7 @@ module "digitalocean_loadbalancer" { source = "github.com/opsd-io/terraform-module-digitalocean-load-balancer?ref=load_balancer_module" name = "loadbalancer-1" region = "nyc1" - droplet_ids = [module.digitalocean_droplet.main.id] + droplet_ids = [module.digitalocean_droplet.id] forwarding_rule = [ From 1fb7f91b2ca5a6b8f793e7f2f2fd8cebac9667f8 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:00:23 +0100 Subject: [PATCH 14/19] vpc_uuid --- examples/example_of_use/main.tf | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 1396627..474509e 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -2,12 +2,22 @@ provider "digitalocean" { token = var.do_token } +module "terraform_module_digitalocean_vpc" { + source = "github.com/opsd-io/terraform-module-digitalocean" + vpc_name = "your-vpc" + region = "nyc1" + ip_range = "192.168.0.0/24" + description = "VPC added by terraform module" +} + + module "digitalocean_droplet" { - source = "github.com/opsd-io/terraform-module-digitalocean-droplet?ref=MB_droplet_creation" - image = "ubuntu-20-04-x64" - name = "web-1" - region = "nyc1" - size = "s-1vcpu-1gb" + source = "github.com/opsd-io/terraform-module-digitalocean-droplet?ref=MB_droplet_creation" + image = "ubuntu-20-04-x64" + name = "web-1" + region = "nyc1" + size = "s-1vcpu-1gb" + vpc_uuid = [module.terraform_module_digitalocean_vpc.id] } module "digitalocean_loadbalancer" { @@ -15,7 +25,7 @@ module "digitalocean_loadbalancer" { name = "loadbalancer-1" region = "nyc1" droplet_ids = [module.digitalocean_droplet.id] - + vpc_uuid = [module.terraform_module_digitalocean_vpc.id] forwarding_rule = [ { From 868b949671912c87a0c416592b51d262cf7e4092 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:02:38 +0100 Subject: [PATCH 15/19] repo change --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 474509e..072a83c 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -3,7 +3,7 @@ provider "digitalocean" { } module "terraform_module_digitalocean_vpc" { - source = "github.com/opsd-io/terraform-module-digitalocean" + source = "github.com/opsd-io/terraform-module-digitalocean?ref=main" vpc_name = "your-vpc" region = "nyc1" ip_range = "192.168.0.0/24" From e18f1ec8b56e792bee300f948f4664a04dd74782 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:06:08 +0100 Subject: [PATCH 16/19] repo corr --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 072a83c..14f650c 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -3,7 +3,7 @@ provider "digitalocean" { } module "terraform_module_digitalocean_vpc" { - source = "github.com/opsd-io/terraform-module-digitalocean?ref=main" + source = "github.com/opsd-io/terraform-module-digitalocean-vpc" vpc_name = "your-vpc" region = "nyc1" ip_range = "192.168.0.0/24" From 715c92e73627a622edaa31f024add120b0c47874 Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:36:57 +0100 Subject: [PATCH 17/19] changed vpc to test --- examples/example_of_use/main.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index 14f650c..bc8b326 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -3,10 +3,9 @@ provider "digitalocean" { } module "terraform_module_digitalocean_vpc" { - source = "github.com/opsd-io/terraform-module-digitalocean-vpc" + source = "github.com/opsd-io/terraform-module-digitalocean-vpc?ref=MB_vpc" vpc_name = "your-vpc" region = "nyc1" - ip_range = "192.168.0.0/24" description = "VPC added by terraform module" } From 3e2272ca9fc2133d5de1a759ce27be185d4bc57c Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:37:24 +0100 Subject: [PATCH 18/19] moudle name change --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index bc8b326..e4abe64 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -24,7 +24,7 @@ module "digitalocean_loadbalancer" { name = "loadbalancer-1" region = "nyc1" droplet_ids = [module.digitalocean_droplet.id] - vpc_uuid = [module.terraform_module_digitalocean_vpc.id] + vpc_uuid = [module.digitalocean_vpc.id] forwarding_rule = [ { From 5917a96bb9c234cbf18a5897e29383f8dd42d20d Mon Sep 17 00:00:00 2001 From: "michal.browarczyk@zdt.io" Date: Tue, 19 Mar 2024 17:41:25 +0100 Subject: [PATCH 19/19] repo changed --- examples/example_of_use/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_of_use/main.tf b/examples/example_of_use/main.tf index e4abe64..37ff1cf 100644 --- a/examples/example_of_use/main.tf +++ b/examples/example_of_use/main.tf @@ -3,7 +3,7 @@ provider "digitalocean" { } module "terraform_module_digitalocean_vpc" { - source = "github.com/opsd-io/terraform-module-digitalocean-vpc?ref=MB_vpc" + source = "github.com/opsd-io/terraform-module-digitalocean-vpc" vpc_name = "your-vpc" region = "nyc1" description = "VPC added by terraform module"