provider: support TLS certs configured by strings. #184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds a number of new provider config params that allow users to configure TLS certificates via strings, alongside the pre-existing file location method.
The provider schema ConflictsWith param is used to notify users when a configuration attempts to use two keys which affect the same TLS config param. In order to successfully use this, the existing DefaultFunc default values have been moved from an empty string to nil. This is because Terraform treats an empty string var as being populated, and therefore raises a conflict error whenever a new param is set. I tested this change locally to ensure it didn't cause any compatibility issues, and didn't find any. It is reassures that the Consul provider went through the same change.
The provider doesn't have much testing around its configuration, so I will open an issue to improve this in the future. In the meantime when testing locally I used the Nomad dev tls cluster along with the Terraform code below to test. The local plugin is located within
~/.terraform.d/plugins/hashicorp.com/hashicorp/nomad/0.1/darwin_amd64/
.closes #181