Skip to content
Merged
1 change: 1 addition & 0 deletions docs/resources/on_call_role.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ description: |-
### Read-Only

- `id` (String) The ID of this resource.
- `system_role` (String) The kind of role is "custom".

## Import

Expand Down
8 changes: 2 additions & 6 deletions provider/resource_on_call_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,8 @@ func resourceOnCallRoleCreate(ctx context.Context, d *schema.ResourceData, meta
if value, ok := d.GetOkExists("slug"); ok {
s.Slug = value.(string)
}
if value, ok := d.GetOkExists("system_role"); ok {
s.SystemRole = value.(string)
}
// Always set system_role to "custom" for user-created roles
s.SystemRole = "custom"
if value, ok := d.GetOkExists("alert_sources_permissions"); ok {
s.AlertSourcesPermissions = value.([]interface{})
}
Expand Down Expand Up @@ -466,9 +465,6 @@ func resourceOnCallRoleUpdate(ctx context.Context, d *schema.ResourceData, meta
if d.HasChange("slug") {
s.Slug = d.Get("slug").(string)
}
if d.HasChange("system_role") {
s.SystemRole = d.Get("system_role").(string)
}

if d.HasChange("alert_sources_permissions") {
if value, ok := d.GetOk("alert_sources_permissions"); value != nil && ok {
Expand Down
1 change: 0 additions & 1 deletion provider/resource_on_call_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ func TestAccResourceOnCallRole(t *testing.T) {
const testAccResourceOnCallRole = `
resource "rootly_on_call_role" "test" {
name = "test"
system_role = "custom"
}
`
1 change: 1 addition & 0 deletions tools/generate-provider-tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ ${resources
"rootly_retrospective_process": resourceRetrospectiveProcess(),
"rootly_retrospective_step": resourceRetrospectiveStep(),
"rootly_post_mortem_template": resourcePostmortemTemplate(),
"rootly_on_call_role": resourceOnCallRole(),
"rootly_schedule": resourceSchedule(),
"rootly_schedule_rotation": resourceScheduleRotation(),
"rootly_secret": resourceSecret(),
Expand Down
1 change: 1 addition & 0 deletions tools/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const excluded = {
"incident_post_mortem",
"incident",
"ip_ranges",
"on_call_role",
"post_mortem_template",
"pulse",
"retrospective_configuration",
Expand Down
Loading