Similar to the issue addressed in #89, the roles resource doesn't properly handle resources that are in state but missing on the remote Splunk instance. This is made worse by insufficient checking of the response returned within [CreateAuthorizationRoles](https://github.com/splunk/terraform-provider-splunk/blob/master/client/authorization_roles.go#L10), as a failed creation of a role won't be handled as a failure within the provider, resulting in a resource being added to state but with no remote configuration actually having been created. To resolve this issue, the response's status code needs to be checked for success, instead of relying on a returned error.
While looking into the issue it was also identified that [UpdateAuthorizationRoles](https://github.com/splunk/terraform-provider-splunk/blob/master/client/authorization_roles.go#L35) also needs to handle failures by response code as well.
Similar to the issue addressed in #89, the roles resource doesn't properly handle resources that are in state but missing on the remote Splunk instance. This is made worse by insufficient checking of the response returned within
[CreateAuthorizationRoles](https://github.com/splunk/terraform-provider-splunk/blob/master/client/authorization_roles.go#L10)
, as a failed creation of a role won't be handled as a failure within the provider, resulting in a resource being added to state but with no remote configuration actually having been created. To resolve this issue, the response's status code needs to be checked for success, instead of relying on a returned error.While looking into the issue it was also identified that
[UpdateAuthorizationRoles](https://github.com/splunk/terraform-provider-splunk/blob/master/client/authorization_roles.go#L35)
also needs to handle failures by response code as well.