resourceConsulACLRolePolicyAttachmentCreate() and resourceConsulACLRolePolicyAttachmentDelete()
were not checking properly if the given role ID was not found in Consul.
Some functions in the Consul SDK return an error when the object is missing,
other return a nil object.
In the case of RoleRead() I was checking for the wrong thing. I checked the
rest of the ACL resources and as far as I know it, this was the only
resource impacted.
I also update the consul_acl_policy data source to use the new
PolicyReadByName() function.
resourceConsulACLRolePolicyAttachmentCreate()
andresourceConsulACLRolePolicyAttachmentDelete()
were not checking properly if the given role ID was not found in Consul.Some functions in the Consul SDK return an error when the object is missing, other return a
nil
object.In the case of
RoleRead()
I was checking for the wrong thing. I checked the rest of the ACL resources and as far as I know it, this was the only resource impacted.I also update the
consul_acl_policy
data source to use the newPolicyReadByName()
function.Closes https://github.com/hashicorp/terraform-provider-consul/issues/378