atlassian / terraform-provider-artifactory

Terraform provider to manage Artifactory
Apache License 2.0
89 stars 42 forks source link

Non-described argument in artifactory_permission_target resource #98

Open avkudryashov opened 3 years ago

avkudryashov commented 3 years ago

An argument is added to the artifactory_permission_target resource after import. It is also added when the artifactory_permission_target resource is created from scratch.

Terraform Version

Terraform v0.12.29

Affected Resource(s)

Terraform Configuration Files

resource "artifactory_permission_target" "test-team" {
  name             = "test-team"
  repo {
    includes_pattern = ["**",]
    repositories     = [
    "datalab-docker-local",
    ]
actions {
      groups {
        name        = "test-team"
        permissions = ["manage", "delete", "write", "annotate", "read"]
      }
      users {
      name        = "test-deploy"
      permissions = ["delete", "write", "annotate", "read"]
      }
}
  }
}

Expected Behavior

No changes. Infrastructure is up-to-date.

Actual Behavior

# artifactory_permission_target.test-team will be updated in-place
~ resource "artifactory_permission_target" "test-team" {
      id               = "test-team"
    + includes_pattern = "**"
      name             = "test-team"

      repo {
          excludes_pattern = []
          includes_pattern = [
              "**",
          ]
          repositories     = [
              "datalab-docker-local",
          ]

          actions {
              groups {
                  name        = "test-team"
                  permissions = [
                      "annotate",
                      "delete",
                      "manage",
                      "read",
                      "write",
                  ]
              }

              users {
                  name        = "test-deploy"
                  permissions = [
                      "annotate",
                      "delete",
                      "read",
                      "write",
                  ]
              }
          }
      }
  }

Steps to Reproduce

  1. Create permission in artifactory
  2. Create artifactory_permission_target with the same permission, users and groups as in the artifactory
  3. Import artifactory_permission_target into terraform state
  4. terraform apply

I expect to see a message "No changes. Infrastructure is up-to-date." Instead, the resource is updated with the addition this argument

    + includes_pattern = "**"
peters95 commented 3 years ago

migrated -> https://github.com/jfrog/terraform-provider-artifactory/issues/17

chb0github commented 3 years ago

This has been closed in the new repo. Suggest the same is done here.