Skip to content

Added terraform for resources and backend reference to blob storage f…#74

Closed
BillMillerCoding wants to merge 1 commit into
mainfrom
Iac-Setup
Closed

Added terraform for resources and backend reference to blob storage f…#74
BillMillerCoding wants to merge 1 commit into
mainfrom
Iac-Setup

Conversation

@BillMillerCoding
Copy link
Copy Markdown
Contributor

…or tf state
I also tried my hand at an Iac setup. I will understand if this does not get included.
#57

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 bootstrap Terraform 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/apply Terraform on pushes to main for Iac/** 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 thread Iac/variables.tf
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 thread Iac/variables.tf
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 thread Iac/main.tf
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 thread Iac/main.tf
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 thread Iac/main.tf
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 thread Iac/providers.tf
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 thread Iac/main.tf
Comment on lines +3 to +6
resource "azurerm_resource_group" "rg" {
name = var.resource_group_name
location = var.location
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants