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 7acbf26 commit 1b7da15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
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_cluster_id != null ? 1 : 0
count = var.enabled == true && var.database_firewall_enabled && var.database_cluster_id != null ? 1 : 0

cluster_id = var.database_cluster_id

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ 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)
default = []
Expand Down

0 comments on commit 1b7da15

Please sign in to comment.