From 63863c422ab0156b94386ddd8b1539457a51bd89 Mon Sep 17 00:00:00 2001 From: Kay Hau Date: Wed, 22 Nov 2023 14:27:46 +1100 Subject: [PATCH] Updated CloudFormation/list_stacks.py to default the stack name search case insensitive --- CHANGELOG.md | 6 ++++++ CloudFormation/list_stacks.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3727d4db..9a1d5964 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CloudFormation/list_stacks.py b/CloudFormation/list_stacks.py index 73eff8a4..6b747284 100644 --- a/CloudFormation/list_stacks.py +++ b/CloudFormation/list_stacks.py @@ -1,5 +1,5 @@ -from boto3.session import Session import click +from boto3.session import Session @click.command() @@ -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