Compare commits

..

2 Commits

Author SHA1 Message Date
zjhe caff317c3f fix example 2024-10-05 09:41:28 +08:00
zjhe af3343e56f bump azurerm to v3 2024-10-05 09:33:39 +08:00
114 changed files with 394 additions and 2356 deletions
@@ -1,20 +1,3 @@
## 06 Oct 24 00:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:04 UTC
Success: true
-18
View File
@@ -1,21 +1,3 @@
## 06 Oct 24 00:55 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:10 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:58 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:14 UTC
Success: false
@@ -1,23 +0,0 @@
# Azure Kubernetes Service (AKS) cluster in an Azure Extended Zone
This template deploys an Azure Kubernetes Service (AKS) cluster in an Azure Extended Zones.
## Terraform resource types
- [random_pet](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/pet)
- [azurerm_resource_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group)
- [azurerm_virtual_network](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network)
- [azurerm_kubernetes_cluster](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/kubernetes_cluster)
## Variables
| Name | Description | Default value |
|-|-|-|
| `resource_group_name_prefix` | Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription. | rg |
| `resource_group_location` | Location of the resource group. | Central US |
| `virtual_network_name` | Name of the virtual network resource. | example-vnet |
| `aks_node_count` | Number of nodes in the AKS cluster. | 3 |
| `aks_node_vm_size` | Size of the VMs in the AKS cluster. | Standard_D2_v2 |
| `admin_username` | The admin username for the Windows node pool. | azureuser |
| `admin_password` | The admin password for the Windows node pool. | Passw0rd1234Us! |
| `aks_extended_zone` | AKS extended zone. | Los Angeles |
-135
View File
@@ -1,135 +0,0 @@
resource "random_pet" "rg_name" {
prefix = var.resource_group_name_prefix
}
resource "azurerm_resource_group" "rg" {
location = var.resource_group_location
name = random_pet.rg_name.id
}
resource "random_pet" "azurerm_kubernetes_cluster_name" {
prefix = "cluster"
}
resource "random_pet" "azurerm_kubernetes_cluster_dns_prefix" {
prefix = "dns"
}
resource "azurerm_virtual_network" "vnet" {
name = var.virtual_network_name
address_space = ["192.168.0.0/16"]
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
subnet {
name = "subnet1"
address_prefix = "192.168.1.0/24"
}
}
resource "azapi_resource" "aks" {
count = 1
type = "Microsoft.ContainerService/ManagedClusters@2024-05-01"
name = random_pet.azurerm_kubernetes_cluster_name.id
parent_id = azurerm_resource_group.rg.id
location = azurerm_resource_group.rg.location
identity {
type = "SystemAssigned"
}
body = {
extendedLocation = {
name = var.aks_extended_zone
type = "EdgeZone"
}
sku = {
name = "Base"
tier = "Free"
}
properties = {
dnsPrefix = random_pet.azurerm_kubernetes_cluster_dns_prefix.id
kubernetesVersion = "1.29"
agentPoolProfiles = [
{
name = "agentpool"
count = var.aks_node_count
vmSize = var.aks_node_vm_size
osDiskSizeGB = 128
kubeletDiskType = "OS"
vnetSubnetID = element(tolist(azurerm_virtual_network.vnet.subnet), 0).id
maxPods = 30
type = "VirtualMachineScaleSets"
enableAutoScaling = false,
scaleDownMode = "Delete",
orchestratorVersion = "1.29"
enableNodePublicIP = false
mode = "System"
enableEncryptionAtHost = false
enableUltraSSD = false
osType = "Linux"
osSKU = "Ubuntu"
upgradeSettings = {
maxSurge = "10%"
}
enableFIPS = false
}
]
windowsProfile = {
adminUsername = var.admin_username
adminPassword = var.admin_password
licenseType = "None"
enableCSIProxy = true
}
servicePrincipalProfile = {
clientId = "msi"
}
enableRBAC = true
supportPlan = "KubernetesOfficial"
networkProfile = {
networkPlugin = "azure"
networkPolicy = "none"
networkDataplane = "azure"
loadBalancerSku = "standard"
loadBalancerProfile = {
managedOutboundIPs = {
count = 1
}
backendPoolType = "nodeIPConfiguration"
}
serviceCidr = "10.0.0.0/16"
dnsServiceIP = "10.0.0.10"
outboundType = "loadBalancer"
serviceCidrs = [
"10.0.0.0/16",
]
ipFamilies = ["IPv4"]
}
autoUpgradeProfile = {
upgradeChannel = "none"
nodeOSUpgradeChannel = "NodeImage"
}
disableLocalAccounts = false
storageProfile = {
diskCSIDriver = {
enabled = true
}
fileCSIDriver = {
enabled = true
}
snapshotController = {
enabled = true
}
}
oidcIssuerProfile = {
enabled = false
}
azureMonitorProfile = {
metrics = {
enabled = false
}
}
}
}
timeouts {
create = "6h"
}
}
@@ -1,11 +0,0 @@
# output "resource_group_name" {
# value = azurerm_resource_group.rg.name
# }
#
# output "aks_cluster_name" {
# value = azurerm_kubernetes_cluster.aks.name
# }
#
# output "aks_extended_zone" {
# value = azurerm_kubernetes_cluster.aks.edge_zone
# }
@@ -1,20 +0,0 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
azapi = {
source = "Azure/azapi"
version = "2.0.1"
}
random = {
source = "hashicorp/random"
version = "~>3.0"
}
}
}
provider "azurerm" {
features {}
}
@@ -1,47 +0,0 @@
variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}
variable "resource_group_location" {
type = string
default = "West US"
description = "Location of the resource group."
}
variable "virtual_network_name" {
type = string
description = "Virtual network names"
default = "example-vnet"
}
variable "aks_node_count" {
type = number
description = "AKS node count"
default = 3
}
variable "aks_node_vm_size" {
type = string
description = "AKS node VM size"
default = "Standard_D2_v2"
}
variable "admin_username" {
type = string
description = "The admin username for the Windows node pool."
default = "azureuser"
}
variable "admin_password" {
type = string
description = "The admin password for the Windows node pool."
default = "Passw0rd1234Us!"
}
variable "aks_extended_zone" {
type = string
description = "AKS extended zone"
default = "Los Angeles"
}
@@ -1,20 +1,3 @@
## 06 Oct 24 00:52 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:03 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:44 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:01 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:43 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:00 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:54 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:58 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 00:40 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/tls v4.0.4
### Error
---
## 29 Sep 24 04:49 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 00:37 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:48 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 00:33 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v0.1.0
+ provider registry.terraform.io/hashicorp/azurerm v3.0.2
+ provider registry.terraform.io/hashicorp/random v3.1.2
### Error
---
## 29 Sep 24 04:48 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:33 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v0.1.0
+ provider registry.terraform.io/hashicorp/azurerm v3.0.2
### Error
---
## 29 Sep 24 04:48 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 01:14 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:30 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 01:36 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:50 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 01:35 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:17 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:22 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:30 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:36 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 00:19 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:27 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 00:19 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.2
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:28 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:22 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:30 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:24 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:32 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:18 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:24 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:23 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:28 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:32 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:27 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:23 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:29 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 05:41 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 03:18 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 06:08 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 03:14 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 06:06 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 03:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 06:06 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 03:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 06:06 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 01:02 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:58 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:55 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:51 UTC
Success: true
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 01:08 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:48 UTC
Success: false
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 00:16 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:48 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:43 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:21 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:20 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:48 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 00:23 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.1.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.4.3
### Error
---
## 29 Sep 24 03:50 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:19 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:41 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 00:47 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:50 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:40 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:46 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 01:52 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:27 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:49 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:53 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 00:31 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:35 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:33 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:37 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:26 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:30 UTC
Success: true
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 00:30 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:34 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:26 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:30 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:17 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:29 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:16 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.4.3
### Error
---
## 29 Sep 24 03:28 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 00:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:04 UTC
Success: true
-18
View File
@@ -1,21 +1,3 @@
## 06 Oct 24 03:07 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/http v3.4.5
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:48 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:56 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:38 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:59 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:33 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 03:03 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v4.4.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:40 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 03:12 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:38 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 02:56 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:29 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:55 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:30 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 02:55 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:25 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:51 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:27 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:49 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:26 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:12 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:26 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:58 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:25 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:49 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:25 UTC
Success: false
-18
View File
@@ -1,21 +1,3 @@
## 06 Oct 24 02:48 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/helm v2.9.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:24 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:40 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.4.3
### Error
---
## 29 Sep 24 03:25 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 02:37 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.32.0
+ provider registry.terraform.io/hashicorp/random v3.3.2
### Error
---
## 29 Sep 24 03:23 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:48 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:43 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:50 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:10 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 02:47 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:42 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 03:11 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:07 UTC
Success: false
@@ -1,18 +1,3 @@
## 06 Oct 24 02:13 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
### Error
---
## 29 Sep 24 03:11 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:13 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 01:16 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/tls v4.0.4
### Error
---
## 29 Sep 24 03:09 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:15 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:08 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:12 UTC
Success: false
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 02:13 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:10 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:11 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v4.4.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:13 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 02:27 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:24 UTC
Success: false
@@ -1,22 +1,3 @@
## 06 Oct 24 02:16 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/time v0.9.1
### Error
---
## 29 Sep 24 03:12 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 01:59 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.0.2
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/orobix/azureml v0.0.5
### Error
---
## 29 Sep 24 03:02 UTC
Success: false
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 02:06 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:10 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:03 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:07 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 02:10 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:14 UTC
Success: true
@@ -1,21 +1,3 @@
## 06 Oct 24 02:02 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/azure/azapi v1.15.0
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:10 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 01:54 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.32.0
+ provider registry.terraform.io/hashicorp/http v3.4.5
### Error
---
## 29 Sep 24 03:02 UTC
Success: false
@@ -1,22 +1,3 @@
## 06 Oct 24 01:59 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/local v2.3.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/tls v4.0.4
### Error
---
## 29 Sep 24 03:10 UTC
Success: true
@@ -1,20 +1,3 @@
## 06 Oct 24 01:58 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:53 UTC
Success: false
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 01:54 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:49 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 01:42 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 04:42 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 01:41 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:15 UTC
Success: false
@@ -1,21 +1,3 @@
## 06 Oct 24 01:53 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
+ provider registry.terraform.io/orobix/azureml v0.0.5
### Error
---
## 08 Sep 24 00:36 UTC
Success: true
@@ -1,29 +1,3 @@
## 06 Oct 24 01:35 UTC
Success: false
### Versions
### Error
Initializing the backend...
Warning: Quoted references are deprecated
on aks.tf line 6, in resource "azurerm_kubernetes_cluster" "default":
6: depends_on = ["azurerm_role_assignment.default"]
In this context, references are expected literally rather than in quotes.
Terraform 0.11 and earlier required quotes, but quoted references are now
deprecated and will be removed in a future version of Terraform. Remove the
quotes surrounding this reference to silence this warning.
(and 5 more similar warnings elsewhere)
---
## 29 Sep 24 03:10 UTC
Success: false
@@ -1,20 +1,3 @@
## 06 Oct 24 01:35 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/null v3.2.3
### Error
---
## 29 Sep 24 03:10 UTC
Success: false
-17
View File
@@ -1,20 +1,3 @@
## 06 Oct 24 01:57 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v3.116.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 03:10 UTC
Success: false
+89 -95
View File
@@ -1,205 +1,199 @@
locals {
prefix-hub-nva = "hub-nva"
hub-nva-location = "eastus"
hub-nva-resource-group = "hub-nva-rg"
}
resource "random_string" "suffix" {
length = 5
special = false
upper = false
prefix-hub-nva = "hub-nva"
hub-nva-location = "eastus"
hub-nva-resource-group = "hub-nva-rg"
}
resource "azurerm_resource_group" "hub-nva-rg" {
name = "${local.prefix-hub-nva}-rg-${random_string.suffix.result}"
location = local.hub-nva-location
name = "${local.prefix-hub-nva}-rg"
location = local.hub-nva-location
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_network_interface" "hub-nva-nic" {
name = "${local.prefix-hub-nva}-nic"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
enable_ip_forwarding = true
name = "${local.prefix-hub-nva}-nic"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
enable_ip_forwarding = true
ip_configuration {
ip_configuration {
name = local.prefix-hub-nva
subnet_id = azurerm_subnet.hub-dmz.id
private_ip_address_allocation = "Static"
private_ip_address = "10.0.0.36"
}
}
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_virtual_machine" "hub-nva-vm" {
name = "${local.prefix-hub-nva}-vm"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
network_interface_ids = [azurerm_network_interface.hub-nva-nic.id]
vm_size = var.vmsize
name = "${local.prefix-hub-nva}-vm"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
network_interface_ids = [azurerm_network_interface.hub-nva-nic.id]
vm_size = var.vmsize
storage_image_reference {
storage_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
}
storage_os_disk {
storage_os_disk {
name = "myosdisk1"
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
}
os_profile {
os_profile {
computer_name = "${local.prefix-hub-nva}-vm"
admin_username = var.username
admin_password = local.password
}
admin_password = var.password
}
os_profile_linux_config {
os_profile_linux_config {
disable_password_authentication = false
}
}
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_virtual_machine_extension" "enable-routes" {
name = "enable-iptables-routes"
virtual_machine_id = azurerm_virtual_machine.hub-nva-vm.id
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.0"
name = "enable-iptables-routes"
virtual_machine_id = azurerm_virtual_machine.hub-nva-vm.id
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.0"
settings = <<SETTINGS
settings = <<SETTINGS
{
"fileUris": [
"https://raw.githubusercontent.com/lonegunmanb/reference-architectures/refs/heads/master/scripts/linux/enable-ip-forwarding.sh"
"https://raw.githubusercontent.com/mspnp/reference-architectures/master/scripts/linux/enable-ip-forwarding.sh"
],
"commandToExecute": "bash enable-ip-forwarding.sh"
}
SETTINGS
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_route_table" "hub-gateway-rt" {
name = "hub-gateway-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
name = "hub-gateway-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
route {
route {
name = "toHub"
address_prefix = "10.0.0.0/16"
next_hop_type = "VnetLocal"
}
}
route {
route {
name = "toSpoke1"
address_prefix = "10.1.0.0/16"
next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36"
}
}
route {
route {
name = "toSpoke2"
address_prefix = "10.2.0.0/16"
next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36"
}
}
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_subnet_route_table_association" "hub-gateway-rt-hub-vnet-gateway-subnet" {
subnet_id = azurerm_subnet.hub-gateway-subnet.id
route_table_id = azurerm_route_table.hub-gateway-rt.id
depends_on = [azurerm_subnet.hub-gateway-subnet]
subnet_id = azurerm_subnet.hub-gateway-subnet.id
route_table_id = azurerm_route_table.hub-gateway-rt.id
depends_on = [azurerm_subnet.hub-gateway-subnet]
}
resource "azurerm_route_table" "spoke1-rt" {
name = "spoke1-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
name = "spoke1-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
route {
route {
name = "toSpoke2"
address_prefix = "10.2.0.0/16"
next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36"
}
}
route {
route {
name = "default"
address_prefix = "0.0.0.0/0"
next_hop_type = "VnetLocal"
}
next_hop_type = "vnetlocal"
}
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-mgmt" {
subnet_id = azurerm_subnet.spoke1-mgmt.id
route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-mgmt]
subnet_id = azurerm_subnet.spoke1-mgmt.id
route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-mgmt]
}
resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-workload" {
subnet_id = azurerm_subnet.spoke1-workload.id
route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-workload]
subnet_id = azurerm_subnet.spoke1-workload.id
route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-workload]
}
resource "azurerm_route_table" "spoke2-rt" {
name = "spoke2-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
name = "spoke2-rt"
location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false
route {
route {
name = "toSpoke1"
address_prefix = "10.1.0.0/16"
next_hop_in_ip_address = "10.0.0.36"
next_hop_type = "VirtualAppliance"
}
}
route {
route {
name = "default"
address_prefix = "0.0.0.0/0"
next_hop_type = "VnetLocal"
}
next_hop_type = "vnetlocal"
}
tags = {
tags = {
environment = local.prefix-hub-nva
}
}
}
resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-mgmt" {
subnet_id = azurerm_subnet.spoke2-mgmt.id
route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-mgmt]
subnet_id = azurerm_subnet.spoke2-mgmt.id
route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-mgmt]
}
resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-workload" {
subnet_id = azurerm_subnet.spoke2-workload.id
route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-workload]
subnet_id = azurerm_subnet.spoke2-workload.id
route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-workload]
}
+79 -79
View File
@@ -1,153 +1,153 @@
locals {
prefix-hub = "hub"
hub-location = "eastus"
hub-resource-group = "hub-vnet-rg-${random_string.suffix.result}"
shared-key = "4-v3ry-53cr37-1p53c-5h4r3d-k3y"
prefix-hub = "hub"
hub-location = "eastus"
hub-resource-group = "hub-vnet-rg"
shared-key = "4-v3ry-53cr37-1p53c-5h4r3d-k3y"
}
resource "azurerm_resource_group" "hub-vnet-rg" {
name = local.hub-resource-group
location = local.hub-location
name = local.hub-resource-group
location = local.hub-location
}
resource "azurerm_virtual_network" "hub-vnet" {
name = "${local.prefix-hub}-vnet"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
address_space = ["10.0.0.0/16"]
name = "${local.prefix-hub}-vnet"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
address_space = ["10.0.0.0/16"]
tags = {
tags = {
environment = "hub-spoke"
}
}
}
resource "azurerm_subnet" "hub-gateway-subnet" {
name = "GatewaySubnet"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.255.224/27"]
name = "GatewaySubnet"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.255.224/27"]
}
resource "azurerm_subnet" "hub-mgmt" {
name = "mgmt"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.64/27"]
name = "mgmt"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.64/27"]
}
resource "azurerm_subnet" "hub-dmz" {
name = "dmz"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.32/27"]
name = "dmz"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.32/27"]
}
resource "azurerm_network_interface" "hub-nic" {
name = "${local.prefix-hub}-nic"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
enable_ip_forwarding = true
name = "${local.prefix-hub}-nic"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
enable_ip_forwarding = true
ip_configuration {
ip_configuration {
name = local.prefix-hub
subnet_id = azurerm_subnet.hub-mgmt.id
private_ip_address_allocation = "Dynamic"
}
}
tags = {
tags = {
environment = local.prefix-hub
}
}
}
#Virtual Machine
resource "azurerm_virtual_machine" "hub-vm" {
name = "${local.prefix-hub}-vm"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
network_interface_ids = [azurerm_network_interface.hub-nic.id]
vm_size = var.vmsize
name = "${local.prefix-hub}-vm"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
network_interface_ids = [azurerm_network_interface.hub-nic.id]
vm_size = var.vmsize
storage_image_reference {
storage_image_reference {
publisher = "Canonical"
offer = "UbuntuServer"
sku = "16.04-LTS"
version = "latest"
}
}
storage_os_disk {
storage_os_disk {
name = "myosdisk1"
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = "Standard_LRS"
}
}
os_profile {
os_profile {
computer_name = "${local.prefix-hub}-vm"
admin_username = var.username
admin_password = local.password
}
admin_password = var.password
}
os_profile_linux_config {
os_profile_linux_config {
disable_password_authentication = false
}
}
tags = {
tags = {
environment = local.prefix-hub
}
}
}
# Virtual Network Gateway
resource "azurerm_public_ip" "hub-vpn-gateway1-pip" {
name = "hub-vpn-gateway1-pip"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
name = "hub-vpn-gateway1-pip"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
allocation_method = "Dynamic"
allocation_method = "Dynamic"
}
resource "azurerm_virtual_network_gateway" "hub-vnet-gateway" {
name = "hub-vpn-gateway1"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
name = "hub-vpn-gateway1"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
type = "Vpn"
vpn_type = "RouteBased"
type = "Vpn"
vpn_type = "RouteBased"
active_active = false
enable_bgp = false
sku = "VpnGw1"
active_active = false
enable_bgp = false
sku = "VpnGw1"
ip_configuration {
ip_configuration {
name = "vnetGatewayConfig"
public_ip_address_id = azurerm_public_ip.hub-vpn-gateway1-pip.id
private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.hub-gateway-subnet.id
}
depends_on = [azurerm_public_ip.hub-vpn-gateway1-pip]
}
depends_on = [azurerm_public_ip.hub-vpn-gateway1-pip]
}
resource "azurerm_virtual_network_gateway_connection" "hub-onprem-conn" {
name = "hub-onprem-conn"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
name = "hub-onprem-conn"
location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name
type = "Vnet2Vnet"
routing_weight = 1
type = "Vnet2Vnet"
routing_weight = 1
virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-gateway.id
peer_virtual_network_gateway_id = azurerm_virtual_network_gateway.onprem-vpn-gateway.id
virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-gateway.id
peer_virtual_network_gateway_id = azurerm_virtual_network_gateway.onprem-vpn-gateway.id
shared_key = local.shared-key
shared_key = local.shared-key
}
resource "azurerm_virtual_network_gateway_connection" "onprem-hub-conn" {
name = "onprem-hub-conn"
location = azurerm_resource_group.onprem-vnet-rg.location
resource_group_name = azurerm_resource_group.onprem-vnet-rg.name
type = "Vnet2Vnet"
routing_weight = 1
virtual_network_gateway_id = azurerm_virtual_network_gateway.onprem-vpn-gateway.id
peer_virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-gateway.id
name = "onprem-hub-conn"
location = azurerm_resource_group.onprem-vnet-rg.location
resource_group_name = azurerm_resource_group.onprem-vnet-rg.name
type = "Vnet2Vnet"
routing_weight = 1
virtual_network_gateway_id = azurerm_virtual_network_gateway.onprem-vpn-gateway.id
peer_virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-gateway.id
shared_key = local.shared-key
shared_key = local.shared-key
}

Some files were not shown because too many files have changed in this diff Show More