Issues were:
* `settings_file` `ValidateFunc` needs to expand homedir just like the
`configure` does, otherwise ~-based paths fail validation
* `isFile` was being called before ~-expand so configure was failing as well
* `Config` was swallowing error so provider was ending up with `nil`,
resulting in crash
To fix:
* Consolidate settings_file path/contents handling into a single helper
called from both `validate` and `configure` funcs
* Return err from `Config`
To cover:
* Added test case to validate w/ tilde-path
* Added configure test w/ tilde-path
The `ForceDelete` parameter was getting sent to the upstream API call,
but only after we had already finished draining instances from
Terraform, so it was a moot point by then.
This fixes that by skipping the drain when force_delete is true, and it
also simplifies the field config a bit:
* set a default of false to simplify the logic
* remove `ForceNew` since there's no need to replace the resource to
flip this value
* pull a detail comment from code into the docs
Often when developing a plugin it's only necessary to rebuild that plugin.
Here we add a simple Makefile target that makes that easy:
make plugin-dev PLUGIN=provider-aws
Since it's only building one package and it's only building for the
host architecture, this just uses "go install" directly, rather than using
gox as we do when installing multiple packages, possibly for multiple
architectures.
Now that we support log line filtering (as of 0090c063) it's good to be
a bit more fussy about what log levels are assigned to different things.
Here we make a few things that are implementation details log as DEBUG,
and prevent spurious errors from EvalValidateCount where it was returning
an empty EvalValidateError rather than nil when everything was okay.
This PR brings support for better log level handling. Terraform logs
are already written in the form which can be understood by the module
https://github.com/hashicorp/logutils .
The TF_LOG environment variable now accepts a log level. Users can pass
levels in the form of "info", "Info" or "INFO" If an invalid log level is
passed, we print a warning but still continue, for backward compatibility
with the old TF_LOG=1 style.