Skip to content

Commit

Permalink
resolve tflint issue and ignore required module source rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nellyk committed May 29, 2024
1 parent 2961268 commit 762d37e
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 62 deletions.
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,6 @@ Type: `map(string)`

Default: `{}`

### <a name="input_client_id"></a> [client\_id](#input\_client\_id)

Description: (Optional) The Client ID (appId) for the Service Principal used for the AKS deployment

Type: `string`

Default: `""`

### <a name="input_client_secret"></a> [client\_secret](#input\_client\_secret)

Description: (Optional) The Client Secret (password) for the Service Principal used for the AKS deployment

Type: `string`

Default: `""`

### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)

Description: This variable controls whether or not telemetry is enabled for the module.
Expand All @@ -135,14 +119,6 @@ Type: `bool`

Default: `true`

### <a name="input_key_vault_secrets_provider_enabled"></a> [key\_vault\_secrets\_provider\_enabled](#input\_key\_vault\_secrets\_provider\_enabled)

Description: (Optional) Whether to use the Azure Key Vault Provider for Secrets Store CSI Driver in an AKS cluster. For more details: https://docs.microsoft.com/en-us/azure/aks/csi-secrets-store-driver

Type: `bool`

Default: `false`

### <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version)

Description: Specify which Kubernetes release to use. Specify only minor version, such as '1.28'.
Expand Down Expand Up @@ -338,12 +314,6 @@ Description: The `azurerm_kubernetes_cluster`'s resource id.

The following Modules are called:

### <a name="module_regions"></a> [regions](#module\_regions)

Source: Azure/regions/azurerm

Version: >= 0.3.0

### <a name="module_vnet"></a> [vnet](#module\_vnet)

Source: Azure/subnets/azurerm
Expand Down
193 changes: 193 additions & 0 deletions avm.tflint_module.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
plugin "terraform" {
enabled = true
version = "0.5.0"
source = "github.com/terraform-linters/tflint-ruleset-terraform"
}

plugin "avm" {
enabled = true
version = "0.5.0"
source = "github.com/Azure/tflint-ruleset-avm"
signing_key = <<-KEY
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: BSN Pgp v1.1.0.0
mQENBF9hII8BCADEOCDl3/1tAZQp/1BCVJN+tqIRCd3ywzhOXTC38XWC0zVbFtiA
vbBFL1e78aoDIyUFDZcphCyYDqBkweXeYyYVCojZFVniyKklc2xZ15LDwlMBhneU
yEPSzDCltFn67wMPQMKa4+TujZJ3TIs1OUnUTsCPrjavGgmrfAdxAF/EjCDrnVp9
XmRWJii/9elAnMqWLDkMDfPaWkv3lWuyYCBHc7avOJE9oWypmWoEPOujwmtika/i
FhmvZbojZN6huf7pykXGRl1wEpu0MMEFvm4UsfEOv8JHVBZEu2w6glQugT6a+IZ6
atH3zyy+i1mmgsJPlMF1soHNEufeK1CabMklABEBAAG0Q1RlcnJhZm9ybSBBRE8g
cHJvdmlkZXIgcmVsZWFzZSA8dGVycmFmb3JtYWRvcHJvdmlkZXJAbWljcm9zb2Z0
LmNvbT6JATgEEwEIACIFAl9hII8CGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheA
AAoJEG8Lkb3phHjPT+YH/3aksw2yhoqVl+Dxkrpsq9LIsXBHmHfbk8/nwbZ7F6o6
fZetwozQzS/v5IriE42NFdk2omilDa/Iumk5soPrCamIIToYMbGvZJ9MJzCflXzp
H3crqEgoCwu/93FVot4hhNOGmS2ra538zDQ3JsSbsVSc2TyPeBCF08+qJrr9VSML
LceuEvCKUN8P8LH+PXN4kKM1xNlSVw4RfH6mNJKdUG1Klvh2nbq0kuw8jiHITn2F
ALGvKXPLwggdNA86RIQc9tc3z/uJrBGSA2n6UkJbV1gFZDETjHzVtgDqqEQwap7D
/i9e5KqIAEIf14OPm3h+e6kCdWXRG0RJWWVWeOHIEfQ=
=KwXd
-----END PGP PUBLIC KEY BLOCK-----
KEY
}

rule "terraform_comment_syntax" {
enabled = true
}

rule "terraform_deprecated_index" {
enabled = true
}

rule "terraform_deprecated_interpolation" {
enabled = true
}

rule "terraform_deprecated_lookup" {
enabled = true
}

rule "terraform_documented_outputs" {
enabled = true
}

rule "terraform_documented_variables" {
enabled = true
}

rule "terraform_empty_list_equality" {
enabled = true
}

rule "terraform_module_pinned_source" {
enabled = true
}

rule "terraform_module_version" {
enabled = true
}

rule "terraform_naming_convention" {
enabled = true
}

rule "terraform_required_providers" {
enabled = true
}

rule "terraform_required_version" {
enabled = true
}

rule "terraform_standard_module_structure" {
enabled = false
}

rule "terraform_typed_variables" {
enabled = true
}

# disable for `locals.version.tf.json for now
rule "terraform_unused_declarations" {
enabled = true
}

rule "terraform_unused_required_providers" {
enabled = true
}

rule "terraform_workspace_remote" {
enabled = true
}

rule "terraform_heredoc_usage" {
enabled = true
}

rule "terraform_module_provider_declaration" {
enabled = true
}

rule "terraform_output_separate" {
enabled = true
}

rule "terraform_required_providers_declaration" {
enabled = true
}

rule "terraform_required_version_declaration" {
enabled = true
}

rule "terraform_sensitive_variable_no_default" {
enabled = true
}

rule "terraform_variable_nullable_false" {
enabled = true
}

rule "terraform_variable_separate" {
enabled = true
}

rule "azurerm_resource_tag" {
enabled = true
}

# AVM Provider Rules

rule "tfnfr26" {
enabled = true
}

# AVM Module Rules

rule "required_module_source_tffr1" {
enabled = false
}

# AVM Output Rules

rule "required_output_rmfr7" {
enabled = true
}

rule "required_output_tffr2" {
enabled = true
}

# AVM Variable Interface Rules

rule "customer_managed_key" {
enabled = true
}

rule "diagnostic_settings" {
enabled = true
}

rule "location" {
enabled = true
}

rule "lock" {
enabled = true
}

rule "managed_identities" {
enabled = true
}

rule "private_endpoints" {
enabled = true
}

rule "role_assignments" {
enabled = true
}

rule "tags" {
enabled = true
}
4 changes: 1 addition & 3 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
locals {
role_definition_resource_substring = "/providers/Microsoft.Authorization/roleDefinitions"
}


locals {
locations_cached_or_live = data.local_file.locations.content
Expand Down
4 changes: 0 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
module "regions" {
source = "Azure/regions/azurerm"
version = ">= 0.3.0"
}

resource "random_string" "acr_suffix" {
length = 8
Expand Down
4 changes: 0 additions & 4 deletions modules/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,6 @@ variable "agents_tags" {
description = "(Optional) A mapping of tags to assign to the Node Pool."
}

variable "client_id" {
type = string
default = ""
description = "(Optional) The Client ID (appId) for the Service Principal used for the AKS deployment"
nullable = false
}

variable "client_secret" {
type = string
default = ""
description = "(Optional) The Client Secret (password) for the Service Principal used for the AKS deployment"
nullable = false
}

variable "enable_telemetry" {
type = bool
default = true
Expand All @@ -51,13 +37,6 @@ If it is set to false, then no telemetry will be collected.
DESCRIPTION
}

variable "key_vault_secrets_provider_enabled" {
type = bool
default = false
description = "(Optional) Whether to use the Azure Key Vault Provider for Secrets Store CSI Driver in an AKS cluster. For more details: https://docs.microsoft.com/en-us/azure/aks/csi-secrets-store-driver"
nullable = false
}

variable "kubernetes_version" {
type = string
default = null
Expand Down

0 comments on commit 762d37e

Please sign in to comment.