tflint-ruleset-azurerm icon indicating copy to clipboard operation
tflint-ruleset-azurerm copied to clipboard

tflint --deep reports error stating missing aws config for azure terraform config

Open ameyaagashe opened this issue 3 years ago • 3 comments

Hi,

I have the below terraform config

cat main.tf

# Configure the Azure provider
provider "azurerm" {
  version = "=2.20.0"
  subscription_id = var.subscriptionID
   features {}
  }

#create resource group
resource "azurerm_resource_group" "tf-rg" {
    name                   = var.rg_name
    location               = var.location
}

cat variables.tf

variable "subscriptionID" {
    type = string
    description = "Variable for our resource group"
    default = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

variable "location" {
    type = string
    description = "location of  resource group"
    default = "Australia Southeast"
}

variable "rg_name" {
    type = string
    description = "name of resource group"
    default = "Prod02"
}

However, when I run tflint --deep, I get the error like below:

Failed to initialize a runner. An error occurred:

Error: no valid credential sources for found.

Please see
for more information about providing credentials.

Error: NoCredentialProviders: no valid providers in chain. Deprecated.
        For verbose messaging see aws.Config.CredentialsChainVerboseErrors

Note: I have installed terraform and even executed

terraform init
terraform plan
terrafrm apply

I have installed tflint for azure as well https://github.com/terraform-linters/tflint-ruleset-azurerm

Please advise what I am doing wrong here?

ameyaagashe avatar Aug 15 '20 14:08 ameyaagashe

Hi @ameyaagashe

Sorry, deep inspection is only supported in the AWS provider now.

wata727 avatar Aug 15 '20 14:08 wata727

@wata727 What is available for Azure in that case?

ameyaagashe avatar Aug 16 '20 00:08 ameyaagashe

Normal inspection is available. It doesn't require Azure or AWS credentials and is available by default.

Although there is no plan yet, if deep inspection is supported in Azure, it will be possible to perform more detailed inspection with calling APIs using Azure credentials.

wata727 avatar Aug 16 '20 12:08 wata727