This repo contains an interactive script which can be used to roll back a corrupt config file for the DNS or DHCP services.
- AWS Vault configured for the corrupted environment
- jq to slice and filter and map and transform structured data
In the event that Grafana has alerted on a disaster scenario, find the correct section and follow the steps provided.
- Identify the broken service (dns/dhcp) and environment (development/pre-production/production)
- Run:
aws-vault exec CORRUPT_ENVIRONMENT_VAULT_PROFILE_NAME -- make restore-dns-dhcp-config
- At the prompt, enter the environment name (development/pre-production/production)
- At the second prompt, enter the corrupt service name (dns/dhcp)
- You will be given an output of the last five published configs with their
VersionId
andLastModified
- Copy the
VersionId
of the config you wish to restore to - At the final prompt, paste the
VersionId
- The terminal will exit with the following command:
Successfully rolled back dhcp to version: VersionId
- Identify the broken service (dns/dhcp) and environment (development/pre-production/production)
- Run:
aws-vault exec CORRUPT_ENVIRONMENT_VAULT_PROFILE_NAME -- make restore-service-container
- At the prompt, enter the environment name (development/pre-production/production)
- At the second prompt, enter the corrupt service name (dns/dhcp)
- You will be given an output of the last five pushed containers with their
imageDigest
andimagePushedAt
- Copy the
imageDigest
of the container you wish to re-tag as latest - At the final prompt, paste the
imageDigest
- The terminal will exit with the following command:
Successfully re-tagged image: imageDigest as latest