See our "Clean Architecture" for more details
The following are personal notes
export AWS_PROFILE=your_iam_user_name
terraform plan -out=tfplan
terraform apply "tfplan"Run GitHub Actions manually (ssg_deploy.yml)
Note
In the future, we plan to integrate the migration process into the Continuous Deployment (CD) pipeline to automate database updates during deployments.
Follow these steps to perform Goose migration to RDS instance via Bastion host.
ssh -i "path/to/your-keypair.pem" ec2-user@<EC2_Public_IP>Once logged into the Bastion, use the following command to connect to your RDS instance in the shell.
mysql -h <RDS_Endpoint> -u <DB_User> -pUse the following command to install Goose in the shell.
# Download the Goose installation script
curl -fsSL https://raw.githubusercontent.com/pressly/goose/master/install.sh -o goose | sh
# Make the Goose binary executable
chmod +x goose
# Move Goose to /usr/local/bin to make it accessible globally
sudo mv goose /usr/local/bin/
# Verify that Goose is installed correctly
goose --versionTo transfer the migration directory from "your local machine" to the Bastion instance, use the following command.
# /home/ec2-user/ is the Bastion home directory
scp -r -i "your_keypair.pem" your_migration_files_dir ec2-user@<DNS>:/home/ec2-user/After transferring the migration files, run the Goose migration using the following command in the shell.
goose -dir /path/to/your_migrations_dir mysql '<DB_User>:<DB_Password>@tcp(<RDS_Endpoint>:3306)/<DB_Name>?parseTime=true' up

