This track highlights the use of the TFC multi-space pattern to deploy the Clumsy Bird Application. It will keep the network and compute portions of the application in seperate TFC workspaces and connect them via a chain-runner which uses the tfe_workspace_run resource to define workspace dependencies between these workspaces.
Bootstrap the TFC infrastructure by applying a TFC Run in the workspace - clumsy-bird-bootstrap. This is a workspace that is VCS connected to https://github.com/rptcloud/clumsy_bird pointing to the 0-bootstrap working directory.
- Your TFC org must have VCS set up within it to create new workspaces linked to GitHub orgs. The config here assumes exactly one GitHub VCS provider.
- The bootstrap workspace runs in Terraform Cloud too and requires the variable
TFE_TOKENto be set. - This workspace is VCS connected against the
0-bootsrapdirectory in thegithub.zerozr99.workers.dev/rptcloud/clumsy_birdrepository
-
Update the
AWS Creds - Clumsy BirdVariable Set to include the correct AWS Credentials. -
Update the
TFE_TOKENvariable within theclumsy-bird-app-deployworkspace with a TFE User token. -
Inside TFC first apply the
clumsy-bird-app-deployworkspace and this will trigger theclumsy-bird-networkandclumsy-bird-computeworkspaces. -
You can manage the compute independently of the network, but changes in the network will trigger changes in the compute environment.
-
Note: If running in a free-tier Terraform Cloud, you will need to switch the "clumsy-bird-app-deploy-development" workspace to run in local mode, otherwise you will hit the 1-run concurrency limit.
In 0-bootstrap, run terraform apply. That will create a few projects, some workspaces, and a few other resources. There are no external dependencies outside of Terraform Cloud, to make things simple. You can totally expand upon these ideas to do things with other Providers.
When done with the exercise, run a terraform destroy in the clumsy-bird-bootstrap workspace to cleanup the Clumsy Bird project, workspaces and variable sets.