Skip to content

Commit 7403500

Browse files
authored
validate idle_timeout is enabled if idle_timeout_minutes is set (#336)
1 parent 16e0e29 commit 7403500

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/resource/service.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/hashicorp/terraform-plugin-framework-validators/boolvalidator"
1515
"github.com/hashicorp/terraform-plugin-framework-validators/int32validator"
16+
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
1617
"github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator"
1718
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
1819
"github.com/hashicorp/terraform-plugin-framework/attr"
@@ -331,6 +332,9 @@ func (r *ServiceResource) Schema(_ context.Context, _ resource.SchemaRequest, re
331332
PlanModifiers: []planmodifier.Int64{
332333
int64planmodifier.UseStateForUnknown(),
333334
},
335+
Validators: []validator.Int64{
336+
int64validator.AlsoRequires(path.Expressions{path.MatchRoot("idle_scaling")}...),
337+
},
334338
},
335339
"iam_role": schema.StringAttribute{
336340
Description: "IAM role used for accessing objects in s3.",

0 commit comments

Comments
 (0)