Skip to content

Commit d3d38ca

Browse files
committed
Fix RDB instance count issue
1 parent 75e930f commit d3d38ca

File tree

3 files changed

+647
-3
lines changed

3 files changed

+647
-3
lines changed

src/tirith/providers/terraform_plan/handler.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,13 @@ def provide(provider_inputs, input_data):
147147
resource_type = provider_inputs["terraform_resource_type"]
148148
for resource_change in resource_changes:
149149
if resource_type in (resource_change["type"], "*"):
150-
# No need to check if the resource is not found
151-
# because the count of a resource can be zero
152150
resource_meta = resource_change
153-
count += 1
151+
152+
# Check if the resource has an "index" key
153+
if "index" in resource_change:
154+
count += 1 # Add 1 for each indexed instance
155+
else:
156+
count += 1 # Standard single instance counting
154157

155158
outputs.append(
156159
{

0 commit comments

Comments
 (0)