Git Product home page Git Product logo

go-to-k / delstack Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 1.0 628 KB

The CLI tool to force delete the entire AWS CloudFormation stack, even if it contains resources that fail to delete by the CloudFormation delete operation.

Home Page: https://dev.to/aws-builders/a-cli-tool-to-force-delete-cloudformation-stacks-3808

License: MIT License

Go 98.89% Makefile 0.50% Shell 0.61%
aws aws-cdk aws-cloudformation aws-sam cli cloudformation go golang serverless-framework

delstack's Introduction

Kenta Goto (k.goto)

AWS CDK Contributor Top Langs

My Dev Tools

Self-made AWS Tools

The CLI tool to CLear S3 Buckets. It empties (so deletes all objects and versions/delete-markers in) S3 Buckets or deletes the buckets themselves.

The CLI tool to force delete the entire AWS CloudFormation stack, even if it contains resources that fail to delete by the CloudFormation delete operation.

The CLI tool to search AWS Lambda runtime and versions across regions.

AWS CDK Construct Libraries

The AWS CDK Construct library to allow you to scan a container image during CDK deployment layer with Trivy.

To my surprise, this library was featured on the ecosystem page of Trivy's official documentation!

The AWS CDK Construct library to allow you to scan a container image during CDK deployment layer with Dockle.

The AWS CDK construct library for a CloudWatch Alarm for Elastic Load Balancing (as Application Load Balancer) that fires on HTTPCode_ELB_5XX_Count excluding 500, 502, 503, and 504 (e.g. 501, 505, 561).

delstack's People

Contributors

dependabot[bot] avatar go-to-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thehoneymad

delstack's Issues

[Feature] IAM Group deletion removing users from groups

Is your feature request related to a problem? Please describe.
Cannot delete entity, must remove users from group first. (Service: AmazonIdentityManagement; Status Code: 409; Error Code: DeleteConflict; Request ID: xxxxxxxxxxxxxxxxxx; Proxy: null)

Describe the solution you'd like
Support AWS::IAM::Group resource type for force deletion. this removes users from the group and delete the group only.

Additional context

[Feature] multiple stacks deletion

Is your feature request related to a problem? Please describe.
It's a pain to launch the tool every time I want to delete multiple stacks.

Describe the solution you'd like
Allow multiple stacks to be selected.

Additional context

Add any other context or screenshots about the feature request here.

[Feature] Check all stacks for TerminationProtection before starting deletion when multiple stacks

Is your feature request related to a problem? Please describe.
When deleting multiple stacks, if the stack executed in the middle has TerminationProtection, it will terminate with an error on that stack after the previous stack is deleted. Better to know it first and not start deleting all the stacks.

Describe the solution you'd like
Check all stacks for TerminationProtection before starting deletion when multiple stacks.

Additional context

Add any other context or screenshots about the feature request here.

[BUG] Pressing a specific key will make the list of stack names disappear in interactive mode.

About the problem

The interactive mode of the delstack command displays a list of stack names. Below is an example:

? Select StackName.
Nested child stacks, XXX_IN_PROGRESS(e.g. ROLLBACK_IN_PROGRESS) status stacks and EnableTerminationProtection stacks are not displayed.
  [Use arrows to move, type to filter]
  stack-a
  stack-b
  stack-c
> stack-d

User select one stack from the above list.
When the user is choosing a stack name, pressing the [Enter] key is expected. However, if the user accidentally presses the [Space] key, the delstack display no stack name. Below is an example:

? Select StackName.
Nested child stacks, XXX_IN_PROGRESS(e.g. ROLLBACK_IN_PROGRESS) status stacks and EnableTerminationProtection stacks are not displayed.
    [Use arrows to move, type to filter]


Current workaround

If the user accidentally presses the [Space] key, pressing the [BackSpace] key will restore the display.

Expected behavior

When a user presses an irrelevant key, the screen should indicate that the user pressed the wrong key or be unresponsive. At the very least, I want the stack name to continue to be displayed on the screen.

Environment information

  • macOS 13.6.3 (arm64)
  • iTerm2 (Build 3.4.22)
  • delstack version v1.4.1

[Feature] Security Group that links to ENI

Is your feature request related to a problem? Please describe.
Need to detach from the Security Group and delete the ENI if Available status.

Describe the solution you'd like

Additional context

[Feature] Do not display nested child stacks

The type of []types.StackSummary for StackSummaries in ListStacksOutput(or the type of []types.Stack for Stacks in DescribeStacksOutput) has RootId and ParentId, so we can use for this feature.

If use DescribeStacks in the issue(#74), use DescribeStacks in this issue.

I think there is probably no situation where a child stack would be selected for deletion.

But is there really no such case? (e.g., when manually deleting the parent stack with the specified child stack as a skip resource).

If there is, do I need to consider it if it is infrequent...?

feat: delete a root stack after delete DELETE_FAILED resources

Now, once you delete a root stack and occurs DELETE_FAILED, this tool delete a root stack without DELETE_FAILED resources at first, then delete the rest resources.
However, if a part of DELETE_FAILED resources occurs errors, other resources are left and this tool exit. But the stack had been deleted, so it may be impossible to find the resources left behind.

[Bugs] rarely causes an DeleteBucket error

Deleting a stack created by a script in testdata "rarely" causes the BucketNotEmpty error for DeleteBucket.

If I retry, sometimes succeed, sometimes fail again.

version: v0.9.0

ERR operation error S3: DeleteBucket, https response error StatusCode: 409, RequestID: JV10XTTNRKPGSZNM, HostID: 9HFEwhU0nHSbNxlWuxD3isgnKdbqi2VGKMHKahGUu+ZsGF21jgAaKnVhU++iQfdRczhushHebiA=, api error BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket.
exit status 1

[Feature] Retry handling for other IAM operations

Throttling errors may occur with APIs such as GetRole that are not currently retried.

It could also be applied to ListAttachedRolePolicies.

ERR operation error IAM: GetRole, exceeded maximum number of attempts, 3, https response error StatusCode: 400, RequestID: 75592ee3-8859-435f-96b3-dc0c40e5153a, api error Throttling: Rate exceeded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.