Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

terraform 0.12.0 #17

Merged
merged 6 commits into from
Jul 16, 2019
Merged

terraform 0.12.0 #17

merged 6 commits into from
Jul 16, 2019

Conversation

skylerto
Copy link
Contributor

@skylerto skylerto commented Jul 3, 2019

This PR adds support for terraform 0.12.0.

The support was added following the guidelines provided by terraform (https://www.terraform.io/docs/extend/terraform-0.12-compatibility.html)

Most of what was done was for adding the vendor dependencies (go modules) as per the docs.

resolves #13

skylerto added 2 commits July 3, 2019 09:53
TypeMaps with Elem TypeMap is no longer supported by terraform 12.

We now are using TypeMap with Elem TypeString.

Signed-off-by: skylerto <[email protected]>
@ghost ghost added the size/XXL label Jul 3, 2019
@@ -97,21 +97,13 @@ func resourceVra7Deployment() *schema.Resource {
"deployment_configuration": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only file pertaining to business logic that needed to be changed to support 12.

@markpeek
Copy link
Contributor

markpeek commented Jul 3, 2019

@skylerto thank you for the PR to upgrade to 0.12. I've had those changes as well. But when using resource_specification I see this:

$ cat main.tf
provider "vra7" {
  username = var.vra_username
  password = var.vra_password
  tenant   = var.vra_tenant
  host     = var.vra_host
  insecure = true
}

//Component profile blueprint
resource "vra7_deployment" "deploy1" {
  count             = 1
  catalog_item_name = "CentOS 7.0 x64"
  wait_timeout      = 30

  resource_configuration = {
    Linux.cpu = "2"
  }

  reasons     = "Test"
  description = "deployment via terraform"
}
$ terraform plan

Error: Reference to undeclared resource

  on main.tf line 16, in resource "vra7_deployment" "deploy1":
  16:     Linux.cpu = "2"

A managed resource "Linux" "cpu" has not been declared in the root module.

I believe this has to do with the way 0.12 handles expressions differently from 0.11. Are you seeing this same thing with your changes?

@markpeek
Copy link
Contributor

markpeek commented Jul 3, 2019

Ahhh, looking at the README changes in your PR I see you were going a similar path as I was, which was to quote the resource config value.

Linux.cpu => "Linux.cpu"

Likely all the examples will need to be changed. And verification of backwards compatibility with 0.11.

@skylerto
Copy link
Contributor Author

skylerto commented Jul 4, 2019

@markpeek indeed, this was the only way I was able to get it working and passing vRA the correct values. I went down the route of trying to get the Maps working, but with terraform 12 a Map with a Elem value of Map is not valid.

ref validateMapValues in the terraform code: https://github.com/hashicorp/terraform/blob/7f5ffbfe9027c34c4ce1062a42b6e8d80b5504e0/helper/schema/schema.go#L1584-L1617

@skylerto
Copy link
Contributor Author

skylerto commented Jul 8, 2019

@markpeek, @sudomateo is there any next steps that I can take here to get this merged and released?

@markpeek
Copy link
Contributor

markpeek commented Jul 9, 2019

@skylerto my apologies for the delay in getting this PR merged. Because this change is more than just updating the code for 0.12, we're being cautious. We are in the process of verifying/updating the unit and acceptance tests along with validating backwards compatibility with terraform 0.11. We will then work with HashiCorp on how best to roll out to our users. Thank you for your patience.

@skylerto
Copy link
Contributor Author

Let me know how things go, would love to get this merged as opposed to managing our own release and fork.

Also have some other changes that we're working on that might be useful upstream.

@markpeek
Copy link
Contributor

Thanks @skylerto! I'm going to follow up with a PR to get the acceptance tests working and then work with HashiCorp on the right way to release (versioning, etc.).

@skylerto
Copy link
Contributor Author

@markpeek thanks! I'm by no means a vRA expert, I'm working with a client on an internal fork and figure I would contribute these back upstream; stay tuned from some more ideas. :)

@mcascone
Copy link

mcascone commented Aug 5, 2019

Hi all, please forgive my ignorance, but how do we pull down this new version? There's no new release version since May 7. And currently, when i run terraform init -upgrade with Terraform v0.12, I still get the no provider exists with the given name error.
I'm sure i'm missing something dumb, but can anyone help?

@skylerto
Copy link
Contributor Author

skylerto commented Aug 6, 2019

@mcascone that's a great question! There is no official release of this provider with terraform 12 support. There are options to build and use a copy of that artifact locally (which is what I do). If you have a look at HashiCorps documentation (https://www.terraform.io/docs/plugins/basics.html) there you will find where to place built providers. This one is as simple as running (go build) and placing it in the directory defined in that documentation.

As for when the release will be available, that's a question for @markpeek.

@markpeek
Copy link
Contributor

markpeek commented Aug 6, 2019

@mcascone and @skylerto currently working with HashiCorp on logistics to get a new plugin built to support v0.12. Release should be soon.

@skylerto
Copy link
Contributor Author

skylerto commented Aug 7, 2019

Great, thanks for the update @markpeek!

@markpeek
Copy link
Contributor

markpeek commented Aug 8, 2019

@mcascone @skylerto this is now installable from the HashiCorp provider repository. You may need to remove your old ones to get the new one (v0.3.0) installed. Note: we likely will update to the 0.12.6 sdk (per recent changes and advice) so there may be a v0.3.1 update out sometime soon.

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

Successfully merging this pull request may close these issues.

terraform-provider-vra7 v0.2.0 not compatible with Terraform v0.12.0
3 participants