forked from krishcool/test1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main1.tf
66 lines (56 loc) · 1.86 KB
/
main1.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
provider "azuread" {
version = "=0.7.0"
}
provider "random" {
version = "=2.2.1"
}
provider "null" {
version = "=2.1.2"
}
resource "azurerm_resource_group" "network" {
name = "${var.resource_name_prefix}-network-rgroup"
location = var.location
}
resource "azurerm_virtual_network" "network" {
name = "${var.resource_name_prefix}-network"
location = var.location
resource_group_name = azurerm_resource_group.network.name
address_space = ["10.137.0.0/16"]
}
resource "azurerm_subnet" "subnet" {
name = "${var.resource_name_prefix}-subnet"
virtual_network_name = azurerm_virtual_network.network.name
resource_group_name = azurerm_resource_group.network.name
address_prefix = "10.137.1.0/24"
service_endpoints = ["Microsoft.KeyVault"]
lifecycle {
ignore_changes = [
network_security_group_id,
route_table_id
]
}
}
resource "azurerm_resource_group" "storage" {
name = "${var.resource_name_prefix}-storage-rgroup"
location = var.location
}
resource "azurerm_storage_account" "storage" {
name = "${var.resource_name_prefix}storage"
resource_group_name = azurerm_resource_group.storage.name
location = var.location
account_tier = "Standard"
account_replication_type = "LRS"
enable_https_traffic_only = true
}
resource "azurerm_storage_container" "storage" {
name = "${var.resource_name_prefix}container"
storage_account_name = azurerm_storage_account.storage.name
container_access_type = "private"
}
resource "azurerm_storage_blob" "a_file" {
name = "hello.txt"
storage_account_name = azurerm_storage_account.storage.name
storage_container_name = azurerm_storage_container.storage.name
type = "Block"
source_content = "Hello, Blob!"
}