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

DeletingAllS3BucketsIssue116.py #139

Conversation

1jc
Copy link
Contributor

@1jc 1jc commented Mar 14, 2022

1jc for Issue 116 Sprint 4 " Issue 116 Fix script to delete all s3 buckets even with data"

fix #116

DATA ISSUE
The need script to list the s3 buckets and delete such buckets this issue fixes bug in issue 87

SCOPE

write python script for s3 bucket deleting.

Major Obstacles:

Instructor tested PR Thursday March 3, 2022. s3BucketList.py worked fine. s3BucketDelete.py worked but he wanted me to fix the script it where it should be automated versus original script deleting each bucket one by one making sure the bucket is empty.

Resolved Obstacle:

#116
This is a bug in the #87
The script doesn't delete all S3 buckets but only one
The script requires manual input and cannot be run from an automation machine. This should be changed to command line parameters
.
Instructor issued another issue which is issue #116 Fix the script to delete all s3 buckets even with data in connection there is a bug in issue 87 .

Project report for Instructor
Project Duration Sprint 4: March 3 to March 14 2022
Coordination: DevOps Team issue assigned to 1jc
Report Date: March 14, 2022
Assumptions: N/A

1jc for Issue 116 Sprint 4   " Issue 116 Fix script to delete all s3 buckets even with data"
@1jc 1jc self-assigned this Mar 14, 2022
@1jc 1jc added this to the Sprint 04 milestone Mar 14, 2022
@1jc 1jc linked an issue Mar 14, 2022 that may be closed by this pull request
@1jc
Copy link
Contributor Author

1jc commented Mar 14, 2022

Implementation:
Issue #116 Fix script to delete all s3 buckets even with data

  • Research

  • Write python scripts

  • Create branch in repository
    issue_#116_Fix_script_to_delete_all_s3_buckets_even_with_data

  • Create file
    DeletingAllS3BucketsIssue116.py for deleting s3 buckets

  • Put files into branch made

  • Do a git pull (to update your local)

  • Testing to be done see directions for testing script

  • Need at least two reviewers for two approvals for pull request

@1jc
Copy link
Contributor Author

1jc commented Mar 14, 2022

TESTING:
Requirements:

  1. AWS CLI configuration
  2. Python Boto3 installed
    For testing:
    • Need AWS CLI
    • $ aws –version
    • If your system does not have AWS CLI
    • $ aws configure
    • Need access key id, secret access key, default region name as us-west-2 (important included region us-west-2)
    • Install Python Boto3 in AWS CLI
    • $ python -m pip install boto3
    Import boto3
    Client = boto3.client(
    ‘s3’,
    aws_access_key_id = ACCESS_KEY,
    aws_secret_access_key = SECRET_KEY,
    aws_session_tokens = SESSION_TOKEN
    (important included region us-west-2)
    )
    • $ git pull
    How do I run a git pull command?
    Now go back to the original folder and follow the instructions:
  3. First,
    run git status
    Git will tell you the repository is clean.
  4. Then,
    run git fetch
  5. Next
    run git status
    Git will say your branch is one commit behind
    4.run git pull
    updates your local branch
  6. At command prompt navigate to the branch where script file is available in this case branch - :issue_#116_Fix_script_to_delete_all_s3_buckets_even_with_data
    type python then the script DeletingAllS3BucketsIssue116.py
    enter to run script
    verify print command

@1jc
Copy link
Contributor Author

1jc commented Mar 15, 2022

<style> </style>
Activities Documentation Date Activity Time Spent
Sprint 4 Issue 116 March  4, 5 Research 2.0 hours
Sprint 4 Issue 116 March 13 Research 2.0 hours
Sprint 4 Issue 116 March 14 Documentation 2.0 hours
Sprint 4 Issue 116 March 14 Folder, Initiate Pull, commits 5.0 hours
Totals     11.0 hours

@1jc 1jc modified the milestones: Sprint 04, Sprint 03 Mar 15, 2022
1jc made minor correction to list buckets then delete buckets to update file "DeleteAllS33BucketIssue116.py"
@1jc 1jc requested review from jonathonkindle and migzen March 17, 2022 17:31
@1jc 1jc merged commit 7ec739e into issue_#87_create_cleanup_script_for_all_s3_buckets Mar 20, 2022
@1jc 1jc deleted the Issue_#116_Fix_script_to_delete_all_s3_buckets_even_with_data branch March 20, 2022 17:55
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.

Fix the script to delete all S3 buckets even with data
1 participant