Skip to content

Commit b27827f

Browse files
committed
Lint
1 parent 705b0ce commit b27827f

File tree

3 files changed

+34
-37
lines changed

3 files changed

+34
-37
lines changed

input.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ variable "storage_account_name" {
1414
}
1515

1616
variable "create_vm" {
17-
type = bool
17+
type = bool
1818
default = false
1919
}
2020

2121
variable "vm_size" {
22-
type = string
22+
type = string
2323
default = "Standard_B2s"
2424
}
2525

2626
variable "vm_username" {
27-
type = string
27+
type = string
2828
default = "azureblob"
2929
}
3030

3131
variable "vm_password" {
32-
type = string
32+
type = string
3333
default = "qwe123QWE!@#"
3434
}
3535

3636
variable "create_app_service" {
37-
type = bool
37+
type = bool
3838
default = false
3939
}
4040

4141
variable "ssh_key" {
42-
type = string
42+
type = string
4343
default = ""
4444
}

main.tf

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ resource "azurerm_storage_container" "public" {
4747
container_access_type = "blob"
4848
}
4949

50-
5150
resource "azurerm_virtual_network" "main" {
52-
count = var.create_vm ? 1 : 0
51+
count = var.create_vm ? 1 : 0
5352
name = "${var.prefix}-network"
5453
address_space = ["10.0.0.0/16"]
5554
location = azurerm_resource_group.main.location
@@ -61,15 +60,15 @@ resource "azurerm_virtual_network" "main" {
6160
}
6261

6362
resource "azurerm_subnet" "main" {
64-
count = var.create_vm ? 1 : 0
63+
count = var.create_vm ? 1 : 0
6564
name = "${var.prefix}-main"
6665
resource_group_name = azurerm_resource_group.main.name
6766
virtual_network_name = azurerm_virtual_network.main[0].name
6867
address_prefixes = ["10.0.2.0/24"]
6968
}
7069

7170
resource "azurerm_network_interface" "main" {
72-
count = var.create_vm ? 1 : 0
71+
count = var.create_vm ? 1 : 0
7372
name = "${var.prefix}-nic"
7473
location = azurerm_resource_group.main.location
7574
resource_group_name = azurerm_resource_group.main.name
@@ -78,7 +77,7 @@ resource "azurerm_network_interface" "main" {
7877
name = "${var.prefix}-ip-config"
7978
subnet_id = azurerm_subnet.main[0].id
8079
private_ip_address_allocation = "Dynamic"
81-
public_ip_address_id = azurerm_public_ip.main[0].id
80+
public_ip_address_id = azurerm_public_ip.main[0].id
8281
}
8382

8483
tags = {
@@ -87,7 +86,7 @@ resource "azurerm_network_interface" "main" {
8786
}
8887

8988
resource "azurerm_public_ip" "main" {
90-
count = var.create_vm ? 1 : 0
89+
count = var.create_vm ? 1 : 0
9190
name = "${var.prefix}-public-ip"
9291
resource_group_name = azurerm_resource_group.main.name
9392
location = azurerm_resource_group.main.location
@@ -99,9 +98,9 @@ resource "azurerm_public_ip" "main" {
9998
}
10099

101100
resource "azurerm_user_assigned_identity" "vm" {
102-
location = azurerm_resource_group.main.location
103-
name = "${var.prefix}-vm"
104-
resource_group_name = azurerm_resource_group.main.name
101+
location = azurerm_resource_group.main.location
102+
name = "${var.prefix}-vm"
103+
resource_group_name = azurerm_resource_group.main.name
105104
}
106105

107106

@@ -112,24 +111,24 @@ resource "azurerm_role_assignment" "vm" {
112111
}
113112

114113
resource "azurerm_linux_virtual_machine" "main" {
115-
count = var.create_vm ? 1 : 0
116-
name = "${var.prefix}-vm"
117-
computer_name = var.prefix
118-
resource_group_name = azurerm_resource_group.main.name
119-
location = azurerm_resource_group.main.location
120-
size = var.vm_size
121-
admin_username = var.vm_username
122-
admin_password = var.vm_password
114+
count = var.create_vm ? 1 : 0
115+
name = "${var.prefix}-vm"
116+
computer_name = var.prefix
117+
resource_group_name = azurerm_resource_group.main.name
118+
location = azurerm_resource_group.main.location
119+
size = var.vm_size
120+
admin_username = var.vm_username
121+
admin_password = var.vm_password
123122
disable_password_authentication = true
124-
network_interface_ids = [azurerm_network_interface.main[0].id]
123+
network_interface_ids = [azurerm_network_interface.main[0].id]
125124

126125
identity {
127-
type = "UserAssigned"
126+
type = "UserAssigned"
128127
identity_ids = [azurerm_user_assigned_identity.vm.id]
129128
}
130129

131130
admin_ssh_key {
132-
username = var.vm_username
131+
username = var.vm_username
133132
public_key = local.public_ssh_key
134133
}
135134

@@ -150,26 +149,24 @@ resource "azurerm_linux_virtual_machine" "main" {
150149
}
151150
}
152151

153-
154152
resource "azurerm_service_plan" "main" {
155-
count = var.create_app_service ? 1 : 0
153+
count = var.create_app_service ? 1 : 0
156154
name = "${var.prefix}-appserviceplan"
157155
resource_group_name = azurerm_resource_group.main.name
158156
location = azurerm_resource_group.main.location
159157
os_type = "Linux"
160158
sku_name = "B1"
161159
}
162160

163-
164161
resource "azurerm_linux_web_app" "main" {
165-
count = var.create_app_service ? 1 : 0
162+
count = var.create_app_service ? 1 : 0
166163
name = "${var.prefix}-app"
167164
service_plan_id = azurerm_service_plan.main[0].id
168165
resource_group_name = azurerm_resource_group.main.name
169166
location = azurerm_resource_group.main.location
170167

171168
identity {
172-
type = "UserAssigned"
169+
type = "UserAssigned"
173170
identity_ids = [azurerm_user_assigned_identity.vm.id]
174171
}
175172

@@ -181,10 +178,10 @@ resource "azurerm_linux_web_app" "main" {
181178
}
182179

183180
resource "azurerm_app_service_source_control" "main" {
184-
count = var.create_app_service ? 1 : 0
185-
app_id = azurerm_linux_web_app.main[0].id
186-
repo_url = "https://github.com/Azure-Samples/nodejs-docs-hello-world"
187-
branch = "master"
181+
count = var.create_app_service ? 1 : 0
182+
app_id = azurerm_linux_web_app.main[0].id
183+
repo_url = "https://github.com/Azure-Samples/nodejs-docs-hello-world"
184+
branch = "master"
188185
use_manual_integration = true
189-
use_mercurial = false
186+
use_mercurial = false
190187
}

output.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
output "devenv_local_nix" {
22
sensitive = true
3-
value = <<EOT
3+
value = <<EOT
44
{pkgs, lib, ...}:{
55
env = {
66
AZURE_ACCOUNT_NAME = "${azurerm_storage_account.main.name}";

0 commit comments

Comments
 (0)