The IAM role exists from the last post. The connection stack still requires manual updates through the console. Time to fix that. This post connects Sync from Git to the connection stack so every future change deploys automatically.
Deployment File
Git Sync needs a deployment file in your repo that tells CloudFormation where to find the template. Add a deployment-file.yaml to the connection repo:
template-file-path: infra.yaml
No parameters section because this stack has no parameters. The template path is relative to the repo root. Push the repo to GitHub.
Connecting Git Sync
Go to the existing connection stack in CloudFormation. Click the Git sync tab, then Connect.
- Select the CodeConnection from post 2.
- Enter your repository name, branch (
main), and the deployment file path (deployment-file.yaml). - Select the IAM role (
CloudFormationGitSyncRolefrom post 4).
This is a different path from post 6, where you create a new stack with Git Sync from the start. Here the stack already exists, so you add Git Sync to it after the fact. Both paths end in the same place: pushes to the repo trigger automatic deployments.
What Changes
From now on, when future posts add permissions to this role, you just push the updated infra.yaml to the connection repo and Git Sync handles the rest. No more manual stack updates through the console.