Skip to content

Commit b44b68e

Browse files
authored
Create .tflint.hcl (#39)
* Create .tflint.hcl * Update ci.yml * Update main.tf * Update ci.yml * Update ci.yml * Update main.tf * Update ci.yml * Update ci.yml * Update main.tf * Update .tflint.hcl * Update ci.yml * Update .tflint.hcl * Update ci.yml * Update .tflint.hcl * Update outputs.tf * Update outputs.tf * Update outputs.tf * Update outputs.tf * Update outputs.tf * Update outputs.tf * Update outputs.tf * Create outputs.tf * Update variables.tf * Update variables.tf * Update variables.tf * Update variables.tf
1 parent 52d4328 commit b44b68e

File tree

9 files changed

+88
-13
lines changed

9 files changed

+88
-13
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ jobs:
3434
- name: Terraform Validate
3535
run: terraform validate
3636

37+
- name: Setup TFLint
38+
uses: terraform-linters/[email protected]
39+
40+
- name: Run TFLint
41+
run: |
42+
tflint --init
43+
tflint --format compact
44+
3745
- name: Pull Checkov image
3846
run: docker pull bridgecrew/checkov:latest
3947

.tflint.hcl

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
config {
2+
module = true
3+
}
4+
5+
plugin "azurerm" {
6+
enabled = true
7+
version = "0.17.0"
8+
source = "github.com/terraform-linters/tflint-ruleset-azurerm"
9+
}
10+
11+
rule "terraform_comment_syntax" {
12+
enabled = true
13+
}
14+
15+
rule "terraform_deprecated_index" {
16+
enabled = true
17+
}
18+
19+
rule "terraform_documented_outputs" {
20+
enabled = true
21+
}
22+
23+
rule "terraform_documented_variables" {
24+
enabled = true
25+
}
26+
27+
rule "terraform_empty_list_equality" {
28+
enabled = true
29+
}
30+
31+
rule "terraform_naming_convention" {
32+
enabled = true
33+
}
34+
35+
rule "terraform_required_providers" {
36+
enabled = true
37+
}
38+
39+
rule "terraform_required_version" {
40+
enabled = true
41+
}
42+
43+
rule "terraform_standard_module_structure" {
44+
enabled = true
45+
}
46+
47+
rule "terraform_typed_variables" {
48+
enabled = true
49+
}
50+
51+
rule "terraform_unused_declarations" {
52+
enabled = true
53+
}
54+
55+
rule "terraform_unused_required_providers" {
56+
enabled = true
57+
}

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ module "pip_ubuntu" {
4848
module "nic_ubuntu" {
4949
source = "./modules/network_interface/"
5050

51-
name = "nic-ubuntu"
52-
location = module.vnet.location
53-
resource_group_name = module.snet.resource_group_name
51+
name = "nic-ubuntu"
52+
location = module.vnet.location
53+
resource_group_name = module.snet.resource_group_name
5454

5555
ip_configuration_name = "ipconfig"
5656
ip_configuration_subnet_id = module.snet.id
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "id" {
2-
value = azurerm_linux_virtual_machine.this.id
2+
description = "The ID of the virtual machine"
3+
value = azurerm_linux_virtual_machine.this.id
34
}

modules/managed_disk/outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "id" {
2-
value = azurerm_managed_disk.this.id
2+
description = "The ID of the managed disk"
3+
value = azurerm_managed_disk.this.id
34
}

modules/network_interface/outputs.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
output "id" {
2-
value = azurerm_network_interface.this.id
2+
description = "The ID of the network interface"
3+
value = azurerm_network_interface.this.id
34
}
45

56
output "resource_group_name" {
6-
value = azurerm_network_interface.this.resource_group_name
7+
description = "The resource group where the network interface exists"
8+
value = azurerm_network_interface.this.resource_group_name
79
}
810

911
output "location" {
10-
value = azurerm_network_interface.this.location
12+
description = "The location where the network interface exists"
13+
value = azurerm_network_interface.this.location
1114
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "id" {
2-
value = azurerm_network_security_group.this.id
2+
description = "The ID of the network security group"
3+
value = azurerm_network_security_group.this.id
34
}

modules/public_ip/outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
output "id" {
2-
value = azurerm_public_ip.this.id
2+
description = "The ID of the public IP"
3+
value = azurerm_public_ip.this.id
34
}

modules/virtual_network/outputs.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
output "name" {
2-
value = azurerm_virtual_network.this.name
2+
description = "The name of the virtual network"
3+
value = azurerm_virtual_network.this.name
34
}
45

56
output "resource_group_name" {
6-
value = azurerm_virtual_network.this.resource_group_name
7+
description = "The resource group where the virtual network exists"
8+
value = azurerm_virtual_network.this.resource_group_name
79
}
810

911
output "location" {
10-
value = azurerm_virtual_network.this.location
12+
description = "The location where the virtual network exists"
13+
value = azurerm_virtual_network.this.location
1114
}

0 commit comments

Comments
 (0)