Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and run script that deletes all API Gateway resources #170

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

dagmawidemissie17
Copy link
Contributor

@dagmawidemissie17 dagmawidemissie17 commented Mar 19, 2022

Closes issue #153

Overview

  • This pull request adds deleteApiGateway.py

  • This file will list and delete all the API Gateway resources through command-line arguments. The following arguments can be provided at runtime:

    • --region: AWS region where the API gateway resides.
    • --forceDelete: To force delete all the API gatewa that exist in the selected region.
  • You can read the docstrings in this python file to get an in-depth understanding of each function and arguments in this file.

Pre-requisites

To Test

  1. git checkout dd-153
  2. cd devops/DeleteApiGateway
  3. Run the script with an arguments to confirm functionality:
  • To List all the API gateways: python deleteApiGateway.py --region us-west-2
  • To force delete all the API gateways in the region: `python deleteApiGateway.py --region us-west-2 --forceDelete
  1. Go to your AWS console/services/API Gateway and make sure no API gateway resource exists.

                                       Terminal output from running the cleanup script
    

image

            Screenshot from AWS console showing that no resources are left(Only APIs gateways created in 2022 are deleted)

image

Time Spent

Activity Estimate Actual Time Spent
Researching and writing script 3 hours 2 hours
Testing script 1 hour 1 hour
Write documentation 30 mins 30 mins
Pull request and wrap-up 30 mins 30mins

@dagmawidemissie17 dagmawidemissie17 marked this pull request as ready for review March 26, 2022 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create and run a deletion script for API Gateway resources to clean up AWS
1 participant