Skip to content

Commit 9d3d4cd

Browse files
JoshLuedemanCopilot
andcommitted
fix: update CI workflow and format terraform code
- TFLint: use --minimum-failure-severity=error (warnings don't fail CI) - Run terraform fmt -recursive for canonical formatting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e65f73b commit 9d3d4cd

9 files changed

Lines changed: 40 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
GITHUB_TOKEN: ${{ github.token }}
6363

6464
- name: Run TFLint
65-
run: tflint --recursive --format compact
65+
run: tflint --recursive --format compact --minimum-failure-severity=error
6666

6767
terraform-plan:
6868
name: "📋 Plan (Validation)"

infrastructure/terraform/03-modules.workload.spoke.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ module "mod_workload_spoke" {
1616
subscription_id_workload = data.azurerm_client_config.current.subscription_id #var.subscription_id_workload_dev Change this to the subscription ID of the workload subscription
1717

1818
# Hub Configuration
19-
hub_virtual_network_id = module.mod_landing_zone.hub_virtual_network_id
20-
firewall_private_ip = module.mod_landing_zone.firewall_private_ip
21-
hub_storage_account_id = module.mod_landing_zone.hub_storage_account_id
19+
hub_virtual_network_id = module.mod_landing_zone.hub_virtual_network_id
20+
firewall_private_ip = module.mod_landing_zone.firewall_private_ip
21+
hub_storage_account_id = module.mod_landing_zone.hub_storage_account_id
2222
hub_managmement_logging_log_analytics_id = module.mod_landing_zone.ops_logging_log_analytics_resource_id
23-
hub_managmement_logging_workspace_id = module.mod_landing_zone.ops_logging_log_analytics_workspace_id
23+
hub_managmement_logging_workspace_id = module.mod_landing_zone.ops_logging_log_analytics_workspace_id
2424

2525
# Resource Lock Configuration
2626
enable_resource_locks = var.enable_resource_locks

infrastructure/terraform/modules/01-remote-state/main.tf

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33

44
# Generate a random storage name
55
resource "random_string" "tf-name" {
6-
length = 8
7-
upper = false
8-
number = true
9-
lower = true
6+
length = 8
7+
upper = false
8+
number = true
9+
lower = true
1010
special = false
1111
}
1212

1313
# Create a Resource Group for the Terraform State File
1414
resource "azurerm_resource_group" "state-rg" {
15-
name = "${lower(var.org_name)}-network-artifacts-rg"
15+
name = "${lower(var.org_name)}-network-artifacts-rg"
1616
location = var.location
17-
17+
1818
lifecycle {
1919
prevent_destroy = true
2020
}
@@ -25,16 +25,16 @@ resource "azurerm_resource_group" "state-rg" {
2525

2626
# Create a Storage Account for the Terraform State File
2727
resource "azurerm_storage_account" "state-sta" {
28-
depends_on = [azurerm_resource_group.state-rg]
29-
name = "${lower(var.org_name)}tfmgtprod${random_string.tf-name.result}"
30-
resource_group_name = azurerm_resource_group.state-rg.name
31-
location = azurerm_resource_group.state-rg.location
32-
account_kind = "StorageV2"
33-
account_tier = "Standard"
34-
access_tier = "Hot"
35-
account_replication_type = "ZRS"
28+
depends_on = [azurerm_resource_group.state-rg]
29+
name = "${lower(var.org_name)}tfmgtprod${random_string.tf-name.result}"
30+
resource_group_name = azurerm_resource_group.state-rg.name
31+
location = azurerm_resource_group.state-rg.location
32+
account_kind = "StorageV2"
33+
account_tier = "Standard"
34+
access_tier = "Hot"
35+
account_replication_type = "ZRS"
3636
enable_https_traffic_only = true
37-
37+
3838
lifecycle {
3939
prevent_destroy = true
4040
}
@@ -44,7 +44,7 @@ resource "azurerm_storage_account" "state-sta" {
4444
}
4545
# Create a Storage Container for the Core State File
4646
resource "azurerm_storage_container" "core-container" {
47-
depends_on = [azurerm_storage_account.state-sta]
48-
name = "core-mgt-prod-tfstate"
47+
depends_on = [azurerm_storage_account.state-sta]
48+
name = "core-mgt-prod-tfstate"
4949
storage_account_name = azurerm_storage_account.state-sta.name
5050
}

infrastructure/terraform/modules/01-remote-state/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
# Organization name
55
variable "org_name" {
6-
type = string
6+
type = string
77
description = "mpe"
8-
default = "afmpe"
8+
default = "afmpe"
99
}
1010
# Environment
1111
variable "environment" {
12-
type = string
12+
type = string
1313
description = "This variable defines the environment to be built"
14-
default = "prod"
14+
default = "prod"
1515
}
1616
# Azure region
1717
variable "location" {
18-
type = string
18+
type = string
1919
description = "Azure region where resources will be created"
20-
default = "eastus"
20+
default = "eastus"
2121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
provider "azurerm" {
3-
features{}
3+
features {}
44
}

infrastructure/terraform/modules/03-workload_spoke/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ locals {
2020
workload_resources_tags = merge(
2121
var.disable_base_module_tags ? local.empty_map : local.base_module_tags,
2222
var.default_tags,
23-
)
23+
)
2424
}

infrastructure/terraform/modules/03-workload_spoke/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ AUTHOR/S: jrspinella
1414

1515
// Resources for the Operations Spoke
1616
module "mod_workload_network" {
17-
source = "azurenoops/overlays-workload-spoke/azurerm"
18-
version = ">= 2.0.0"
17+
source = "azurenoops/overlays-workload-spoke/azurerm"
18+
version = ">= 2.0.0"
1919

2020
# By default, this module will create a resource group, provide the name here
2121
# To use an existing resource group, specify the existing resource group name,
@@ -26,7 +26,7 @@ module "mod_workload_network" {
2626
org_name = var.org_name
2727
environment = var.environment
2828
workload_name = var.wl_name
29-
29+
3030
# Collect Spoke Virtual Network Parameters
3131
# Spoke network details to create peering and other setup
3232
hub_virtual_network_id = var.hub_virtual_network_id

infrastructure/terraform/modules/03-workload_spoke/versions.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
3-
terraform {
4-
# It is recommended to use remote state instead of local. Only use this if deploying the module only, and not from the root.
3+
terraform {
4+
# It is recommended to use remote state instead of local. Only use this if deploying the module only, and not from the root.
55
#backend "azurerm" {
6-
# resource_group_name = "" # Partial configuration, provided during "terraform init"
7-
# storage_account_name = "" # Partial configuration, provided during "terraform init"
8-
# container_name = "" # Partial configuration, provided during "terraform init"
9-
# key = "landing_zone"
6+
# resource_group_name = "" # Partial configuration, provided during "terraform init"
7+
# storage_account_name = "" # Partial configuration, provided during "terraform init"
8+
# container_name = "" # Partial configuration, provided during "terraform init"
9+
# key = "landing_zone"
1010
#}
1111
}
1212

infrastructure/terraform/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
backend "local" {}
44
# If you are using Azure Storage, You can update these values in order to configure your remote state. backend.conf is not required for local backend.
55
#backend "azurerm" {
6-
#key = "anoa"
6+
#key = "anoa"
77
#}
88
# If you are using Terraform Cloud, You can update these values in order to configure your remote state.
99
/* backend "remote" {

0 commit comments

Comments
 (0)