potential ci/cd process in the works

This commit is contained in:
2025-11-08 12:47:09 +00:00
parent 56ea4c6178
commit 36808ca32a
10 changed files with 226 additions and 60 deletions
View File
+33 -22
View File
@@ -1,24 +1,25 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
source = "hashicorp/azurerm"
version = "4.52.0"
}
}
}
provider "azurerm" {
features{}
features {}
subscription_id = "0c8b6184-985d-4f31-b57e-c91f921241bd"
# JP Personal sub
}
resource "azurerm_resource_group" "rg" {
name = "terraform_demo"
location = "uksouth"
name = var.resource_group_name
location = var.location
}
resource "azurerm_storage_account" "storage" {
name = "demoterraformbuildjp"
name = var.storage_account_name
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
@@ -26,8 +27,8 @@ resource "azurerm_storage_account" "storage" {
}
resource "azurerm_storage_container" "terraform_state" {
name = "terraform-state"
storage_account_id = azurerm_storage_account.storage.id
name = "terraform-state"
storage_account_id = azurerm_storage_account.storage.id
}
data "http" "my_ip" {
@@ -37,26 +38,36 @@ data "http" "my_ip" {
locals {
my_ip = chomp(data.http.my_ip.response_body)
ssh_public_key = file("~/.ssh/id_rsa.pub")
storage_account_url = "https://${azurerm_storage_account.storage.name}.blob.core.windows.net"
}
module "network" {
source = "../../modules/network"
vnet_name = "dev-vnet"
resource_group_name = "terraform_demo"
location = "UK South"
vnet_name = "vnet"
resource_group_name = var.resource_group_name
location = var.location
address_space = ["10.0.0.0/16"]
subnets = { public = "10.0.1.0/24", private = "10.0.2.0/24" }
environment = "dev"
project = "TerraformBootcamp"
environment = var.environment
project = var.project_name
}
module "compute" {
source = "../../modules/compute"
resource_group_name = "terraform_demo"
location = "UK South"
subnet_id = module.network.subnet_ids["public"]
vm_size = "Standard_B1s"
admin_username = "demo"
ssh_public_key = local.ssh_public_key
ex_ip = local.my_ip
}
module "data_factory" {
source = "../../modules/data_factory"
resource_group_name = var.resource_group_name
location = var.location
environment = var.environment
storage_account_url = local.storage_account_url
data_factory_name = var.data_factory_name
}
# module "compute" {
# source = "../../modules/compute"
# resource_group_name = var.resource_group_name
# location = var.location
# subnet_id = module.network.subnet_ids["public"]
# vm_size = "Standard_B1s"
# admin_username = "demo"
# ssh_public_key = file("~/.ssh/id_rsa.pub")
# ex_ip = chomp(data.http.my_ip.response_body)
# }
-7
View File
@@ -1,7 +0,0 @@
output "my_ip" {
value = local.my_ip
}
output "vm_public_ip" {
value = module.compute.vm_public_ip.ip_address
}
+25
View File
@@ -0,0 +1,25 @@
variable "resource_group_name" {
default = "the_data_sandbox_dev"
}
variable "location" {
default = "uksouth"
}
variable "storage_account_name" {
default = "devdatasandboxstore"
}
variable "environment" {
default = "dev"
}
variable "project_name" {
default = "TheDataSandBox"
}
variable "data_factory_name" {
description = "The unique name of the data factory"
type = string
default = "data-sandbox-factory-dev"
}