Azure rendering solution deployment framework

This commit is contained in:
Rick Shahid 2022-11-28 07:41:08 -08:00
Родитель 5f94446661
Коммит 300019dd51
8 изменённых файлов: 39 добавлений и 55 удалений

Просмотреть файл

@ -1,8 +1,8 @@
resourceGroupName = "ArtistAnywhere.Network"
########################################################################################@########
#################################################################################################
# Virtual Network (https://learn.microsoft.com/azure/virtual-network/virtual-networks-overview) #
########################################################################################@########
#################################################################################################
computeNetwork = {
name = "Compute"
@ -41,12 +41,11 @@ computeNetwork = {
serviceDelegation = ""
}
]
}
computeNetworkSubnetIndex = {
farm = 0
workstation = 1
cache = 2
subnetIndex = { # Make sure each index is in sync with corresponding subnet
farm = 0
workstation = 1
cache = 2
}
}
storageNetwork = {
@ -74,12 +73,11 @@ storageNetwork = {
serviceDelegation = "Microsoft.Netapp/volumes"
}
]
}
storageNetworkSubnetIndex = {
primary = 0
secondary = 1
netApp = 2
subnetIndex = { # Make sure each index is in sync with corresponding subnet
primary = 0
secondary = 1
netApp = 2
}
}
################################################################################################################

Просмотреть файл

@ -42,16 +42,13 @@ variable "computeNetwork" {
serviceDelegation = string
}
))
}
)
}
variable "computeNetworkSubnetIndex" {
type = object(
{
farm = number
workstation = number
cache = number
subnetIndex = object(
{
farm = number
workstation = number
cache = number
}
)
}
)
}
@ -71,16 +68,13 @@ variable "storageNetwork" {
serviceDelegation = string
}
))
}
)
}
variable "storageNetworkSubnetIndex" {
type = object(
{
primary = number
secondary = number
netApp = number
subnetIndex = object(
{
primary = number
secondary = number
netApp = number
}
)
}
)
}
@ -772,18 +766,10 @@ output "computeNetwork" {
value = var.computeNetwork
}
output "computeNetworkSubnetIndex" {
value = var.computeNetworkSubnetIndex
}
output "storageNetwork" {
value = var.storageNetwork
}
output "storageNetworkSubnetIndex" {
value = var.storageNetworkSubnetIndex
}
output "storageEndpointSubnets" {
value = [
for virtualNetworksSubnet in local.virtualNetworksSubnets : virtualNetworksSubnet if contains(virtualNetworksSubnet.serviceEndpoints, "Microsoft.Storage")

Просмотреть файл

@ -221,19 +221,19 @@ data "azurerm_virtual_network" "storage" {
}
data "azurerm_subnet" "storage_primary" {
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNamePrimary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetworkSubnetIndex.primary].name
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNamePrimary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetwork.subnetIndex.primary].name
resource_group_name = data.azurerm_virtual_network.storage.resource_group_name
virtual_network_name = data.azurerm_virtual_network.storage.name
}
data "azurerm_subnet" "storage_secondary" {
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNameSecondary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetworkSubnetIndex.secondary].name
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNameSecondary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetwork.subnetIndex.secondary].name
resource_group_name = data.azurerm_virtual_network.storage.resource_group_name
virtual_network_name = data.azurerm_virtual_network.storage.name
}
data "azurerm_subnet" "storage_netapp" {
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNamePrimary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetworkSubnetIndex.netApp].name
name = !local.stateExistsNetwork ? var.storageNetwork.subnetNamePrimary : data.terraform_remote_state.network.outputs.storageNetwork.subnets[data.terraform_remote_state.network.outputs.storageNetwork.subnetIndex.netApp].name
resource_group_name = data.azurerm_virtual_network.storage.resource_group_name
virtual_network_name = data.azurerm_virtual_network.storage.name
}

Просмотреть файл

@ -193,7 +193,7 @@ data "azurerm_virtual_network" "compute" {
}
data "azurerm_subnet" "cache" {
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.cache].name
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.cache].name
resource_group_name = data.azurerm_virtual_network.compute.resource_group_name
virtual_network_name = data.azurerm_virtual_network.compute.name
}
@ -210,8 +210,8 @@ data "azuread_service_principal" "hpc_cache" {
locals {
stateExistsNetwork = try(length(data.terraform_remote_state.network.outputs) >= 0, false)
deployPrivateDnsZone = !local.stateExistsNetwork && var.computeNetwork.privateDns.zoneName != ""
vfxtControllerAddress = !local.stateExistsNetwork ? "" : cidrhost(data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.cache].addressSpace[0], 39)
vfxtVServerFirstAddress = !local.stateExistsNetwork ? "" : cidrhost(data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.cache].addressSpace[0], 40)
vfxtControllerAddress = !local.stateExistsNetwork ? "" : cidrhost(data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.cache].addressSpace[0], 39)
vfxtVServerFirstAddress = !local.stateExistsNetwork ? "" : cidrhost(data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.cache].addressSpace[0], 40)
vfxtVServerAddressCount = 12
}

Просмотреть файл

@ -200,7 +200,7 @@ data "azurerm_virtual_network" "compute" {
}
data "azurerm_subnet" "farm" {
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.farm].name
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.farm].name
resource_group_name = data.azurerm_virtual_network.compute.resource_group_name
virtual_network_name = data.azurerm_virtual_network.compute.name
}

Просмотреть файл

@ -169,7 +169,7 @@ data "azurerm_virtual_network" "compute" {
}
data "azurerm_subnet" "farm" {
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.farm].name
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.farm].name
resource_group_name = data.azurerm_virtual_network.compute.resource_group_name
virtual_network_name = data.azurerm_virtual_network.compute.name
}

Просмотреть файл

@ -137,7 +137,7 @@ data "azurerm_virtual_network" "compute" {
}
data "azurerm_subnet" "workstation" {
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetworkSubnetIndex.workstation].name
name = !local.stateExistsNetwork ? var.computeNetwork.subnetName : data.terraform_remote_state.network.outputs.computeNetwork.subnets[data.terraform_remote_state.network.outputs.computeNetwork.subnetIndex.workstation].name
resource_group_name = data.azurerm_virtual_network.compute.resource_group_name
virtual_network_name = data.azurerm_virtual_network.compute.name
}

Просмотреть файл

@ -4,10 +4,10 @@ Azure Artist Anywhere (AAA) is a *modular and customizable [infrastructure-as-co
https://user-images.githubusercontent.com/22285652/202864874-e48070dc-deaa-45ee-a8ed-60ff401955f0.mp4
The following *core principles* are implemented throughout the AAA solution deployment framework.
* Integration of security best practices, including [Managed Identity](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview), [Key Vault](https://learn.microsoft.com/azure/key-vault/general/overview), [Private Endpoints](https://learn.microsoft.com/azure/private-link/private-endpoint-overview).
* Any software (render manager, renderer, etc) in a [Compute Gallery](https://learn.microsoft.com/azure/virtual-machines/shared-image-galleries) custom image is supported.
* Separation of module deployment configuration files (*config.auto.tfvars*) and code files (*main.tf*).
The following *core design principles* are implemented throughout the AAA solution deployment framework.
* Integration of security best practices, including [Managed Identity](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview), [Key Vault](https://learn.microsoft.com/azure/key-vault/general/overview) and [Private Endpoints](https://learn.microsoft.com/azure/private-link/private-endpoint-overview).
* Any software (render manager, render engine, etc) in a [Compute Gallery](https://learn.microsoft.com/azure/virtual-machines/shared-image-galleries) custom image is supported.
* Clean separation of module deployment configuration files (*config.auto.tfvars*) and code files (*main.tf*).
| **Module Name** | **Module Description** | **Required for<br>Compute Burst?** | **Required for<br>All Cloud?** |
| --------------- | ---------------------- | ---------------------------------- | ------------------------------ |