forked from clouddrove/terraform-digitalocean-firewall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tflint issue and default variable remove from example.tf
- Loading branch information
1 parent
f59d418
commit 131ccc8
Showing
5 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output "name" { | ||
value = module.firewall[0].name | ||
value = module.firewall[*].name | ||
description = "The name of the Firewall." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
provider "digitalocean" { | ||
# token = "" | ||
provider "digitalocean" {} | ||
|
||
locals { | ||
name = "app" | ||
environment = "test" | ||
region = "blr1" | ||
} | ||
|
||
##------------------------------------------------ | ||
## VPC module call | ||
##------------------------------------------------ | ||
module "vpc" { | ||
source = "git::https://github.com/terraform-do-modules/terraform-digitalocean-vpc.git?ref=internal-423" | ||
name = "app" | ||
environment = "test" | ||
region = "blr1" | ||
name = local.name | ||
environment = local.environment | ||
region = local.region | ||
ip_range = "10.10.0.0/16" | ||
} | ||
|
||
##------------------------------------------------ | ||
## Droplet module call | ||
##------------------------------------------------ | ||
module "droplet" { | ||
source = "git::https://github.com/terraform-do-modules/terraform-digitalocean-droplet.git?ref=internal-425" | ||
name = "app" | ||
environment = "test" | ||
droplet_count = 1 | ||
region = "blr1" | ||
vpc_uuid = module.vpc.id | ||
droplet_size = "s-1vcpu-1gb" | ||
image_name = "ubuntu-18-04-x64" | ||
ssh_key = "ssh-rsaEl36y5Z2dDUyrcT6FdayhRGtJPfUJc22tgu= test" | ||
monitoring = false | ||
ipv6 = false | ||
floating_ip = true | ||
block_storage_size = 5 | ||
user_data = file("user-data.sh") | ||
|
||
source = "git::https://github.com/terraform-do-modules/terraform-digitalocean-droplet.git?ref=internal-425" | ||
name = local.name | ||
environment = local.environment | ||
region = local.region | ||
vpc_uuid = module.vpc.id | ||
ssh_key = "ssh-rsaEl36y5Z2dDUyrcT6FdayhRGtJPfUJfc22tgu= test" | ||
user_data = file("user-data.sh") | ||
####firewall | ||
allowed_ip = ["10.10.0.0/16"] | ||
allowed_ports = [22, 80] | ||
inbound_rules = [ | ||
{ | ||
allowed_ip = ["10.10.0.0/16"] | ||
allowed_ports = "22" | ||
}, | ||
] | ||
} | ||
|
||
##------------------------------------------------ | ||
## Firewall module call | ||
##------------------------------------------------ | ||
module "firewall" { | ||
source = "./../../" | ||
name = "app" | ||
environment = "test" | ||
name = local.name | ||
environment = local.environment | ||
allowed_ip = ["0.0.0.0/0"] | ||
allowed_ports = [22, 80] | ||
allowed_ports = [80, 443] | ||
droplet_ids = module.droplet.id | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
output "name" { | ||
value = module.firewall[0].name | ||
value = module.firewall[*].name | ||
description = "The name of the Firewall." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#Module : Firewall | ||
#Description : Provides a DigitalOcean Cloud Firewall resource. This can be used to create, modify, and delete Firewalls. | ||
output "id" { | ||
value = join("", digitalocean_firewall.default[*].id) | ||
value = digitalocean_firewall.default[*].id | ||
description = "A unique ID that can be used to identify and reference a Firewall." | ||
} | ||
|
||
output "name" { | ||
value = join("", digitalocean_firewall.default[*].name) | ||
value = digitalocean_firewall.default[*].name | ||
description = "The name of the Firewall." | ||
} | ||
|
||
output "droplet_ids" { | ||
value = join("", digitalocean_firewall.default[*].droplet_ids) | ||
value = digitalocean_firewall.default[*].droplet_ids | ||
description = "The list of the IDs of the Droplets assigned to the Firewall." | ||
} | ||
|
||
output "inbound_rule" { | ||
value = join("", digitalocean_firewall.default[*].inbound_rule) | ||
value = digitalocean_firewall.default[*].inbound_rule | ||
description = "The inbound access rule block for the Firewall." | ||
} | ||
|
||
output "outbound_rule" { | ||
value = join("", digitalocean_firewall.default[*].outbound_rule) | ||
value = digitalocean_firewall.default[*].outbound_rule | ||
description = "The name of the Firewall." | ||
} |