Repository: go-to-k/delstack
Pull request #130 (2023-03-16 00:05:00)

chore(deps): bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/setup-go/releases">actions/setup-go's releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<p>In scope of release we enable cache by default. The action won’t throw an error if the cache can’t be restored or saved. The action will throw a warning message but it won’t stop a build process. The cache can be disabled by specifying <code>cache: false</code>.</p>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-go@v4
    with:
      go-version: ‘1.19’
  - run: go run hello.go
</code></pre>
<p>Besides, we introduce such changes as</p>
<ul>
<li><a href="https://redirect.github.com/actions/setup-go/pull/305">Allow to use only GOCACHE for cache</a></li>
<li><a href="https://redirect.github.com/actions/setup-go/pull/315">Bump json5 from 2.2.1 to 2.2.3</a></li>
<li><a href="https://redirect.github.com/actions/setup-go/pull/323">Use proper version for primary key in cache</a></li>
<li><a href="https://redirect.github.com/actions/setup-go/pull/351">Always add Go bin to the PATH</a></li>
<li><a href="https://redirect.github.com/actions/setup-go/pull/350">Add step warning if go-version input is empty</a></li>
</ul>
<h2>Add support for stable and oldstable aliases</h2>
<p>In scope of this release we introduce aliases for the <code>go-version</code> input. The <code>stable</code> alias instals the latest stable version of Go. The <code>oldstable</code> alias installs previous latest minor release (the stable is 1.19.x -&gt; the oldstable is 1.18.x).</p>
<h3>Stable</h3>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-go@v3
    with:
      go-version: 'stable'
  - run: go run hello.go
</code></pre>
<h3>OldStable</h3>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-go@v3
    with:
      go-version: 'oldstable'
  - run: go run hello.go
</code></pre>
<h2>Add support for go.work and pass the token input through on GHES</h2>
<p>In scope of this release we added <a href="https://redirect.github.com/actions/setup-go/pull/283">support for go.work file to pass it in go-version-file input</a>.</p>
<pre lang="yaml"><code>steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-go@v3
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/setup-go/commit/4d34df0c2316fe8122ab82dc22947d607c0c91f9"><code>4d34df0</code></a> Update configuration files (<a href="https://redirect.github.com/actions/setup-go/issues/348">#348</a>)</li>
<li><a href="https://github.com/actions/setup-go/commit/fdc0d672a12b8fc05ef4c549c3fd5b0f03ebeb4c"><code>fdc0d67</code></a> Add Go bin if go-version input is empty (<a href="https://redirect.github.com/actions/setup-go/issues/351">#351</a>)</li>
<li><a href="https://github.com/actions/setup-go/commit/ebfdf6ac95bce0e7e743a60aba7adf59b400885b"><code>ebfdf6a</code></a> add warning if go-version is empty (<a href="https://redirect.github.com/actions/setup-go/issues/350">#350</a>)</li>
<li><a href="https://github.com/actions/setup-go/commit/b27d76912e7cb72b7262b5be2ec903b6cfaf358a"><code>b27d769</code></a> fix lockfileVersion (<a href="https://redirect.github.com/actions/setup-go/issues/349">#349</a>)</li>
<li><a href="https://github.com/actions/setup-go/commit/c51a7207680f1bee06f4a751214aab70667f9e25"><code>c51a720</code></a> Enable caching by default with default input (<a href="https://redirect.github.com/actions/setup-go/issues/332">#332</a>)</li>
<li><a href="https://github.com/actions/setup-go/commit/6b848af622919e18822928df24a57044dc6ea9ab"><code>6b848af</code></a> Merge pull request <a href="https://redirect.github.com/actions/setup-go/issues/343">#343</a> from akv-platform/reusable-workflow</li>
<li><a href="https://github.com/actions/setup-go/commit/12741cc20952a981105f1dc8366d69f1d24ed472"><code>12741cc</code></a> Format update-config-files.yml</li>
<li><a href="https://github.com/actions/setup-go/commit/7a77a6aab66a15178e313f5908f5ed9b8500894c"><code>7a77a6a</code></a> Merge branch 'main' into reusable-workflow</li>
<li><a href="https://github.com/actions/setup-go/commit/42a0cc8e1491c14a0e9486c3a895d2124f51af1a"><code>42a0cc8</code></a> Add update-config-files.yml</li>
<li><a href="https://github.com/actions/setup-go/commit/7406d654ad8f517886f6c77135494c2b99355381"><code>7406d65</code></a> Add and configure ESLint and update configuration for Prettier (<a href="https://redirect.github.com/actions/setup-go/issues/341">#341</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/actions/setup-go/compare/v3...v4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-go&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 532773a..2c86501 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,7 +23,7 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v3
       - name: Setup Go
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
           go-version: 1.18
         id: go
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a404555..cd3753a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -12,7 +12,7 @@ jobs:
         with:
           fetch-depth: 0
       - name: Setup Go
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
           go-version: 1.18
       - name: Run GoReleaser
diff --git a/README.md b/README.md
index 120ce4b..c52e628 100644
--- a/README.md
+++ b/README.md
@@ -110,3 +110,5 @@ Then you select stack names in the UI.
 In addition, **child stacks of nested stacks are not displayed**. This is because it is unlikely that there are cases where only child stacks of nested stacks are deleted without deleting the parent stack, and also because it is possible that the parent stack may be buried in the stack list if there are child stacks, or that the child stacks may be accidentally deleted.
 
 However, the `-s` command option allows deletion of child stacks by specifying their names, so please use this option if you want.
+
+Also stacks with **the XXX_IN_PROGRESS(e.g. ROLLBACK_IN_PROGRESS) CloudFormation status** are not displayed, because multiple CloudFormation operations should not be duplicated at the same time.
diff --git a/internal/app/app.go b/internal/app/app.go
index f6afa94..dc6d1d6 100644
--- a/internal/app/app.go
+++ b/internal/app/app.go
@@ -172,7 +172,8 @@ func (a *App) doInteractiveMode() ([]string, string, bool) {
 func (a *App) selectStackName(stackNames []string) string {
 	var stackName string
 
-	label := "Select StackName." + "\n"
+	label := "Select StackName." + "\n" +
+		"Nested child stacks and XXX_IN_PROGRESS(e.g. ROLLBACK_IN_PROGRESS) status stacks are not displayed."
 
 	for {
 		stackName = io.GetSelection(label, stackNames)
diff --git a/internal/operation/cloudformation_stack.go b/internal/operation/cloudformation_stack.go
index 150098f..5aa05a8 100644
--- a/internal/operation/cloudformation_stack.go
+++ b/internal/operation/cloudformation_stack.go
@@ -140,7 +140,24 @@ func (o *CloudFormationStackOperator) deleteStackNormally(ctx context.Context, s
 func (o *CloudFormationStackOperator) ListStacksFilteredByKeyword(ctx context.Context, keyword *string) ([]string, error) {
 	filteredStacks := []string{}
 
-	stackSummaries, err := o.client.ListStacks(ctx)
+	// Except StackStatusDeleteComplete and xxInProgress
+	stackStatusFilter := []types.StackStatus{
+		types.StackStatusCreateFailed,
+		types.StackStatusCreateComplete,
+		types.StackStatusRollbackFailed,
+		types.StackStatusRollbackComplete,
+		types.StackStatusDeleteFailed,
+		types.StackStatusUpdateComplete,
+		types.StackStatusUpdateFailed,
+		types.StackStatusUpdateRollbackFailed,
+		types.StackStatusUpdateRollbackComplete,
+		types.StackStatusImportComplete,
+		types.StackStatusImportRollbackInProgress,
+		types.StackStatusImportRollbackFailed,
+		types.StackStatusImportRollbackComplete,
+	}
+
+	stackSummaries, err := o.client.ListStacks(ctx, stackStatusFilter)
 	if err != nil {
 		return filteredStacks, err
 	}
diff --git a/internal/operation/operator.go b/internal/operation/operator.go
index bf6cf26..281f5fc 100644
--- a/internal/operation/operator.go
+++ b/internal/operation/operator.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./operator.go -destination=./operator_mock.go -package=operation
+//go:generate mockgen -source=$GOFILE -destination=operator_mock.go -package=$GOPACKAGE -write_package_comment=false
 package operation
 
 import (
diff --git a/internal/operation/operator_collection.go b/internal/operation/operator_collection.go
index ccd2954..bc71a0f 100644
--- a/internal/operation/operator_collection.go
+++ b/internal/operation/operator_collection.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./operator_collection.go -destination=./operator_collection_mock.go -package=operation
+//go:generate mockgen -source=$GOFILE -destination=operator_collection_mock.go -package=$GOPACKAGE -write_package_comment=false
 package operation
 
 import (
diff --git a/internal/operation/operator_collection_mock.go b/internal/operation/operator_collection_mock.go
index 1d89ddd..6ca31d8 100644
--- a/internal/operation/operator_collection_mock.go
+++ b/internal/operation/operator_collection_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./operator_collection.go
+// Source: operator_collection.go
 
-// Package operation is a generated GoMock package.
 package operation
 
 import (
diff --git a/internal/operation/operator_manager.go b/internal/operation/operator_manager.go
index 348b817..d24c288 100644
--- a/internal/operation/operator_manager.go
+++ b/internal/operation/operator_manager.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./operator_manager.go -destination=./operator_manager_mock.go -package=operation
+//go:generate mockgen -source=$GOFILE -destination=operator_manager_mock.go -package=$GOPACKAGE -write_package_comment=false
 package operation
 
 import (
diff --git a/internal/operation/operator_manager_mock.go b/internal/operation/operator_manager_mock.go
index 96d9895..76a5e11 100644
--- a/internal/operation/operator_manager_mock.go
+++ b/internal/operation/operator_manager_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./operator_manager.go
+// Source: operator_manager.go
 
-// Package operation is a generated GoMock package.
 package operation
 
 import (
diff --git a/internal/operation/operator_mock.go b/internal/operation/operator_mock.go
index 94c7002..d1f88ce 100644
--- a/internal/operation/operator_mock.go
+++ b/internal/operation/operator_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./operator.go
+// Source: operator.go
 
-// Package operation is a generated GoMock package.
 package operation
 
 import (
diff --git a/pkg/client/backup.go b/pkg/client/backup.go
index 51ca386..74f232d 100644
--- a/pkg/client/backup.go
+++ b/pkg/client/backup.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./backup.go -destination=./backup_mock.go -package=client
+//go:generate mockgen -source=$GOFILE -destination=backup_mock.go -package=$GOPACKAGE -write_package_comment=false
 package client
 
 import (
diff --git a/pkg/client/backup_mock.go b/pkg/client/backup_mock.go
index b2886bc..41ade31 100644
--- a/pkg/client/backup_mock.go
+++ b/pkg/client/backup_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./backup.go
+// Source: backup.go
 
-// Package client is a generated GoMock package.
 package client
 
 import (
diff --git a/pkg/client/cloudformation.go b/pkg/client/cloudformation.go
index 36691f8..cad0c11 100644
--- a/pkg/client/cloudformation.go
+++ b/pkg/client/cloudformation.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./cloudformation.go -destination=./cloudformation_mock.go -package=client
+//go:generate mockgen -source=$GOFILE -destination=cloudformation_mock.go -package=$GOPACKAGE -write_package_comment=false
 package client
 
 import (
@@ -16,7 +16,7 @@ type ICloudFormation interface {
 	DeleteStack(ctx context.Context, stackName *string, retainResources []string) error
 	DescribeStacks(ctx context.Context, stackName *string) ([]types.Stack, error)
 	ListStackResources(ctx context.Context, stackName *string) ([]types.StackResourceSummary, error)
-	ListStacks(ctx context.Context) ([]types.StackSummary, error)
+	ListStacks(ctx context.Context, stackStatusFilter []types.StackStatus) ([]types.StackSummary, error)
 }
 
 var _ ICloudFormation = (*CloudFormation)(nil)
@@ -151,7 +151,7 @@ func (c *CloudFormation) ListStackResources(ctx context.Context, stackName *stri
 	return stackResourceSummaries, nil
 }
 
-func (c *CloudFormation) ListStacks(ctx context.Context) ([]types.StackSummary, error) {
+func (c *CloudFormation) ListStacks(ctx context.Context, stackStatusFilter []types.StackStatus) ([]types.StackSummary, error) {
 	var nextToken *string
 	stackSummaries := []types.StackSummary{}
 
@@ -165,32 +165,8 @@ func (c *CloudFormation) ListStacks(ctx context.Context) ([]types.StackSummary,
 		}
 
 		input := &cloudformation.ListStacksInput{
-			// Except StackStatusDeleteComplete
-			StackStatusFilter: []types.StackStatus{
-				types.StackStatusCreateInProgress,
-				types.StackStatusCreateFailed,
-				types.StackStatusCreateComplete,
-				types.StackStatusRollbackInProgress,
-				types.StackStatusRollbackFailed,
-				types.StackStatusRollbackComplete,
-				types.StackStatusDeleteInProgress,
-				types.StackStatusDeleteFailed,
-				types.StackStatusUpdateInProgress,
-				types.StackStatusUpdateCompleteCleanupInProgress,
-				types.StackStatusUpdateComplete,
-				types.StackStatusUpdateFailed,
-				types.StackStatusUpdateRollbackInProgress,
-				types.StackStatusUpdateRollbackFailed,
-				types.StackStatusUpdateRollbackCompleteCleanupInProgress,
-				types.StackStatusUpdateRollbackComplete,
-				types.StackStatusReviewInProgress,
-				types.StackStatusImportInProgress,
-				types.StackStatusImportComplete,
-				types.StackStatusImportRollbackInProgress,
-				types.StackStatusImportRollbackFailed,
-				types.StackStatusImportRollbackComplete,
-			},
-			NextToken: nextToken,
+			StackStatusFilter: stackStatusFilter,
+			NextToken:         nextToken,
 		}
 
 		output, err := c.client.ListStacks(ctx, input)
diff --git a/pkg/client/cloudformation_mock.go b/pkg/client/cloudformation_mock.go
index 4adbba2..3276285 100644
--- a/pkg/client/cloudformation_mock.go
+++ b/pkg/client/cloudformation_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./cloudformation.go
+// Source: cloudformation.go
 
-// Package client is a generated GoMock package.
 package client
 
 import (
@@ -80,16 +79,16 @@ func (mr *MockICloudFormationMockRecorder) ListStackResources(ctx, stackName int
 }
 
 // ListStacks mocks base method.
-func (m *MockICloudFormation) ListStacks(ctx context.Context) ([]types.StackSummary, error) {
+func (m *MockICloudFormation) ListStacks(ctx context.Context, stackStatusFilter []types.StackStatus) ([]types.StackSummary, error) {
 	m.ctrl.T.Helper()
-	ret := m.ctrl.Call(m, "ListStacks", ctx)
+	ret := m.ctrl.Call(m, "ListStacks", ctx, stackStatusFilter)
 	ret0, _ := ret[0].([]types.StackSummary)
 	ret1, _ := ret[1].(error)
 	return ret0, ret1
 }
 
 // ListStacks indicates an expected call of ListStacks.
-func (mr *MockICloudFormationMockRecorder) ListStacks(ctx interface{}) *gomock.Call {
+func (mr *MockICloudFormationMockRecorder) ListStacks(ctx, stackStatusFilter interface{}) *gomock.Call {
 	mr.mock.ctrl.T.Helper()
-	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStacks", reflect.TypeOf((*MockICloudFormation)(nil).ListStacks), ctx)
+	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListStacks", reflect.TypeOf((*MockICloudFormation)(nil).ListStacks), ctx, stackStatusFilter)
 }
diff --git a/pkg/client/ecr.go b/pkg/client/ecr.go
index 0a453c8..b3cb2dc 100644
--- a/pkg/client/ecr.go
+++ b/pkg/client/ecr.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./ecr.go -destination=./ecr_mock.go -package=client
+//go:generate mockgen -source=$GOFILE -destination=ecr_mock.go -package=$GOPACKAGE -write_package_comment=false
 package client
 
 import (
diff --git a/pkg/client/ecr_mock.go b/pkg/client/ecr_mock.go
index 29310a3..dfbe549 100644
--- a/pkg/client/ecr_mock.go
+++ b/pkg/client/ecr_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./ecr.go
+// Source: ecr.go
 
-// Package client is a generated GoMock package.
 package client
 
 import (
diff --git a/pkg/client/iam.go b/pkg/client/iam.go
index 387069d..19d3b16 100644
--- a/pkg/client/iam.go
+++ b/pkg/client/iam.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./iam.go -destination=./iam_mock.go -package=client
+//go:generate mockgen -source=$GOFILE -destination=iam_mock.go -package=$GOPACKAGE -write_package_comment=false
 package client
 
 import (
diff --git a/pkg/client/iam_mock.go b/pkg/client/iam_mock.go
index c853ab3..d417abe 100644
--- a/pkg/client/iam_mock.go
+++ b/pkg/client/iam_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./iam.go
+// Source: iam.go
 
-// Package client is a generated GoMock package.
 package client
 
 import (
diff --git a/pkg/client/s3.go b/pkg/client/s3.go
index 4e715ed..ee0585e 100644
--- a/pkg/client/s3.go
+++ b/pkg/client/s3.go
@@ -1,4 +1,4 @@
-//go:generate mockgen -source=./s3.go -destination=./s3_mock.go -package=client
+//go:generate mockgen -source=$GOFILE -destination=s3_mock.go -package=$GOPACKAGE -write_package_comment=false
 package client
 
 import (
diff --git a/pkg/client/s3_mock.go b/pkg/client/s3_mock.go
index 7aeb5c0..823cf18 100644
--- a/pkg/client/s3_mock.go
+++ b/pkg/client/s3_mock.go
@@ -1,7 +1,6 @@
 // Code generated by MockGen. DO NOT EDIT.
-// Source: ./s3.go
+// Source: s3.go
 
-// Package client is a generated GoMock package.
 package client
 
 import (


Test patch:
diff --git a/internal/operation/cloudformation_stack_test.go b/internal/operation/cloudformation_stack_test.go
index 6b07659..849ba6f 100644
--- a/internal/operation/cloudformation_stack_test.go
+++ b/internal/operation/cloudformation_stack_test.go
@@ -1433,6 +1433,23 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 		err            error
 	}
 
+	// Except StackStatusDeleteComplete and xxInProgress
+	stackStatusFilter := []types.StackStatus{
+		types.StackStatusCreateFailed,
+		types.StackStatusCreateComplete,
+		types.StackStatusRollbackFailed,
+		types.StackStatusRollbackComplete,
+		types.StackStatusDeleteFailed,
+		types.StackStatusUpdateComplete,
+		types.StackStatusUpdateFailed,
+		types.StackStatusUpdateRollbackFailed,
+		types.StackStatusUpdateRollbackComplete,
+		types.StackStatusImportComplete,
+		types.StackStatusImportRollbackInProgress,
+		types.StackStatusImportRollbackFailed,
+		types.StackStatusImportRollbackComplete,
+	}
+
 	cases := []struct {
 		name                        string
 		args                        args
@@ -1447,7 +1464,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TestStack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1477,7 +1494,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TestStack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1507,7 +1524,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TestStack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1536,7 +1553,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "teststack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1566,7 +1583,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TESTSTACK",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1596,7 +1613,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return(
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return(
 					[]types.StackSummary{
 						{
 							StackName:   aws.String("TestStack1"),
@@ -1626,7 +1643,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TestStack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return([]types.StackSummary{}, nil)
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return([]types.StackSummary{}, nil)
 			},
 			want: want{
 				filteredStacks: []string{},
@@ -1641,7 +1658,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return([]types.StackSummary{}, nil)
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return([]types.StackSummary{}, nil)
 			},
 			want: want{
 				filteredStacks: []string{},
@@ -1656,7 +1673,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "TestStack",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return([]types.StackSummary{}, fmt.Errorf("ListStacksError"))
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return([]types.StackSummary{}, fmt.Errorf("ListStacksError"))
 			},
 			want: want{
 				filteredStacks: []string{},
@@ -1671,7 +1688,7 @@ func TestCloudFormationStackOperator_ListStacksFilteredByKeyword(t *testing.T) {
 				keyword: "",
 			},
 			prepareMockCloudFormationFn: func(m *client.MockICloudFormation) {
-				m.EXPECT().ListStacks(gomock.Any()).Return([]types.StackSummary{}, fmt.Errorf("ListStacksError"))
+				m.EXPECT().ListStacks(gomock.Any(), stackStatusFilter).Return([]types.StackSummary{}, fmt.Errorf("ListStacksError"))
 			},
 			want: want{
 				filteredStacks: []string{},
diff --git a/pkg/client/cloudformation_test.go b/pkg/client/cloudformation_test.go
index 658b341..0ca9053 100644
--- a/pkg/client/cloudformation_test.go
+++ b/pkg/client/cloudformation_test.go
@@ -1297,7 +1297,24 @@ func TestCloudFormation_ListStacks(t *testing.T) {
 				cfnWaiter,
 			)
 
-			output, err := cfnClient.ListStacks(tt.args.ctx)
+			// Except StackStatusDeleteComplete and xxInProgress
+			stackStatusFilter := []types.StackStatus{
+				types.StackStatusCreateFailed,
+				types.StackStatusCreateComplete,
+				types.StackStatusRollbackFailed,
+				types.StackStatusRollbackComplete,
+				types.StackStatusDeleteFailed,
+				types.StackStatusUpdateComplete,
+				types.StackStatusUpdateFailed,
+				types.StackStatusUpdateRollbackFailed,
+				types.StackStatusUpdateRollbackComplete,
+				types.StackStatusImportComplete,
+				types.StackStatusImportRollbackInProgress,
+				types.StackStatusImportRollbackFailed,
+				types.StackStatusImportRollbackComplete,
+			}
+
+			output, err := cfnClient.ListStacks(tt.args.ctx, stackStatusFilter)
 			if (err != nil) != tt.wantErr {
 				t.Errorf("error = %#v, wantErr %#v", err, tt.wantErr)
 				return