Skip to main content

Maintenance

Changing Infrastructure

The steps for performing maintenance are similar to deployment. You will need to access the cloned repo and go to the directory where you ran terraform. This will contain all the configuration you setup as well as a reference to your state file. If you don't have this, you can always recreate it from scratch and as long as your state file still exists in the S3 bucket you configured, everything will work as normal.

Once you are in the properly prepped repo, you can make a change to the config.tfvars file, for example changing eks_version from 1.24 to 1.25 to ugrade EKS. After you make that change run a plan, although this time you will want to check the plan more carefully to make sure only the change you intend to make is happening, and run an apply.

Destroying Your Infrastructure

To destroy your infrastructure you can run the exact same commands as the plan and apply, only you will add a --destroy flag to the end.

terraform plan -var-file config.tfvars --destroy
terraform apply -var-file config.tfvars --destroy

This will let you see everything that will be destroyed and once you apply the change the destruction will commence.