Added terraform for resources and backend reference to blob storage f…#74
Closed
BillMillerCoding wants to merge 1 commit into
Closed
Added terraform for resources and backend reference to blob storage f…#74BillMillerCoding wants to merge 1 commit into
BillMillerCoding wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Terraform infrastructure-as-code for DeliveryBotSystem, including an Azure Storage backend for shared Terraform state (issue #57) and an automated GitHub Actions workflow to apply changes on merges to main.
Changes:
- Added a
bootstrapTerraform configuration to create an Azure Storage Account + blob container for remote Terraform state. - Added a main Terraform configuration to provision core Azure resources (RG, ACR, Log Analytics, Event Hubs, SQL, Container Apps) and outputs.
- Added a GitHub Actions workflow to
init/validate/applyTerraform on pushes tomainforIac/**changes.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
Iac/backend.tf |
Configures an azurerm remote backend in blob storage for shared state. |
Iac/main.tf |
Provisions the application’s Azure infrastructure (compute, data, messaging, registry). |
Iac/outputs.tf |
Exposes URLs and key resource identifiers for downstream usage. |
Iac/providers.tf |
Defines Terraform/provider version constraints and AzureRM provider config. |
Iac/variables.tf |
Declares variables for Azure identity, locations, RG naming, and secrets. |
Iac/bootstrap/main.tf |
Creates the storage account + container used for Terraform remote state. |
Iac/bootstrap/outputs.tf |
Outputs backend resource names (storage account/container/RG). |
Iac/bootstrap/providers.tf |
Provider setup for the bootstrap stack using local state. |
Iac/bootstrap/variables.tf |
Bootstrap inputs for subscription, RG, and location. |
.github/workflows/terraform-apply.yml |
Automates Terraform apply on main updates affecting Iac/**. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+13
| variable "subscription_id" { | ||
| description = "Azure subscription ID." | ||
| type = string | ||
| default = "a06983f7-7384-4a09-a092-b13a3896be85" | ||
| } | ||
|
|
||
| variable "tenant_id" { | ||
| description = "Azure Active Directory tenant ID." | ||
| type = string | ||
| default = "37321907-14a5-4390-987d-ec0c66c655cd" | ||
| } |
Comment on lines
+39
to
+49
| variable "sql_ad_admin_login" { | ||
| description = "UPN of the Azure AD user set as SQL server administrator." | ||
| type = string | ||
| default = "wmiller17@ewu.edu" | ||
| } | ||
|
|
||
| variable "sql_ad_admin_object_id" { | ||
| description = "Object ID of the Azure AD SQL administrator." | ||
| type = string | ||
| default = "0b83fd03-d44e-4731-8ee0-790b50b715db" | ||
| } |
Comment on lines
+10
to
+16
| resource "azurerm_container_registry" "acr" { | ||
| name = "DeliverybotCR" | ||
| resource_group_name = azurerm_resource_group.rg.name | ||
| location = azurerm_resource_group.rg.location | ||
| sku = "Standard" | ||
| admin_enabled = true | ||
| } |
Comment on lines
+10
to
+16
| resource "azurerm_container_registry" "acr" { | ||
| name = "DeliverybotCR" | ||
| resource_group_name = azurerm_resource_group.rg.name | ||
| location = azurerm_resource_group.rg.location | ||
| sku = "Standard" | ||
| admin_enabled = true | ||
| } |
Comment on lines
+122
to
+137
| # Pull images from ACR using admin credentials stored as a secret. | ||
| secret { | ||
| name = "acr-password" | ||
| value = azurerm_container_registry.acr.admin_password | ||
| } | ||
|
|
||
| secret { | ||
| name = "sql-connection-string" | ||
| value = var.bot_api_sql_connection_string | ||
| } | ||
|
|
||
| registry { | ||
| server = azurerm_container_registry.acr.login_server | ||
| username = azurerm_container_registry.acr.admin_username | ||
| password_secret_name = "acr-password" | ||
| } |
Comment on lines
+1
to
+7
| name: Terraform Apply | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - "Iac/**" |
Comment on lines
+1
to
+5
| variable "subscription_id" { | ||
| description = "Azure subscription ID." | ||
| type = string | ||
| default = "a06983f7-7384-4a09-a092-b13a3896be85" | ||
| } |
Comment on lines
+12
to
+16
| provider "azurerm" { | ||
| features {} | ||
| subscription_id = var.subscription_id | ||
| tenant_id = var.tenant_id | ||
| } |
Comment on lines
+15
to
+18
| provider "azurerm" { | ||
| features {} | ||
| subscription_id = var.subscription_id | ||
| } |
Comment on lines
+3
to
+6
| resource "azurerm_resource_group" "rg" { | ||
| name = var.resource_group_name | ||
| location = var.location | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…or tf state
I also tried my hand at an Iac setup. I will understand if this does not get included.
#57