Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CloudFormation/list_stacks.py to default the stack name search case insensitive #513

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## 2023-11-22

### Changed

* Updated CloudFormation/list_stacks.py to default the stack name search case insensitive.

## 2023-11-11

### Added
Expand Down
4 changes: 2 additions & 2 deletions CloudFormation/list_stacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from boto3.session import Session
import click
from boto3.session import Session


@click.command()
Expand All @@ -12,7 +12,7 @@ def main(profile, name_contains):
paginator = session.client("cloudformation").get_paginator("describe_stacks")
for page in paginator.paginate():
for stack in page["Stacks"]:
if name_contains is None or name_contains in stack["StackName"]:
if name_contains is None or name_contains.lower() in stack["StackName"].lower():
result.append((stack["StackName"], stack["CreationTime"]))

# Sort by creation time in reverse order
Expand Down