Skip to content

Handle missing roles and failed requests to create/update roles #97

@micahkemp-splunk

Description

@micahkemp-splunk

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.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions