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

Automate Deleting Environment/Account from TF management #6457

Closed
6 tasks done
richgreen-moj opened this issue Mar 12, 2024 · 3 comments
Closed
6 tasks done

Automate Deleting Environment/Account from TF management #6457

richgreen-moj opened this issue Mar 12, 2024 · 3 comments
Assignees

Comments

@richgreen-moj
Copy link
Contributor

richgreen-moj commented Mar 12, 2024

User Story

As a MP Engineer
I want to automate the steps needed to remove an account from TF management
So that the account deletion process can be quicker and more robust

Value / Purpose

To automate the manual steps required in the Deleting an Environment process.

This process requires many manual steps where you need to delete resources and workspaces in the MP and MP Env repos. If we could automate these it would make the process more efficient.

Useful Contacts

@richgreen-moj

Additional Information

Certain workflows such as Terraform: New environment will re-create accounts/workspaces which you are trying to delete if it runs mid-way through your progress.

Making the process quicker would stop the need for us having to warn others not to merge PRs while we carry out the process.

Proposal / Unknowns

Some steps will not be possible to automate e.g. the actions required as a root user.

Definition of Done

  • Github Action (or agreed solution) has been developed which automates the deletion steps
  • Dummy account or environment created for testing
  • Solution has been tested on the dummy account
  • User docs have been updated
  • Another team member has reviewed
  • Tests are green
@richgreen-moj
Copy link
Contributor Author

We are going to create a bash script that can be run locally to automate some of the manual steps required for account deletion. To start with we'll generate a script for each of these stages:

Then next week we aim to bring it together in to one script. To begin with we shall concentrate on the deletion of a single existing environment, e.g. not all the environments for an application.

@richgreen-moj
Copy link
Contributor Author

richgreen-moj commented Apr 2, 2024

New account called delete-account has been created for the purpose of testing our account deletion scripts:
https://github.com/ministryofjustice/modernisation-platform/blob/main/environments/delete-account.jsone

@richgreen-moj
Copy link
Contributor Author

richgreen-moj commented Apr 19, 2024

#6799 closes this issue.
A demo of us running the scripts can be found here

@github-project-automation github-project-automation bot moved this from In Progress to Done in Modernisation Platform Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants