mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-24 22:49:20 -04:00
e2e: dynamically create rg resource group for minicon (#2793)
This commit is contained in:
parent
8730e72319
commit
26a9639bcf
1 changed files with 14 additions and 13 deletions
|
@ -46,36 +46,37 @@ data "cloudinit_config" "cloud_init" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data "azurerm_resource_group" "main" {
|
resource "azurerm_resource_group" "main" {
|
||||||
name = "e2e-miniconstellation"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
|
location = "North Europe"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_virtual_network" "main" {
|
resource "azurerm_virtual_network" "main" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
address_space = ["10.0.0.0/16"]
|
address_space = ["10.0.0.0/16"]
|
||||||
location = data.azurerm_resource_group.main.location
|
location = azurerm_resource_group.main.location
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_subnet" "main" {
|
resource "azurerm_subnet" "main" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
virtual_network_name = azurerm_virtual_network.main.name
|
virtual_network_name = azurerm_virtual_network.main.name
|
||||||
address_prefixes = ["10.0.2.0/24"]
|
address_prefixes = ["10.0.2.0/24"]
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_public_ip" "main" {
|
resource "azurerm_public_ip" "main" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
location = data.azurerm_resource_group.main.location
|
location = azurerm_resource_group.main.location
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
allocation_method = "Static"
|
allocation_method = "Static"
|
||||||
sku = "Standard"
|
sku = "Standard"
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "azurerm_network_interface" "main" {
|
resource "azurerm_network_interface" "main" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
location = data.azurerm_resource_group.main.location
|
location = azurerm_resource_group.main.location
|
||||||
|
|
||||||
ip_configuration {
|
ip_configuration {
|
||||||
name = "main"
|
name = "main"
|
||||||
|
@ -87,8 +88,8 @@ resource "azurerm_network_interface" "main" {
|
||||||
|
|
||||||
resource "azurerm_network_security_group" "ssh" {
|
resource "azurerm_network_security_group" "ssh" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
location = data.azurerm_resource_group.main.location
|
location = azurerm_resource_group.main.location
|
||||||
|
|
||||||
security_rule {
|
security_rule {
|
||||||
name = "ssh"
|
name = "ssh"
|
||||||
|
@ -110,8 +111,8 @@ resource "azurerm_subnet_network_security_group_association" "ssh" {
|
||||||
|
|
||||||
resource "azurerm_linux_virtual_machine" "main" {
|
resource "azurerm_linux_virtual_machine" "main" {
|
||||||
name = "e2e-mini-${random_string.suffix.result}"
|
name = "e2e-mini-${random_string.suffix.result}"
|
||||||
resource_group_name = data.azurerm_resource_group.main.name
|
resource_group_name = azurerm_resource_group.main.name
|
||||||
location = data.azurerm_resource_group.main.location
|
location = azurerm_resource_group.main.location
|
||||||
|
|
||||||
# Standard_D8s_v5 provides nested virtualization support
|
# Standard_D8s_v5 provides nested virtualization support
|
||||||
size = "Standard_D8s_v5"
|
size = "Standard_D8s_v5"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue