old_contents: import boto3
  
  iam = boto3.client('iam')
  ssm = boto3.client('ssm')
  for user in iam.list_users()['Users']:
      username = user['UserName']
      if username.startswith('test-'):
          for key in iam.list_access_keys(UserName=username)['AccessKeyMetadata']:
              print 'deleting {} access key {} from {}'.format(key['Status'], key['AccessKeyId'], username)
              iam.delete_access_key(UserName=username, AccessKeyId=key['AccessKeyId'])
          print 'deleting user {}'.format(username)
          iam.delete_user(UserName=username)
  
  for parameter in ssm.describe_parameters()['Parameters']:
      name = parameter['Name']
      if name.startswith('test-') or name.startswith('/test-'):
          print 'deleting parameter {}'.format(name)
          ssm.delete_parameter(Name=name)
  
new_contents: import boto3
  
  iam = boto3.client('iam')
  ssm = boto3.client('ssm')
  for user in iam.list_users()['Users']:
      username = user['UserName']
      if username.startswith('test-'):
          for key in iam.list_access_keys(UserName=username)['AccessKeyMetadata']:
              print 'deleting {} access key {} from {}'.format(key['Status'], key['AccessKeyId'], username)
              iam.delete_access_key(UserName=username, AccessKeyId=key['AccessKeyId'])
          print 'deleting user {}'.format(username)
          iam.delete_user(UserName=username)
  
  for parameter in ssm.describe_parameters(MaxResults=50)['Parameters']:
      name = parameter['Name']
      if name.startswith('test-') or name.startswith('/test-'):
          print 'deleting parameter {}'.format(name)
          ssm.delete_parameter(Name=name)
  
subject: clean up more than 5 parameters per run :-)