0.10.8, AWS provider 1.5.0
https://gist.github.com/davido-bs/52edbd47426b69e5efd10e957ed1c417
Plan should have been created.
Error in the logs: interface {} is nil, not string. In the gist provided, it manifests itself as an "unexpected EOF" error.
terraform planThe reproducability of this may be due to handling erroneous "stray" values in the state, as we have been doing a fairly large refactor. This is not the first time we've encountered this message though, so I'm putting it out there "for the record".
Only real "workaround" at the moment seems to be to manually remove all aws_codebuild_project resources, then remove the actual projects themselves, then run a plan again to have it create the projects again. Obviously not ideal.
Hi @davido-bs! Thanks for reporting this.
What follows are some notes from my initial investigation that may be useful to someone working on a fix for this in future:
Normally the provider framework guarantees that a set hash function will see only values of the expected type for a given attribute due to the schema, but it looks like this particular resource is doing some custom work directly with the Set type, rather than working directly with the sets provided by the framework:
The problem here seems to be on line 545, where it _conditionally_ populates the relevant attribute, creating a situation where this might be nil. It should instead be writing a valid empty value (in this case, an empty string) to preserve the invariant that the hash function is expecting.
With that said, normally we avoid this sort of complexity by assigning to set attributes using a Go slice rather than a schema.Set, so probably an easier path here would be to change this flattenAwsCodebuildProjectSource function to return []interface{} and let _that_ be assigned to the attribute in the schema. ResourceData.Set accepts a Go slice when assigning to a set, and handles the conversion to the appropriate set type automatically.
This has landed in master and will ship with v1.7.1 set to release later this week. Happy Terraform'ing! 🎉
This has been released in terraform-provider-aws version 1.7.1. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
This has landed in master and will ship with v1.7.1 set to release later this week. Happy Terraform'ing! 🎉