-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
66 lines (57 loc) · 1.99 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.113.0"
}
}
required_version = ">= 1.1.0"
}
provider "azurerm" {
features {}
}
resource "azurerm_virtual_network" "dev-playground-net" {
name = "dev-playground-net"
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.dev-playground-rg.location
resource_group_name = azurerm_resource_group.dev-playground-rg.name
tags = {
env = "dev"
}
}
resource "azurerm_subnet" "dev-playground-subnet" {
name = "dev-playground-subnet"
resource_group_name = azurerm_resource_group.dev-playground-rg.name
virtual_network_name = azurerm_virtual_network.dev-playground-net.name
address_prefixes = ["10.0.2.0/24"]
}
resource "azurerm_network_security_group" "dev-playground-net-sg" {
name = "dev-playground-net-sg"
location = azurerm_resource_group.dev-playground-rg.location
resource_group_name = azurerm_resource_group.dev-playground-rg.name
tags = {
env = "dev"
}
}
resource "azurerm_network_security_rule" "dev-playground-net-sr" {
name = "dev-playground-net-sr"
priority = 100
direction = "Inbound"
access = "Allow"
protocol = "*"
source_port_range = "*"
destination_port_range = "*"
source_address_prefix = "*"
destination_address_prefix = "*"
resource_group_name = azurerm_resource_group.dev-playground-rg.name
network_security_group_name = azurerm_network_security_group.dev-playground-net-sg.name
}
data "azurerm_subscription" "playground" {}
resource "azurerm_role_definition" "dev-playground-role-devops" {
name = "dev-playground-role-devops"
scope = data.azurerm_subscription.playground.id
description = "DevOps Engineer for DEV Environment"
permissions {
actions = ["Microsoft.AlertsManagement/alerts/read"]
}
}