@@ -14,35 +14,24 @@ const commandName = `cleanup`;
1414
1515const region = process . env [ `AWS_REGION` ] || process . env [ `AWS_DEFAULT_REGION` ] ;
1616
17- export const cleanupCommand : CommandModule <
18- { } ,
19- { readonly yes : boolean ; readonly hostedZoneName ?: string }
20- > = {
17+ export const cleanupCommand : CommandModule < { } , { readonly yes : boolean } > = {
2118 command : `${ commandName } [options]` ,
2219 describe : `Deletes unused resources created by aws-simple for same region using new default region tag.
2320 If resource does not contain this tag, it will be deleted even if other regions are using it.` ,
2421
2522 builder : ( argv ) =>
2623 argv
27- . options ( `hosted-zone-name` , {
28- describe : `An optional hosted zone name to filter stacks` ,
29- string : true ,
30- } )
3124 . options ( `yes` , {
3225 describe : `Confirm the deletion of unused resources for region: ${ region } ` ,
3326 boolean : true ,
3427 default : false ,
3528 } )
36- . example ( [
37- [ `npx $0 ${ commandName } ` ] ,
38- [ `npx $0 ${ commandName } --hosted-zone-name example.com` ] ,
39- [ `npx $0 ${ commandName } --yes` ] ,
40- ] ) ,
29+ . example ( [ [ `npx $0 ${ commandName } ` ] , [ `npx $0 ${ commandName } --yes` ] ] ) ,
4130
4231 handler : async ( args ) : Promise < void > => {
4332 print . info ( `Searching unused resources for region ${ region } ...` ) ;
4433
45- const stacks = await findStacks ( args . hostedZoneName ) ;
34+ const stacks = await findStacks ( ) ;
4635 const allResourceIds = new Set < string > ( ) ;
4736
4837 for ( const stack of stacks ) {
0 commit comments