/Terraform-tech-talk

Presentation and tech demo

Primary LanguageHCL

Terraform-tech-talk

Presentation and tech demo

To demonstrate Terraform, this repo grabs all repository names under an org, and creates a consumption azure container environment, with container apps for each repo. Each container app is loaded with a github runner scoped to one of the repos.

Sources: Azure Container App Terraform Module - https://github.com/Azure/terraform-azure-container-apps Github action runner guide: https://baccini-al.medium.com/how-to-containerize-a-github-actions-self-hosted-runner-5994cc08b9fb

Manually created resources:

  • Service Principle | App Registration - Given scoped access to create resources on subscription.
  • Storage Account where state files can be stored with a tfstate container.
  • Set org_name to repo owner name

Resources to deploy Azurerm

Secrets: Azure Credentials ARM_CLIENT_SECRET AZURE_CLIENT_ID AZURE_SUBSCRIPTION_ID AZURE_TENANT_ID STATE_RG_NAME - The resource group with the state file container STATE_SA_NAME - The name of the storage account where the state files are stored. AZURE_CONTAINER_REGISTRY_USERNAME - Username for ACR AZURE_CONTAINER_REGISTRY_PASSWORD - Password for ACR GitHub values

Variables: Org name - GitHub Org/User name