Skip to content
9 changes: 6 additions & 3 deletions src/lambda_codebase/moved_to_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ def worker_thread(sts, region, account_id, role, event):
'remove_base')

parameter_store = ParameterStore(region, role)
parameters = [param['Name'] for param in parameter_store.client.describe_parameters()['Parameters'] if 'Used by The AWS Deployment Framework' in param['Description']]
for parameter in parameters:
parameter_store.delete_parameter(parameter)
paginator = parameter_store.client.get_paginator('describe_parameters')
page_iterator = paginator.paginate()
for page in page_iterator:
for parameter in page['Parameters']:
if 'Used by The AWS Deployment Framework' in parameter.get('Description', ''):
parameter_store.delete_parameter(parameter.get('Name'))

cloudformation = CloudFormation(
region=region,
Expand Down