diff --git a/pagerdutyplugin/resource_pagerduty_service.go b/pagerdutyplugin/resource_pagerduty_service.go index cea045ff8..7a36d456d 100644 --- a/pagerdutyplugin/resource_pagerduty_service.go +++ b/pagerdutyplugin/resource_pagerduty_service.go @@ -236,7 +236,6 @@ func (r *resourceService) Schema(ctx context.Context, req resource.SchemaRequest }, }, PlanModifiers: []planmodifier.List{ - listplanmodifier.RequiresReplace(), listplanmodifier.UseStateForUnknown(), planmodify.UseNullForRemovedWithState(), }, @@ -252,7 +251,6 @@ func (r *resourceService) Schema(ctx context.Context, req resource.SchemaRequest listvalidator.SizeBetween(1, 1), }, PlanModifiers: []planmodifier.List{ - listplanmodifier.RequiresReplace(), listplanmodifier.UseStateForUnknown(), }, ElementType: types.ObjectType{ @@ -348,22 +346,6 @@ func (r *resourceService) ValidateConfig(ctx context.Context, req resource.Valid } } -func (r *resourceService) ModifyPlan(ctx context.Context, req resource.ModifyPlanRequest, resp *resource.ModifyPlanResponse) { - // Set alert_grouping_parameters as Computed then "intelligent" type - var pType types.String - var config types.List - resp.Diagnostics.Append(req.Config.GetAttribute(ctx, alertGroupingParametersPath.AtName("type"), &pType)...) - resp.Diagnostics.Append(req.Config.GetAttribute(ctx, alertGroupingParametersPath.AtName("config"), &config)...) - if resp.Diagnostics.HasError() { - return - } - if pType.ValueString() == "intelligent" && config.IsNull() { - resp.Diagnostics.Append( - resp.Plan.SetAttribute(ctx, alertGroupingParametersPath.AtName("config"), types.ListUnknown(alertGroupingParametersConfigObjectType))..., - ) - } -} - func (r *resourceService) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { var config resourceServiceModel var model resourceServiceModel @@ -1103,8 +1085,6 @@ var ( }, } - alertGroupingParametersPath = path.Root("alert_grouping_parameters").AtListIndex(0) - incidentUrgencyTypeObjectType = types.ObjectType{ AttrTypes: map[string]attr.Type{ "type": types.StringType, diff --git a/pagerdutyplugin/resource_pagerduty_service_test.go b/pagerdutyplugin/resource_pagerduty_service_test.go index dbaf8dabc..c60d33c97 100644 --- a/pagerdutyplugin/resource_pagerduty_service_test.go +++ b/pagerdutyplugin/resource_pagerduty_service_test.go @@ -701,8 +701,8 @@ func TestAccPagerDutyService_AutoPauseNotificationsParameters(t *testing.T) { "pagerduty_service.foo", "auto_pause_notifications_parameters.#", "1"), resource.TestCheckResourceAttr( "pagerduty_service.foo", "auto_pause_notifications_parameters.0.enabled", "false"), - resource.TestCheckResourceAttr( - "pagerduty_service.foo", "auto_pause_notifications_parameters.0.timeout", "0"), + resource.TestCheckNoResourceAttr( + "pagerduty_service.foo", "auto_pause_notifications_parameters.0.timeout"), ), }, { @@ -723,8 +723,8 @@ func TestAccPagerDutyService_AutoPauseNotificationsParameters(t *testing.T) { "pagerduty_service.foo", "auto_pause_notifications_parameters.#", "1"), resource.TestCheckResourceAttr( "pagerduty_service.foo", "auto_pause_notifications_parameters.0.enabled", "false"), - resource.TestCheckResourceAttr( - "pagerduty_service.foo", "auto_pause_notifications_parameters.0.timeout", "0"), + resource.TestCheckNoResourceAttr( + "pagerduty_service.foo", "auto_pause_notifications_parameters.0.timeout"), ), }, }, @@ -2027,7 +2027,6 @@ resource "pagerduty_service" "foo" { incident_urgency_rule { type = "use_support_hours" - during_support_hours { type = "constant" urgency = "high"