Skip to content

Commit

Permalink
coun
Browse files Browse the repository at this point in the history
  • Loading branch information
leiicamundi committed Jan 17, 2025
1 parent c9472ee commit e4e00da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

# Count the number of VPCs matching a query name

# Check if a region argument is provided
if [ -z "$1" ]; then
echo "Error: No region specified."
Expand Down Expand Up @@ -29,4 +31,4 @@ fi
vpc_count=$(echo "$vpcs" | jq length)

# Return the VPC data in a format Terraform's external data source expects
echo "{\"vpc_count\": \"$vpc_count\", \"vpcs\": $vpcs}"
echo "{\"vpc_count\": \"$vpc_count\"}"
2 changes: 1 addition & 1 deletion modules/eks-cluster/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data "external" "elastic_ips_count" {

# Data source to check if the VPC exists
data "external" "vpc_data" {
program = ["bash", "./get_vpc_data.sh", var.region, local.vpc_name]
program = ["bash", "./get_vpc_count.sh", var.region, local.vpc_name]
}


Expand Down

0 comments on commit e4e00da

Please sign in to comment.