quintilesims / layer0

Build, Manage, and Deploy Your Applications
Apache License 2.0
44 stars 20 forks source link

Terraform update #417

Closed zpatrick closed 6 years ago

zpatrick commented 6 years ago

What does this pull request do? The main point of this PR is to update the terraform plugin. I've updated all of the code to work with the update client / job model. I've also slightly changed the unit test patterns for this package. While testing this, I encountered quite a few bugs/missing features needed to properly test these changes. With that, I've also fixed the following bugs / added the missing functionality:

How should this be tested? Unit test all of the package where I have made changes. To test the terraform provider, I usually just create a main.tf with every available resource and data source. I add/update/remove each of the resources' options until i've exhausted all possible configurations. You also need to test that it gracefully handles when things no longer exist - e.g. it was created in terraform but deleted by the CLI.

Checklist

diemonster commented 6 years ago

Why are there so many vendored code changes in this PR? Are they necessary for terraform or were they auto-updated as part of something else?

zpatrick commented 6 years ago

Why are there so many vendored code changes in this PR? Are they necessary for terraform or were they auto-updated as part of something else?

I believe this was because I ran go format on the entire repo

sesh-kebab commented 6 years ago

@zpatrick would you please be able to update develop.md with development workflow information for the terraform provider also?

diemonster commented 6 years ago

@sesh-kebab @zpatrick to seshi's point, I think what we need detailed here eventually is "How should this be tested?". This is still very WIP though so I don't think it's fully fair to have that info yet.

diemonster commented 6 years ago

Is there any use for the Layer0 admin API in the terraform plugin?

jparsons04 commented 6 years ago

Can you explain the test pattern where you create a resource in terraform and then delete the resource via the cli. Are you saying that if you were to terraform plan after the deletion that terraform would gracefully handle that situation? I didn't see what the specific testing pattern was supposed to be from terraform's perspective for gracefully handling that.