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.
Fixes #577
NOTES: The customer initially reported the Fastly API was returning an ambiguous error. The error messaging was intentional as the API internals are sharing an implementation across multiple types, which means the error had to be generic in wording.
To help avoid confusion a new version of go-fastly was released (v6.4.3) with additional checks for the
Token
field. This PR bumps the go-fastly dependency to the new version.I then also noticed a bug in the Terraform provider where the use of
schema.EnvDefaultFunc
meant that if no environment variable (i.e.FASTLY_SPLUNK_TOKEN
) had been set, then an empty string would be used. Returning an empty string causes Terraform to use the value as the fallback and sends the empty string to go-fastly.Instead of an empty string, if the helper function returned
nil
, then Terraform would enforce the 'required field' behaviour on theToken
attribute and would prompt the user to add a value to their HCL configuration. Thus avoiding having to even call out to go-fastly (only for go-fastly's new check for a token value to fail).