Skip to content

Commit

Permalink
fix: det deploy aws list results were incomplete. (#8062)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioga authored Oct 4, 2023
1 parent c8edfab commit ca763a4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions harness/determined/deploy/aws/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,18 @@ def create_stack(

def list_stacks(boto3_session: boto3.session.Session) -> List[Dict[str, Any]]:
cfn = boto3_session.client("cloudformation")
response = cfn.describe_stacks()
paginator = cfn.get_paginator("describe_stacks")

output = []
for stack in response["Stacks"]:
for tag in stack["Tags"]:
if (
tag["Key"] == constants.defaults.STACK_TAG_KEY
and tag["Value"] == constants.defaults.STACK_TAG_VALUE
):
output.append(stack)
for response in paginator.paginate():
for stack in response["Stacks"]:
for tag in stack["Tags"]:
if (
tag["Key"] == constants.defaults.STACK_TAG_KEY
and tag["Value"] == constants.defaults.STACK_TAG_VALUE
) or (tag["Key"] == constants.deployment_types.TYPE_TAG_KEY):
output.append(stack)
break
return output


Expand Down

0 comments on commit ca763a4

Please sign in to comment.