-
Notifications
You must be signed in to change notification settings - Fork 0
/
Terraform-Test-2.tf
48 lines (41 loc) · 1.14 KB
/
Terraform-Test-2.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.41.0"
}
}
}
provider "azurerm" {
features {
}
}
resource "azurerm_resource_group" "example" {
name = "stephyen-resg1"
location = "eastus"
}
resource "azurerm_network_security_group" "example" {
name = "example-security-group"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
}
resource "azurerm_virtual_network" "example" {
name = "example-network"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
address_space = ["10.0.0.0/16"]
subnet {
name = "subnet1"
address_prefix = "10.0.1.0/24"
}
subnet {
name = "subnet2"
address_prefix = "10.0.2.0/24"
security_group = azurerm_network_security_group.example.id
}
subnet {
name = "subnet3"
address_prefix = "10.0.3.0/24"
security_group = azurerm_network_security_group.example.id
}
}