Skip to content

Commit

Permalink
Cleanup deployment fix for paginated list stacks (#1111)
Browse files Browse the repository at this point in the history
Bug fix for cleanup deployment to properly handle CFN list stacks giving paginated response

Signed-off-by: Tanner Lewis <lewijacn@amazon.com>
  • Loading branch information
lewijacn authored Oct 30, 2024
1 parent e526ae0 commit 746f24b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/cleanupDeployment/cleanup_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def delete_stacks_for_environment(stage_name: str):
next_stack_names = [stack['StackName'] for stack in next_list_stacks_response['StackSummaries']
if stack['StackStatus'] not in CFN_INITIAL_STATUS_SKIP]
stack_names.extend(next_stack_names)
list_stacks_response.get("NextToken", None)
next_token = next_list_stacks_response.get("NextToken", None)

stage_stack_names = []
for name in stack_names:
Expand All @@ -151,6 +151,7 @@ def delete_stacks_for_environment(stage_name: str):


def main():
logging.info("Starting cleanup deployment process")
parser = argparse.ArgumentParser(description="Cleanup an opensearch-migrations deployment environment.")
parser.add_argument("--stage", type=str, help="The deployment stage environment to delete")
args = parser.parse_args()
Expand Down

0 comments on commit 746f24b

Please sign in to comment.