How to decommission unused template deploy services
1. Stack Deletion (will also delete related instances, VPCs, security groups, network gateways etc).
NOTE As a first port of call we would recommend raising a support ticket in #ask-cloud-platform requesting that cloud-platform delete your AWS stack.
In most cases the cloud platform team will have the necessary credentials to delete the stack for you (most template-deploy stacks will have been created within the moj-dsd AWS account).
NOTE Caution should also be taken as AWS Route53 DNS configuration may be deleted (and this could be referenced from your new deployment on the cloud platform). We recommend taking a backup of your DNS configuration so that it can be restored if necessary.
While it is possible to delete your stack from the AWS web interface, a cleaner way (including deleting related AWS resources) is to use fabric commands:
- installed the prerequisite tools (python, virtualenv, fabric, aws cli)
- configured your AWS credentials
- configured your github access
- create your own GPG key
a. Run mkvirtualenv to create your local environment.
b. Run the fabric command to delete your stack
$ fab aws:<awsaccountname> environment:<environmentname> \ application:<projectname> config:cloudformation/<projectname>.yaml \ passwords:cloudformation/<projectname>-secrets.yaml \ -u <githubsshkey> cfn_delete
2. Jenkins Projects:
NOTE If you do not have the necessary permissions to carry out the following actions, raise a support ticket in [#ask-cloud-platform](https://mojdt.slack.com/messages/C57UPMZLY/team/U58MLFA0M/
Either a) Disable the project (if you wish to retain the configuration for reference):
i. Locate your project’s job: ii. Click on the “Disable Project” button:
iii. If you wish to resurrect your project job, click on “Enable” button:
Or, b) Delete the project (if you no longer require the Jenkins deploy config):
i. Click on “Delete Project”:
3. Github deploy repos (this should take place after you have deleted the AWS resources)
NOTE If you do not have the necessary permissions to carry out the following actions, raise a support ticket in #ask-cloud-platform
Either, a) Archive the Github deploy repos (if you still require the deployment source code for reference)
i. Locate your deploy-repos. Click on the “Settings” button: ii. Click on the “Archive this repository” button: iii. Type in the name of the repository and then click “I understand the consequences, archive this repository”: iv. The deploy repository will then be archived (confirmatory message will appear):
Or, b) Delete the Github deploy repos (if you no longer require the deploy configuration for reference)
i. As for archiving -Locate your deploy-repos. Click on the “Settings” button. Then click on the “Delete this repository” button:
4. Docker Images:
The template deploy docker image repository will be completely decommissioned when we have switched everything over from template-deploy. So, you do not need to bother deleting your docker images from it.