Skip to content

Commit

Permalink
fix: update count condition
Browse files Browse the repository at this point in the history
  • Loading branch information
themaheshyadav committed Jul 11, 2023
1 parent 1b7da15 commit 17f2149
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
9 changes: 4 additions & 5 deletions _examples/database_firewall/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ locals {
## database Firewall module call
##------------------------------------------------
module "firewall" {
source = "./../../"
name = local.name
environment = local.environment
database_firewall_enabled = true
database_cluster_id = "" ## add database cluster id
source = "./../../"
name = local.name
environment = local.environment
database_cluster_id = "" ## add database cluster id
rules = [
{
type = "ip_addr"
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource "digitalocean_firewall" "default" {
#Description : Provides a DigitalOcean database firewall resource allowing you to restrict connections to your database to trusted sources.
##------------------------------------------------------------------------------------------------------------------------------------------
resource "digitalocean_database_firewall" "default" {
count = var.enabled == true && var.database_firewall_enabled && var.database_cluster_id != null ? 1 : 0
count = var.enabled == true && var.database_cluster_id != null ? 1 : 0

cluster_id = var.database_cluster_id

Expand Down
5 changes: 0 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ variable "enabled" {
description = "Flag to control the firewall creation."
}

variable "database_firewall_enabled" {
type = bool
default = false
description = "Flag to control the firewall creation."
}

variable "allowed_ip" {
type = list(any)
Expand Down

0 comments on commit 17f2149

Please sign in to comment.