Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/shared/clients/cloudFormationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface CloudFormationClient {

deleteStack(name: string): Promise<void>

listStacks(statusFilter?: string[]): AsyncIterableIterator<CloudFormation.StackSummary>
listStacks(): AsyncIterableIterator<CloudFormation.StackSummary>

describeStackResources(name: string): Promise<CloudFormation.DescribeStackResourcesOutput>
}
29 changes: 25 additions & 4 deletions src/shared/clients/defaultCloudFormationClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,34 @@ export class DefaultCloudFormationClient implements CloudFormationClient {
.promise()
}

public async *listStacks(
statusFilter: string[] = ['CREATE_COMPLETE', 'UPDATE_COMPLETE']
): AsyncIterableIterator<CloudFormation.StackSummary> {
public async *listStacks(): AsyncIterableIterator<CloudFormation.StackSummary> {
const client = await this.createSdkClient()

const request: CloudFormation.ListStacksInput = {
StackStatusFilter: statusFilter,
// Every StackStatus except for DELETE_COMPLETE
StackStatusFilter: [
'CREATE_IN_PROGRESS',
'CREATE_FAILED',
'CREATE_COMPLETE',
'ROLLBACK_IN_PROGRESS',
'ROLLBACK_FAILED',
'ROLLBACK_COMPLETE',
'DELETE_IN_PROGRESS',
'DELETE_FAILED',
'UPDATE_IN_PROGRESS',
'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS',
'UPDATE_COMPLETE',
'UPDATE_ROLLBACK_IN_PROGRESS',
'UPDATE_ROLLBACK_FAILED',
'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS',
'UPDATE_ROLLBACK_COMPLETE',
'REVIEW_IN_PROGRESS',
'IMPORT_IN_PROGRESS',
'IMPORT_COMPLETE',
'IMPORT_ROLLBACK_IN_PROGRESS',
'IMPORT_ROLLBACK_FAILED',
'IMPORT_ROLLBACK_COMPLETE',
],
}

do {
Expand Down
4 changes: 2 additions & 2 deletions src/test/shared/clients/mockClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ export class MockCloudFormationClient implements CloudFormationClient {

public readonly deleteStack: (name: string) => Promise<void> = async (name: string) => {},

public readonly listStacks: (statusFilter?: string[]) => AsyncIterableIterator<CloudFormation.StackSummary> = (
public readonly listStacks: (
statusFilter?: string[]
) => asyncGenerator([]),
) => AsyncIterableIterator<CloudFormation.StackSummary> = () => asyncGenerator([]),

public readonly describeStackResources: (
name: string
Expand Down