Skip to content

When condition on resource which has its own type property fails #731

@imens-frankd

Description

@imens-frankd

When condition on resource which has its own type property fails

Since azuread_application_permission_scope doesn't have a name property I want to exlude it from the scenario that I use to ensure all resource names are lower case. I have done the same for azuread_application which works.
It doesn't work for azuread_application_permission_scope and the test fails.
I suspect that it has something to do with the fact that azuread_application_permission_scope itself has a property called type.

To Reproduce

Feature File:

@case-sensitive
Scenario: Ensure all azure ad resource names are all lowercase
    Given I have resource that supports name defined
    When its provider_name is registry.terraform.io/hashicorp/azuread
    When its type is not azuread_application
    When its type is not azuread_application_permission_scope
    Then it must have name
    And its value must match the "^[a-z-0-9]+$" regex

Plan File:

Sample Terraform Code:

resource "azuread_application_permission_scope" "example" {
  application_id             = azuread_application.app.id
  admin_consent_description  = "Example permission"
  admin_consent_display_name = "example-permission"
  scope_id                   = random_uuid.uuid_permission_scope.id
  type                       = "Admin"
  value                      = "example-permission"
}

Used terraform-compliance Parameters:

podman run --rm -v ./:/target -i eerkunt/terraform-compliance -f features -p main.tfplan.json

Running via Docker:

Yes

Running container with podman v4.9.2

Error Output:

Test scenario fails

Expected Behavior:

Test scenario is skipped for resource of type azuread_application_permission_scope

Tested Versions:

  • terraform-compliance version: v1.3.47
  • terraform version: v1.7.3
  • python version: your python runtime version, if running as a python package

Additional Context:

Using provider registry.terraform.io/hashicorp/azuread v2.47.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions