Skip to content

Commit a899527

Browse files
committed
add default values
1 parent 382026e commit a899527

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

internal/provider/resource_tfe_opa_version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/hashicorp/terraform-plugin-framework/path"
1818
"github.com/hashicorp/terraform-plugin-framework/resource"
1919
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
20+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
2021
"github.com/hashicorp/terraform-plugin-framework/types"
2122
"github.com/hashicorp/terraform-plugin-log/tflog"
2223
)
@@ -72,21 +73,27 @@ func (r *OPAVersionResource) Schema(ctx context.Context, req resource.SchemaRequ
7273
"official": schema.BoolAttribute{
7374
Optional: true,
7475
Computed: true,
76+
Default: booldefault.StaticBool(false),
7577
},
7678
"enabled": schema.BoolAttribute{
7779
Optional: true,
7880
Computed: true,
81+
Default: booldefault.StaticBool(true),
7982
},
8083
"beta": schema.BoolAttribute{
8184
Optional: true,
8285
Computed: true,
86+
Default: booldefault.StaticBool(false),
8387
},
8488
"deprecated": schema.BoolAttribute{
8589
Optional: true,
8690
Computed: true,
91+
Default: booldefault.StaticBool(false),
8792
},
8893
"deprecated_reason": schema.StringAttribute{
8994
Optional: true,
95+
Computed: true,
96+
Default: nil,
9097
},
9198
"archs": schema.SetNestedAttribute{
9299
NestedObject: schema.NestedAttributeObject{

internal/provider/resource_tfe_sentinel_version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/hashicorp/terraform-plugin-framework/path"
1313
"github.com/hashicorp/terraform-plugin-framework/resource"
1414
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
15+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1516
"github.com/hashicorp/terraform-plugin-framework/types"
1617
"github.com/hashicorp/terraform-plugin-log/tflog"
1718
)
@@ -67,21 +68,27 @@ func (r *sentinelVersionResource) Schema(ctx context.Context, req resource.Schem
6768
"official": schema.BoolAttribute{
6869
Optional: true,
6970
Computed: true,
71+
Default: booldefault.StaticBool(false),
7072
},
7173
"enabled": schema.BoolAttribute{
7274
Optional: true,
7375
Computed: true,
76+
Default: booldefault.StaticBool(true),
7477
},
7578
"beta": schema.BoolAttribute{
7679
Optional: true,
7780
Computed: true,
81+
Default: booldefault.StaticBool(false),
7882
},
7983
"deprecated": schema.BoolAttribute{
8084
Optional: true,
8185
Computed: true,
86+
Default: booldefault.StaticBool(false),
8287
},
8388
"deprecated_reason": schema.StringAttribute{
8489
Optional: true,
90+
Computed: true,
91+
Default: nil,
8592
},
8693
"archs": schema.SetNestedAttribute{
8794
NestedObject: schema.NestedAttributeObject{

internal/provider/resource_tfe_terraform_version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/hashicorp/terraform-plugin-framework/path"
1919
"github.com/hashicorp/terraform-plugin-framework/resource"
2020
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
21+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
2122
"github.com/hashicorp/terraform-plugin-framework/types"
2223
"github.com/hashicorp/terraform-plugin-log/tflog"
2324
)
@@ -73,21 +74,27 @@ func (r *terraformVersionResource) Schema(ctx context.Context, req resource.Sche
7374
"official": schema.BoolAttribute{
7475
Optional: true,
7576
Computed: true,
77+
Default: booldefault.StaticBool(false),
7678
},
7779
"enabled": schema.BoolAttribute{
7880
Optional: true,
7981
Computed: true,
82+
Default: booldefault.StaticBool(true),
8083
},
8184
"beta": schema.BoolAttribute{
8285
Optional: true,
8386
Computed: true,
87+
Default: booldefault.StaticBool(false),
8488
},
8589
"deprecated": schema.BoolAttribute{
8690
Optional: true,
8791
Computed: true,
92+
Default: booldefault.StaticBool(false),
8893
},
8994
"deprecated_reason": schema.StringAttribute{
9095
Optional: true,
96+
Computed: true,
97+
Default: nil,
9198
},
9299
"archs": schema.SetNestedAttribute{
93100
NestedObject: schema.NestedAttributeObject{

0 commit comments

Comments
 (0)