- Does not appear possible to run an apply locally
- Keep using a mono-repo or switch to one repo per service?
- Should stage and prod both deploy from master or should there be a long running prod branch?
Two workspaces are created per app and named <app_name>-stage
and <app_name>-prod
- Make changes locally
- (optional) Run
terraform plan
locally - Commit/push changes
- Create PR and wait for TF Cloud to run a plan
- Get PR approval and merge into master
- Approve the plan in TF cloud for stage, then prod
Since TF Cloud doesn't really use workspaces in the local sense, this is easy. We only create a single TF Cloud workspace for any configurations that should be global.
Pull from the remote state of the desired workspace. Set up a run trigger in TF Cloud. When a successful apply happens in the source workspace TF Cloud will run a plan in the dependent workspace.