Compare commits

..

5 Commits

Author SHA1 Message Date
zjhe 77bc7ba583 fix deprecated argument 2024-09-30 11:03:15 +08:00
zjhe 0525962b23 fix deprecated argument 2024-09-30 10:23:57 +08:00
zjhe 76860e34e8 bump azurerm provider version 2024-09-30 10:13:33 +08:00
zjhe b37f4e175a try to fix test 2024-09-30 10:05:06 +08:00
zjhe 69412cc3c0 bump azurerm provider version for prequisite 2024-09-30 09:23:45 +08:00
106 changed files with 384 additions and 2044 deletions
@@ -1,20 +1,3 @@
## 29 Sep 24 03:04 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
-18
View File
@@ -1,21 +1,3 @@
## 29 Sep 24 05:10 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 02:51 UTC ## 29 Sep 24 02:51 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05: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 02:51 UTC ## 29 Sep 24 02:51 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05: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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05:01 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 02:51 UTC ## 29 Sep 24 02:51 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05:00 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 02:51 UTC ## 29 Sep 24 02:51 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 04:49 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/random v3.6.3
+ provider registry.terraform.io/hashicorp/tls v4.0.4
### Error
---
## 29 Sep 24 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
+1 -10
View File
@@ -21,7 +21,7 @@ resource "tls_private_key" "signing_cert" {
resource "tls_self_signed_cert" "attestation" { resource "tls_self_signed_cert" "attestation" {
count = local.create_signing_cert ? 1 : 0 count = local.create_signing_cert ? 1 : 0
private_key_pem = tls_private_key.signing_cert[0].private_key_pem private_key_pem = tls_private_key.signing_cert[0].private_key_pem
validity_period_hours = 12 validity_period_hours = 12
allowed_uses = [ allowed_uses = [
"cert_signing", "cert_signing",
@@ -40,13 +40,4 @@ resource "azurerm_attestation_provider" "corp_attestation" {
name = "${var.attestation_provider_name}${random_string.attestation_suffix.result}" name = "${var.attestation_provider_name}${random_string.attestation_suffix.result}"
resource_group_name = azurerm_resource_group.rg.name resource_group_name = azurerm_resource_group.rg.name
policy_signing_certificate_data = try(tls_self_signed_cert.attestation[0].cert_pem, file(var.cert_path)) policy_signing_certificate_data = try(tls_self_signed_cert.attestation[0].cert_pem, file(var.cert_path))
#https://github.com/hashicorp/terraform-provider-azurerm/issues/21998#issuecomment-1573312297
lifecycle {
ignore_changes = [
"open_enclave_policy_base64",
"sev_snp_policy_base64",
"sgx_enclave_policy_base64",
"tpm_policy_base64",
]
}
} }
@@ -4,7 +4,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~>3.0" version = "~>2.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"
@@ -1,21 +1,3 @@
## 29 Sep 24 04:48 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 v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -8,7 +8,7 @@ terraform {
} }
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~>3.0" version = "~>2.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"
@@ -1,21 +1,3 @@
## 29 Sep 24 04:48 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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:48 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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05: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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05:50 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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 04:27 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.1
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 04:28 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azuread v3.0.1
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:50 UTC ## 29 Sep 24 02:50 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:28 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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:27 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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 05: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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 06:08 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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 06: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 06: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 02:49 UTC ## 29 Sep 24 02:49 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 06: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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:51 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 24 03:48 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/random v3.6.3
### Error
---
## 29 Sep 24 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
+1 -1
View File
@@ -3,7 +3,7 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~>3.0" version = "~>2.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 24 03:48 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:21 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:48 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:50 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:50 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 02:48 UTC ## 29 Sep 24 02:48 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:46 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:27 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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.3
### Error
---
## 29 Sep 24 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:35 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:37 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 24 03:34 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:29 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:28 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 02:47 UTC ## 29 Sep 24 02:47 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:04 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
-18
View File
@@ -1,21 +1,3 @@
## 29 Sep 24 04:48 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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:38 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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:40 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v4.3.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:38 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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:29 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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:25 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 v2.99.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -8,7 +8,7 @@ terraform {
} }
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~>3.0" version = "~>2.0"
} }
random = { random = {
source = "hashicorp/random" source = "hashicorp/random"
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:26 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 02:46 UTC ## 29 Sep 24 02:46 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:26 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:25 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:25 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
-18
View File
@@ -1,21 +1,3 @@
## 29 Sep 24 03:24 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:25 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:23 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:42 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:07 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,18 +1,3 @@
## 29 Sep 24 03:11 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
### Error
---
## 29 Sep 24 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: true Success: true
@@ -1,20 +1,3 @@
## 29 Sep 24 03:13 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:09 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 02:45 UTC ## 29 Sep 24 02:45 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:13 UTC
Success: true
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v4.3.0
+ provider registry.terraform.io/hashicorp/random v3.6.3
### Error
---
## 29 Sep 24 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:24 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,22 +1,3 @@
## 29 Sep 24 03:12 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:02 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:07 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03: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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,21 +1,3 @@
## 29 Sep 24 03:10 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:02 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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,22 +1,3 @@
## 29 Sep 24 03: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/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 02:44 UTC ## 29 Sep 24 02:44 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04:53 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
-17
View File
@@ -1,20 +1,3 @@
## 29 Sep 24 04:49 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/random v3.6.3
### Error
---
## 29 Sep 24 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 04: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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:15 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
@@ -1,29 +1,3 @@
## 29 Sep 24 03:10 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
@@ -1,20 +1,3 @@
## 29 Sep 24 03:10 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 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
-16
View File
@@ -1,19 +1,3 @@
## 29 Sep 24 03:10 UTC
Success: false
### Versions
Terraform v1.9.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/azurerm v2.99.0
### Error
---
## 29 Sep 24 02:43 UTC ## 29 Sep 24 02:43 UTC
Success: false Success: false
+89 -95
View File
@@ -1,205 +1,199 @@
locals { locals {
prefix-hub-nva = "hub-nva" prefix-hub-nva = "hub-nva"
hub-nva-location = "eastus" hub-nva-location = "eastus"
hub-nva-resource-group = "hub-nva-rg" hub-nva-resource-group = "hub-nva-rg"
}
resource "random_string" "suffix" {
length = 5
special = false
upper = false
} }
resource "azurerm_resource_group" "hub-nva-rg" { resource "azurerm_resource_group" "hub-nva-rg" {
name = "${local.prefix-hub-nva}-rg-${random_string.suffix.result}" name = "${local.prefix-hub-nva}-rg"
location = local.hub-nva-location location = local.hub-nva-location
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_network_interface" "hub-nva-nic" { resource "azurerm_network_interface" "hub-nva-nic" {
name = "${local.prefix-hub-nva}-nic" name = "${local.prefix-hub-nva}-nic"
location = azurerm_resource_group.hub-nva-rg.location location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name resource_group_name = azurerm_resource_group.hub-nva-rg.name
enable_ip_forwarding = true enable_ip_forwarding = true
ip_configuration { ip_configuration {
name = local.prefix-hub-nva name = local.prefix-hub-nva
subnet_id = azurerm_subnet.hub-dmz.id subnet_id = azurerm_subnet.hub-dmz.id
private_ip_address_allocation = "Static" private_ip_address_allocation = "Static"
private_ip_address = "10.0.0.36" private_ip_address = "10.0.0.36"
} }
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_virtual_machine" "hub-nva-vm" { resource "azurerm_virtual_machine" "hub-nva-vm" {
name = "${local.prefix-hub-nva}-vm" name = "${local.prefix-hub-nva}-vm"
location = azurerm_resource_group.hub-nva-rg.location location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name resource_group_name = azurerm_resource_group.hub-nva-rg.name
network_interface_ids = [azurerm_network_interface.hub-nva-nic.id] network_interface_ids = [azurerm_network_interface.hub-nva-nic.id]
vm_size = var.vmsize vm_size = var.vmsize
storage_image_reference { storage_image_reference {
publisher = "Canonical" publisher = "Canonical"
offer = "UbuntuServer" offer = "UbuntuServer"
sku = "16.04-LTS" sku = "16.04-LTS"
version = "latest" version = "latest"
} }
storage_os_disk { storage_os_disk {
name = "myosdisk1" name = "myosdisk1"
caching = "ReadWrite" caching = "ReadWrite"
create_option = "FromImage" create_option = "FromImage"
managed_disk_type = "Standard_LRS" managed_disk_type = "Standard_LRS"
} }
os_profile { os_profile {
computer_name = "${local.prefix-hub-nva}-vm" computer_name = "${local.prefix-hub-nva}-vm"
admin_username = var.username admin_username = var.username
admin_password = local.password admin_password = var.password
} }
os_profile_linux_config { os_profile_linux_config {
disable_password_authentication = false disable_password_authentication = false
} }
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_virtual_machine_extension" "enable-routes" { resource "azurerm_virtual_machine_extension" "enable-routes" {
name = "enable-iptables-routes" name = "enable-iptables-routes"
virtual_machine_id = azurerm_virtual_machine.hub-nva-vm.id virtual_machine_id = azurerm_virtual_machine.hub-nva-vm.id
publisher = "Microsoft.Azure.Extensions" publisher = "Microsoft.Azure.Extensions"
type = "CustomScript" type = "CustomScript"
type_handler_version = "2.0" type_handler_version = "2.0"
settings = <<SETTINGS settings = <<SETTINGS
{ {
"fileUris": [ "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" "commandToExecute": "bash enable-ip-forwarding.sh"
} }
SETTINGS SETTINGS
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_route_table" "hub-gateway-rt" { resource "azurerm_route_table" "hub-gateway-rt" {
name = "hub-gateway-rt" name = "hub-gateway-rt"
location = azurerm_resource_group.hub-nva-rg.location location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false disable_bgp_route_propagation = false
route { route {
name = "toHub" name = "toHub"
address_prefix = "10.0.0.0/16" address_prefix = "10.0.0.0/16"
next_hop_type = "VnetLocal" next_hop_type = "VnetLocal"
} }
route { route {
name = "toSpoke1" name = "toSpoke1"
address_prefix = "10.1.0.0/16" address_prefix = "10.1.0.0/16"
next_hop_type = "VirtualAppliance" next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36" next_hop_in_ip_address = "10.0.0.36"
} }
route { route {
name = "toSpoke2" name = "toSpoke2"
address_prefix = "10.2.0.0/16" address_prefix = "10.2.0.0/16"
next_hop_type = "VirtualAppliance" next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36" next_hop_in_ip_address = "10.0.0.36"
} }
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_subnet_route_table_association" "hub-gateway-rt-hub-vnet-gateway-subnet" { resource "azurerm_subnet_route_table_association" "hub-gateway-rt-hub-vnet-gateway-subnet" {
subnet_id = azurerm_subnet.hub-gateway-subnet.id subnet_id = azurerm_subnet.hub-gateway-subnet.id
route_table_id = azurerm_route_table.hub-gateway-rt.id route_table_id = azurerm_route_table.hub-gateway-rt.id
depends_on = [azurerm_subnet.hub-gateway-subnet] depends_on = [azurerm_subnet.hub-gateway-subnet]
} }
resource "azurerm_route_table" "spoke1-rt" { resource "azurerm_route_table" "spoke1-rt" {
name = "spoke1-rt" name = "spoke1-rt"
location = azurerm_resource_group.hub-nva-rg.location location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false disable_bgp_route_propagation = false
route { route {
name = "toSpoke2" name = "toSpoke2"
address_prefix = "10.2.0.0/16" address_prefix = "10.2.0.0/16"
next_hop_type = "VirtualAppliance" next_hop_type = "VirtualAppliance"
next_hop_in_ip_address = "10.0.0.36" next_hop_in_ip_address = "10.0.0.36"
} }
route { route {
name = "default" name = "default"
address_prefix = "0.0.0.0/0" address_prefix = "0.0.0.0/0"
next_hop_type = "VnetLocal" next_hop_type = "vnetlocal"
} }
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-mgmt" { resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-mgmt" {
subnet_id = azurerm_subnet.spoke1-mgmt.id subnet_id = azurerm_subnet.spoke1-mgmt.id
route_table_id = azurerm_route_table.spoke1-rt.id route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-mgmt] depends_on = [azurerm_subnet.spoke1-mgmt]
} }
resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-workload" { resource "azurerm_subnet_route_table_association" "spoke1-rt-spoke1-vnet-workload" {
subnet_id = azurerm_subnet.spoke1-workload.id subnet_id = azurerm_subnet.spoke1-workload.id
route_table_id = azurerm_route_table.spoke1-rt.id route_table_id = azurerm_route_table.spoke1-rt.id
depends_on = [azurerm_subnet.spoke1-workload] depends_on = [azurerm_subnet.spoke1-workload]
} }
resource "azurerm_route_table" "spoke2-rt" { resource "azurerm_route_table" "spoke2-rt" {
name = "spoke2-rt" name = "spoke2-rt"
location = azurerm_resource_group.hub-nva-rg.location location = azurerm_resource_group.hub-nva-rg.location
resource_group_name = azurerm_resource_group.hub-nva-rg.name resource_group_name = azurerm_resource_group.hub-nva-rg.name
disable_bgp_route_propagation = false disable_bgp_route_propagation = false
route { route {
name = "toSpoke1" name = "toSpoke1"
address_prefix = "10.1.0.0/16" address_prefix = "10.1.0.0/16"
next_hop_in_ip_address = "10.0.0.36" next_hop_in_ip_address = "10.0.0.36"
next_hop_type = "VirtualAppliance" next_hop_type = "VirtualAppliance"
} }
route { route {
name = "default" name = "default"
address_prefix = "0.0.0.0/0" address_prefix = "0.0.0.0/0"
next_hop_type = "VnetLocal" next_hop_type = "vnetlocal"
} }
tags = { tags = {
environment = local.prefix-hub-nva environment = local.prefix-hub-nva
} }
} }
resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-mgmt" { resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-mgmt" {
subnet_id = azurerm_subnet.spoke2-mgmt.id subnet_id = azurerm_subnet.spoke2-mgmt.id
route_table_id = azurerm_route_table.spoke2-rt.id route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-mgmt] depends_on = [azurerm_subnet.spoke2-mgmt]
} }
resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-workload" { resource "azurerm_subnet_route_table_association" "spoke2-rt-spoke2-vnet-workload" {
subnet_id = azurerm_subnet.spoke2-workload.id subnet_id = azurerm_subnet.spoke2-workload.id
route_table_id = azurerm_route_table.spoke2-rt.id route_table_id = azurerm_route_table.spoke2-rt.id
depends_on = [azurerm_subnet.spoke2-workload] depends_on = [azurerm_subnet.spoke2-workload]
} }
+79 -79
View File
@@ -1,153 +1,153 @@
locals { locals {
prefix-hub = "hub" prefix-hub = "hub"
hub-location = "eastus" hub-location = "eastus"
hub-resource-group = "hub-vnet-rg-${random_string.suffix.result}" hub-resource-group = "hub-vnet-rg"
shared-key = "4-v3ry-53cr37-1p53c-5h4r3d-k3y" shared-key = "4-v3ry-53cr37-1p53c-5h4r3d-k3y"
} }
resource "azurerm_resource_group" "hub-vnet-rg" { resource "azurerm_resource_group" "hub-vnet-rg" {
name = local.hub-resource-group name = local.hub-resource-group
location = local.hub-location location = local.hub-location
} }
resource "azurerm_virtual_network" "hub-vnet" { resource "azurerm_virtual_network" "hub-vnet" {
name = "${local.prefix-hub}-vnet" name = "${local.prefix-hub}-vnet"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
address_space = ["10.0.0.0/16"] address_space = ["10.0.0.0/16"]
tags = { tags = {
environment = "hub-spoke" environment = "hub-spoke"
} }
} }
resource "azurerm_subnet" "hub-gateway-subnet" { resource "azurerm_subnet" "hub-gateway-subnet" {
name = "GatewaySubnet" name = "GatewaySubnet"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.255.224/27"] address_prefixes = ["10.0.255.224/27"]
} }
resource "azurerm_subnet" "hub-mgmt" { resource "azurerm_subnet" "hub-mgmt" {
name = "mgmt" name = "mgmt"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.64/27"] address_prefixes = ["10.0.0.64/27"]
} }
resource "azurerm_subnet" "hub-dmz" { resource "azurerm_subnet" "hub-dmz" {
name = "dmz" name = "dmz"
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
virtual_network_name = azurerm_virtual_network.hub-vnet.name virtual_network_name = azurerm_virtual_network.hub-vnet.name
address_prefixes = ["10.0.0.32/27"] address_prefixes = ["10.0.0.32/27"]
} }
resource "azurerm_network_interface" "hub-nic" { resource "azurerm_network_interface" "hub-nic" {
name = "${local.prefix-hub}-nic" name = "${local.prefix-hub}-nic"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
enable_ip_forwarding = true enable_ip_forwarding = true
ip_configuration { ip_configuration {
name = local.prefix-hub name = local.prefix-hub
subnet_id = azurerm_subnet.hub-mgmt.id subnet_id = azurerm_subnet.hub-mgmt.id
private_ip_address_allocation = "Dynamic" private_ip_address_allocation = "Dynamic"
} }
tags = { tags = {
environment = local.prefix-hub environment = local.prefix-hub
} }
} }
#Virtual Machine #Virtual Machine
resource "azurerm_virtual_machine" "hub-vm" { resource "azurerm_virtual_machine" "hub-vm" {
name = "${local.prefix-hub}-vm" name = "${local.prefix-hub}-vm"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
network_interface_ids = [azurerm_network_interface.hub-nic.id] network_interface_ids = [azurerm_network_interface.hub-nic.id]
vm_size = var.vmsize vm_size = var.vmsize
storage_image_reference { storage_image_reference {
publisher = "Canonical" publisher = "Canonical"
offer = "UbuntuServer" offer = "UbuntuServer"
sku = "16.04-LTS" sku = "16.04-LTS"
version = "latest" version = "latest"
} }
storage_os_disk { storage_os_disk {
name = "myosdisk1" name = "myosdisk1"
caching = "ReadWrite" caching = "ReadWrite"
create_option = "FromImage" create_option = "FromImage"
managed_disk_type = "Standard_LRS" managed_disk_type = "Standard_LRS"
} }
os_profile { os_profile {
computer_name = "${local.prefix-hub}-vm" computer_name = "${local.prefix-hub}-vm"
admin_username = var.username admin_username = var.username
admin_password = local.password admin_password = var.password
} }
os_profile_linux_config { os_profile_linux_config {
disable_password_authentication = false disable_password_authentication = false
} }
tags = { tags = {
environment = local.prefix-hub environment = local.prefix-hub
} }
} }
# Virtual Network Gateway # Virtual Network Gateway
resource "azurerm_public_ip" "hub-vpn-gateway1-pip" { resource "azurerm_public_ip" "hub-vpn-gateway1-pip" {
name = "hub-vpn-gateway1-pip" name = "hub-vpn-gateway1-pip"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
allocation_method = "Dynamic" allocation_method = "Dynamic"
} }
resource "azurerm_virtual_network_gateway" "hub-vnet-gateway" { resource "azurerm_virtual_network_gateway" "hub-vnet-gateway" {
name = "hub-vpn-gateway1" name = "hub-vpn-gateway1"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
type = "Vpn" type = "Vpn"
vpn_type = "RouteBased" vpn_type = "RouteBased"
active_active = false active_active = false
enable_bgp = false enable_bgp = false
sku = "VpnGw1" sku = "VpnGw1"
ip_configuration { ip_configuration {
name = "vnetGatewayConfig" name = "vnetGatewayConfig"
public_ip_address_id = azurerm_public_ip.hub-vpn-gateway1-pip.id public_ip_address_id = azurerm_public_ip.hub-vpn-gateway1-pip.id
private_ip_address_allocation = "Dynamic" private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.hub-gateway-subnet.id 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" { resource "azurerm_virtual_network_gateway_connection" "hub-onprem-conn" {
name = "hub-onprem-conn" name = "hub-onprem-conn"
location = azurerm_resource_group.hub-vnet-rg.location location = azurerm_resource_group.hub-vnet-rg.location
resource_group_name = azurerm_resource_group.hub-vnet-rg.name resource_group_name = azurerm_resource_group.hub-vnet-rg.name
type = "Vnet2Vnet" type = "Vnet2Vnet"
routing_weight = 1 routing_weight = 1
virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-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 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" { resource "azurerm_virtual_network_gateway_connection" "onprem-hub-conn" {
name = "onprem-hub-conn" name = "onprem-hub-conn"
location = azurerm_resource_group.onprem-vnet-rg.location location = azurerm_resource_group.onprem-vnet-rg.location
resource_group_name = azurerm_resource_group.onprem-vnet-rg.name resource_group_name = azurerm_resource_group.onprem-vnet-rg.name
type = "Vnet2Vnet" type = "Vnet2Vnet"
routing_weight = 1 routing_weight = 1
virtual_network_gateway_id = azurerm_virtual_network_gateway.onprem-vpn-gateway.id 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 peer_virtual_network_gateway_id = azurerm_virtual_network_gateway.hub-vnet-gateway.id
shared_key = local.shared-key shared_key = local.shared-key
} }
+2 -15
View File
@@ -5,24 +5,11 @@ terraform {
required_providers { required_providers {
azurerm = { azurerm = {
source = "hashicorp/azurerm" source = "hashicorp/azurerm"
version = "~> 3.0" version = "~>2.0"
} }
} }
} }
provider "azurerm" { provider "azurerm" {
features { features {}
resource_group {
prevent_deletion_if_contains_resources = false
}
}
} }
resource "random_password" "password" {
count = var.password == null ? 1 : 0
length = 20
}
locals {
password = try(random_password.password[0].result, var.password)
}

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