Cleaning Deployment cache
Despite the fact that the Terraform cache is automatically cleared before each deployment, you may also want to manually force the cleaning process. To clear the Terraform cache, Run theansible-playbook clean.yml command.
Migrating deployer to another machine
You can easily manipulate your deployment from any machine with sufficient prerequisites. If theupload_debug_info_to_s3 variable is set to true, the deployer will automatically upload your all.yml file to the s3 bucket, so you can download it to any other machine. Simply download this file to your group_vars folder and your new deployer will pick up the current deployment instead of creating a new one.
Attaching the existing RDS instance to the current deployment
Rather than create a new database, you may want to add an existing instance to use with the deployment. To do this, configure all proper values atgroup_vars/all.yml, including your DB ID and name, and execute the ansible-playbook attach_existing_rds.yml command. This will add the current DB instance into the Terraform-managed resource group. After that run ansible-playbook deploy_infra.yml as you normally would.
Notes
- While executing
ansible-playbook attach_existing_rds.ymlthe S3 and DynamoDB instances will be automatically created (ifbackendvariable is set totrue) to store Terraform state files. - The actual name of your resource must include the prefix you are using with this deployment.
Example:
Real resource: tf-poaprefixvariable: tfchain_db_idvariable: poa - Make sure MultiAZ is disabled on your database.
- Make sure that all the variables at
group_vars/all.ymlare exactly the same as your existing DB.