Deploying to Backup Account#
Some of the CDK code is used to deploy a backup bucket for S3 replication. This page covers how to deploy this code into a different account. This backup code can be deployed into the normal dev account as well.
Steps for deploying#
Note
First, you will need to deploy the SdsDataManager stack to the source account (dev or prod). The steps to set up and deploy that are in the CDK Deployment doc.
Set up your backup account credentials if you’re using another account. This can be done by adding a new profile to AWS (i.e.
imap-backup)Set your
AWS_PROFILEenvironment variable to the backup account profileSet the
source_accountvariable in the “backup” section of the cdk.json file to the account number for the _source_ bucket (where the backed up items originate)Update the
account_namevariable in thecdk.jsonfile to “backup”Finally, you will need to copy the Role arn deployed in SdsDataManager into
sds_data_manager/stacks/backup_bucket_construct.py. This arn can be found by going to the IAM console in the source account and searching for “BackupRole”.Run your
cdk bootstrapcommand if you haven’t already done so for the backup account.Run
cdk synth --context account_name=backupand check to confirm that the only stack being deployed is the “BackupBucket” stackRun
cdk deploy --context account_name=backupto deploy!
Note
Once the Backup bucket is deployed to the other account, you still need to set up S3 Replication in the source account.