Skip to content

Create terraform.tf #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
provider "azurerm" {
features {}
subscription_id = "c63c3c5b-04f0-4493-a67e-8ed65c6b726e"
client_id = "d42c7f97-f402-4038-872c-e9ef7c47eb5f"
client_secret = "ZgL8Q~Ku5ffdY5dYf5YhKhfKA2-zVP4rxzQ-YcKw"
tenant_id = "67347fae-2b4d-4dc6-a992-2e62874c6879"


}

terraform {
backend "azurerm" {
storage_account_name = "miniproject2storage"
container_name = "tfstate"
key = "prod.terraform.tfstate"

# rather than defining this inline, the Access Key can also be sourced
# from an Environment Variable - more information is available below.
access_key = "a0CGZJZfyscjrp0/MQN/oPBVk406LML54873afuOVUNywvacmaNqhxznnl5TzrMz+WEUKAX+1BGG+AStQM3NFQ=="
}
}


module "resourcegroup" {
source = "./modules/resourcegroup"
name = var.name
location = var.location
}

module "networking" {
source = "./modules/networking"
location = module.resourcegroup.location_id
resource_group = module.resourcegroup.resource_group_name
vnetcidr = var.vnetcidr
websubnetcidr = var.websubnetcidr
appsubnetcidr = var.appsubnetcidr
dbsubnetcidr = var.dbsubnetcidr
}

module "securitygroup" {
source = "./modules/securitygroup"
location = module.resourcegroup.location_id
resource_group = module.resourcegroup.resource_group_name
web_subnet_id = module.networking.websubnet_id
app_subnet_id = module.networking.appsubnet_id
db_subnet_id = module.networking.dbsubnet_id
}

module "compute" {
source = "./modules/compute"
location = module.resourcegroup.location_id
resource_group = module.resourcegroup.resource_group_name
web_subnet_id = module.networking.websubnet_id
app_subnet_id = module.networking.appsubnet_id
web_host_name = var.web_host_name
web_username = var.web_username
web_os_password = var.web_os_password
app_host_name = var.app_host_name
app_username = var.app_username
app_os_password = var.app_os_password
}

module "database" {
source = "./modules/database"
location = module.resourcegroup.location_id
resource_group = module.resourcegroup.resource_group_name
primary_database = var.primary_database
primary_database_version = var.primary_database_version
primary_database_admin = var.primary_database_admin
primary_database_password = var.primary_database_password
}