{"id":44375036,"url":"https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action","last_synced_at":"2026-02-11T20:42:14.706Z","repository":{"id":306316555,"uuid":"1021465007","full_name":"subhamay-bhattacharyya-gha/cfn-delete-stack-action","owner":"subhamay-bhattacharyya-gha","description":"🎯 ⭐️ GitHub Composite Action - CloudFormation Delete Stack","archived":false,"fork":false,"pushed_at":"2025-07-24T19:47:23.000Z","size":129,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T00:57:36.500Z","etag":null,"topics":["chatgpt","cloudformation","devspace-hackathon","github-action","github-codespace","github-copilot","kiro-dev","openai","semantic-release-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/subhamay-bhattacharyya-gha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-17T12:42:17.000Z","updated_at":"2025-07-23T21:43:13.000Z","dependencies_parsed_at":"2025-07-25T00:57:42.466Z","dependency_job_id":"4d861ac4-2599-4369-88cb-2bc4f4224952","html_url":"https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action","commit_stats":null,"previous_names":["subhamay-bhattacharyya-gha/cfn-delete-stack-action"],"tags_count":1,"template":false,"template_full_name":"subhamay-bhattacharyya-gha/github-action-template","purl":"pkg:github/subhamay-bhattacharyya-gha/cfn-delete-stack-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhamay-bhattacharyya-gha%2Fcfn-delete-stack-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhamay-bhattacharyya-gha%2Fcfn-delete-stack-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhamay-bhattacharyya-gha%2Fcfn-delete-stack-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhamay-bhattacharyya-gha%2Fcfn-delete-stack-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/subhamay-bhattacharyya-gha","download_url":"https://codeload.github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/subhamay-bhattacharyya-gha%2Fcfn-delete-stack-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29344417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T20:11:40.865Z","status":"ssl_error","status_checked_at":"2026-02-11T20:10:41.637Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","cloudformation","devspace-hackathon","github-action","github-codespace","github-copilot","kiro-dev","openai","semantic-release-plugin"],"created_at":"2026-02-11T20:42:13.720Z","updated_at":"2026-02-11T20:42:14.701Z","avatar_url":"https://github.com/subhamay-bhattacharyya-gha.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloudFormation Stack Delete Action\n\n![Built with Kiro](https://img.shields.io/badge/Built%20with-Kiro-blue?style=flat\u0026logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCA5TDEzLjA5IDE1Ljc0TDEyIDIyTDEwLjkxIDE1Ljc0TDQgOUwxMC45MSA4LjI2TDEyIDJaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K)\u0026nbsp;![GitHub Action](https://img.shields.io/badge/GitHub-Action-blue?logo=github)\u0026nbsp;![Release](https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/actions/workflows/release.yaml/badge.svg)\u0026nbsp;![Commit Activity](https://img.shields.io/github/commit-activity/t/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Bash](https://img.shields.io/badge/Language-Bash-green?logo=gnubash)\u0026nbsp;![CloudFormation](https://img.shields.io/badge/AWS-CloudFormation-orange?logo=amazonaws)\u0026nbsp;![Last Commit](https://img.shields.io/github/last-commit/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Release Date](https://img.shields.io/github/release-date/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Repo Size](https://img.shields.io/github/repo-size/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![File Count](https://img.shields.io/github/directory-file-count/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Issues](https://img.shields.io/github/issues/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Top Language](https://img.shields.io/github/languages/top/subhamay-bhattacharyya-gha/cfn-delete-stack-action)\u0026nbsp;![Custom Endpoint](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/bsubhamay/9f5f5ffe16a8d90513e2db8b247e9905/raw/cfn-delete-stack-action.json?)\n\n\nA GitHub Action for deleting AWS CloudFormation stacks with real-time logging and comprehensive error handling.\n\n## Overview\n\nThis GitHub Action provides a reusable composite workflow that deletes AWS CloudFormation stacks while displaying real-time progress logs in the console. It handles various stack states gracefully and provides detailed feedback throughout the deletion process.\n\n## Features\n\n- ✅ **Real-time Logging**: Monitor CloudFormation events as they happen\n- ✅ **Comprehensive Error Handling**: Graceful handling of various stack states and AWS errors\n- ✅ **Flexible Configuration**: Support for different AWS regions and completion modes\n- ✅ **Smart State Management**: Handles existing deletions, non-existent stacks, and edge cases\n- ✅ **Detailed Outputs**: Provides stack status, deletion time, and operation summaries\n- ✅ **Robust Authentication**: Uses standard AWS credential resolution methods\n\n---\n\n## Inputs\n\n| Name | Description | Required | Default | Example |\n|------|-------------|----------|---------|---------|\n| `stack-name` | Name of the CloudFormation stack to delete | Yes | — | `my-application-stack` |\n| `aws-region` | AWS region where the stack is located | No | `us-east-1` | `us-west-2` |\n| `wait-for-completion` | Whether to wait for deletion to complete | No | `true` | `false` |\n\n## Outputs\n\n| Name | Description | Example |\n|------|-------------|---------|\n| `stack-status` | Final status of the stack deletion operation | `DELETE_COMPLETE` |\n| `deletion-time` | Time taken for the deletion process | `5m 32s` |\n| `operation-result` | Result of the deletion operation | `success` |\n| `summary` | Human-readable summary of the deletion process | `Stack 'my-app' deleted successfully in 5m 32s` |\n\n---\n\n## Usage Examples\n\n### Basic Usage\n\n```yaml\nname: Delete CloudFormation Stack\n\non:\n  workflow_dispatch:\n    inputs:\n      stack-name:\n        description: 'Stack name to delete'\n        required: true\n\njobs:\n  delete-stack:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: us-east-1\n\n      - name: Delete CloudFormation Stack\n        uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n        with:\n          stack-name: ${{ github.event.inputs.stack-name }}\n```\n\n### Advanced Usage with Multiple Regions\n\n```yaml\nname: Multi-Region Stack Cleanup\n\non:\n  schedule:\n    - cron: '0 2 * * 0'  # Weekly cleanup\n\njobs:\n  cleanup-stacks:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        region: [us-east-1, us-west-2, eu-west-1]\n        stack: [dev-app-stack, staging-app-stack]\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          aws-region: ${{ matrix.region }}\n\n      - name: Delete Stack\n        uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n        with:\n          stack-name: ${{ matrix.stack }}\n          aws-region: ${{ matrix.region }}\n          wait-for-completion: 'true'\n```\n\n### Conditional Deletion with Error Handling\n\n```yaml\nname: Conditional Stack Deletion\n\non:\n  pull_request:\n    types: [closed]\n\njobs:\n  cleanup-pr-stack:\n    runs-on: ubuntu-latest\n    if: github.event.pull_request.merged == true\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          role-to-assume: ${{ secrets.AWS_ROLE_ARN }}\n          aws-region: us-east-1\n\n      - name: Delete PR Stack\n        id: delete-stack\n        uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n        with:\n          stack-name: pr-${{ github.event.pull_request.number }}-stack\n          aws-region: us-east-1\n        continue-on-error: true\n\n      - name: Handle Deletion Result\n        run: |\n          echo \"Stack Status: ${{ steps.delete-stack.outputs.stack-status }}\"\n          echo \"Deletion Time: ${{ steps.delete-stack.outputs.deletion-time }}\"\n          echo \"Operation Result: ${{ steps.delete-stack.outputs.operation-result }}\"\n          echo \"Summary: ${{ steps.delete-stack.outputs.summary }}\"\n          \n          if [ \"${{ steps.delete-stack.outputs.operation-result }}\" != \"success\" ]; then\n            echo \"Stack deletion failed or was skipped\"\n          fi\n```\n\n### Integration with Deployment Pipeline\n\n```yaml\nname: Deploy and Cleanup Pipeline\n\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    outputs:\n      stack-name: ${{ steps.deploy.outputs.stack-name }}\n    steps:\n      - name: Deploy Stack\n        id: deploy\n        run: |\n          # Your deployment logic here\n          echo \"stack-name=my-app-$(date +%s)\" \u003e\u003e $GITHUB_OUTPUT\n\n  cleanup-old-stacks:\n    needs: deploy\n    runs-on: ubuntu-latest\n    if: success()\n    steps:\n      - name: Configure AWS Credentials\n        uses: aws-actions/configure-aws-credentials@v4\n        with:\n          role-to-assume: ${{ secrets.AWS_ROLE_ARN }}\n          aws-region: us-east-1\n\n      - name: Delete Old Stacks\n        uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n        with:\n          stack-name: old-stack-name\n          aws-region: us-east-1\n        continue-on-error: true\n```\n\n---\n\n## Prerequisites\n\n### AWS Credentials\n\nThis action requires AWS credentials to be configured. You can use any of the following methods:\n\n1. **AWS Actions (Recommended)**:\n   ```yaml\n   - uses: aws-actions/configure-aws-credentials@v4\n     with:\n       aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n       aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n       aws-region: us-east-1\n   ```\n\n2. **IAM Roles (Most Secure)**:\n   ```yaml\n   - uses: aws-actions/configure-aws-credentials@v4\n     with:\n       role-to-assume: ${{ secrets.AWS_ROLE_ARN }}\n       aws-region: us-east-1\n   ```\n\n3. **Environment Variables**:\n   ```yaml\n   env:\n     AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}\n     AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n     AWS_DEFAULT_REGION: us-east-1\n   ```\n\n### Required Permissions\n\nThe AWS credentials must have the following CloudFormation permissions:\n\n```json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"cloudformation:DeleteStack\",\n        \"cloudformation:DescribeStacks\",\n        \"cloudformation:DescribeStackEvents\",\n        \"cloudformation:DescribeStackResources\"\n      ],\n      \"Resource\": \"*\"\n    }\n  ]\n}\n```\n\n---\n\n## Troubleshooting\n\n### Common Issues and Solutions\n\n#### 1. Stack Not Found\n\n**Error**: `Stack with id [stack-name] does not exist`\n\n**Solution**: This is expected behavior when the stack has already been deleted or never existed. The action will exit successfully with a warning message.\n\n```yaml\n- name: Delete Stack (Allow Missing)\n  uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n  with:\n    stack-name: potentially-missing-stack\n  continue-on-error: true\n```\n\n#### 2. Insufficient Permissions\n\n**Error**: `User: arn:aws:iam::123456789012:user/github-actions is not authorized to perform: cloudformation:DeleteStack`\n\n**Solution**: Ensure your AWS credentials have the required CloudFormation permissions listed above.\n\n#### 3. Stack in DELETE_IN_PROGRESS State\n\n**Behavior**: The action will monitor the existing deletion process instead of initiating a new one.\n\n**Log Output**:\n```\nStack is already being deleted. Monitoring existing deletion process...\n```\n\n#### 4. Stack Has Dependent Resources\n\n**Error**: Stack deletion fails due to dependent resources\n\n**Solution**: The action will display the specific CloudFormation error. You may need to:\n- Delete dependent stacks first\n- Remove dependencies manually\n- Use CloudFormation's force delete options (if available)\n\n#### 5. AWS API Throttling\n\n**Behavior**: The action implements exponential backoff for API throttling\n\n**Log Output**:\n```\nAWS API throttling detected. Retrying in 2 seconds...\n```\n\n#### 6. Network Connectivity Issues\n\n**Error**: Connection timeouts or network errors\n\n**Solution**: The action includes retry logic. For persistent issues:\n- Check GitHub Actions runner connectivity\n- Verify AWS service status\n- Consider using different AWS regions\n\n### Debug Mode\n\nEnable debug logging by setting the `ACTIONS_STEP_DEBUG` secret to `true` in your repository:\n\n```yaml\n- name: Delete Stack (Debug Mode)\n  uses: subhamay-bhattacharyya-gha/cfn-delete-stack-action@main\n  with:\n    stack-name: my-stack\n  env:\n    ACTIONS_STEP_DEBUG: true\n```\n\n### Getting Help\n\nIf you encounter issues not covered here:\n\n1. Check the [GitHub Issues](https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/issues)\n2. Review the action logs for detailed error messages\n3. Verify your AWS credentials and permissions\n4. Test the same operation using AWS CLI directly\n\n---\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n### Development\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Run the tests (`./scripts/run-unit-tests.sh`)\n4. Commit your changes (`git commit -m 'Add some amazing feature'`)\n5. Push to the branch (`git push origin feature/amazing-feature`)\n6. Open a Pull Request\n\n### Testing\n\nThis action includes comprehensive unit and integration tests:\n\n```bash\n# Run unit tests\n./scripts/run-unit-tests.sh\n\n# Run integration tests (requires AWS credentials)\n./scripts/test-integration.sh\n```\n\n---\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## Support\n\n- 📖 [Documentation](https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/wiki)\n- 🐛 [Report Issues](https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/issues)\n- 💬 [Discussions](https://github.com/subhamay-bhattacharyya-gha/cfn-delete-stack-action/discussions)\n- 📧 [Contact](mailto:subhamay.aws@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhamay-bhattacharyya-gha%2Fcfn-delete-stack-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubhamay-bhattacharyya-gha%2Fcfn-delete-stack-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhamay-bhattacharyya-gha%2Fcfn-delete-stack-action/lists"}