Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update resource map properties after Terraform 0.12 API changes #48

Open
jamestoyer opened this issue Jul 3, 2019 · 5 comments
Open

Comments

@jamestoyer
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Declarations of maps inside of Terraform 0.12 have changed and become stricter. This means you can no longer do:

resource "artifactory_permission_target" "deploy" {
  name = "t012_Deploy"

  repo = {
    includes_pattern = ["**"]

    repositories = ["libs-dev", "libs-prod"]

    actions = {
      users = [
        {
          name        = "deployuser1"
          permissions = ["read", "annotate", "write", "delete"]
        },
        {
          name        = "deployuser2"
          permissions = ["read", "annotate", "write", "delete"]
        },
      ]

      groups = [
        {
          name        = "deploygroup1"
          permissions = ["read", "annotate", "write", "delete"]
        },
      ]
    }
  }

Instead you must do:

resource "artifactory_permission_target" "deploy" {
  name = "t012_Deploy"

  repo {
    includes_pattern = ["**"]

    repositories = ["libs-dev", "libs-prod"]

    actions {
      users {
        name        = "deployuser1"
        permissions = ["read", "annotate", "write", "delete"]
      }

      users {
        name        = "deployuser2"
        permissions = ["read", "annotate", "write", "delete"]
      }

      groups {
        name        = "deploygroup1"
        permissions = ["read", "annotate", "write", "delete"]
      }
    }
  }
}

The names of users and groups should be de-pluralised as they are now multi declarations.

New or Affected Resource(s)

  • artifactory_permission_target
  • Other resources may also be affected

References

@peimanja
Copy link

Any update on this one? :)

@peimanja
Copy link

peimanja commented Sep 5, 2019

This is really blocking us from using terraform 0.12.x which gives us more flexibility in building modules.

Terraform v0.12.6
Configuring remote state backend...
Initializing Terraform configuration...
2019/09/05 20:47:33 [DEBUG] Using modified User-Agent: Terraform/0.12.6 PTFE/5dea1b8

Error: Failed to instantiate provider "artifactory" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]```

@jamestoyer
Copy link
Contributor Author

v2.0.0-alpha1 should help you with your 0.12.x Terraform support. I've not had a chance to make the changes in the is PR, but the solution in #43 should still work

@peimanja
Copy link

@jamestoyer I have started using v2.0.0-alpha1 and works pretty good. Is there any plan to release v2.0.0 ? It's been a few months from v2.0.0-alpha1

@peimanja
Copy link

peimanja commented Mar 5, 2020

bump! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants