Skip to content

Commit

Permalink
chore(scripts): Add Pagination to AppConfig Deletion Script (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jshlbrd committed May 17, 2024
1 parent 317cc73 commit 44b16c1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions build/scripts/aws/appconfig/appconfig_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@ def main():
return

profile_map = {}
profiles = client.list_configuration_profiles(ApplicationId=application_id)
for p in profiles.get("Items"):
profile_map[p.get("Name")] = p.get("Id")

next_token = None
while 1:
kwargs = {"ApplicationId": application_id}
if next_token:
kwargs["NextToken"] = next_token

profiles = client.list_configuration_profiles(**kwargs)
for p in profiles.get("Items"):
profile_map[p.get("Name")] = p.get("Id")

next_token = profiles.get("NextToken")
if not next_token:
break

profile_id = profile_map.get(profile_name)
if not profile_id:
Expand Down

0 comments on commit 44b16c1

Please sign in to comment.