Skip to content

Commit

Permalink
fix: computed values are expected to change (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
weilueluo authored Oct 13, 2023
1 parent 02512dd commit f6a418e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 0 additions & 1 deletion provider/internal/connector/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package connector
import (
"context"
"fmt"

cdoClient "github.com/CiscoDevnet/terraform-provider-cdo/go-client"
"github.com/CiscoDevnet/terraform-provider-cdo/go-client/connector"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down
7 changes: 7 additions & 0 deletions provider/internal/device/asa/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/CiscoDevnet/terraform-provider-cdo/internal/util"
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
"strconv"
"strings"
Expand Down Expand Up @@ -103,10 +104,16 @@ func (r *AsaDeviceResource) Schema(ctx context.Context, req resource.SchemaReque
"port": schema.Int64Attribute{
MarkdownDescription: "The port used to connect to the device.",
Computed: true,
PlanModifiers: []planmodifier.Int64{
int64planmodifier.UseStateForUnknown(),
},
},
"host": schema.StringAttribute{
MarkdownDescription: "The host used to connect to the device.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"labels": schema.ListAttribute{
MarkdownDescription: "Set a list of labels to identify the device as part of a group. Refer to the [CDO documentation](https://docs.defenseorchestrator.com/t-applying-labels-to-devices-and-objects.html#!c-labels-and-filtering.html) for details on how labels are used in CDO.",
Expand Down
15 changes: 15 additions & 0 deletions provider/internal/device/ftd/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,37 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp
"generated_command": schema.StringAttribute{
MarkdownDescription: "The command to run in the FTD CLI to register it with the cloud-delivered FMC (cdFMC).",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"access_policy_id": schema.StringAttribute{
MarkdownDescription: "The ID of the cloud-delivered FMC (cdFMC) access policy applied to this FTD.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"hostname": schema.StringAttribute{
MarkdownDescription: "The Hostname of the cloud-delivered FMC (cdFMC) manages this FTD.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"nat_id": schema.StringAttribute{
MarkdownDescription: "The Network Address Translation (NAT) ID of this FTD.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"reg_key": schema.StringAttribute{
MarkdownDescription: "The Registration Key of this FTD.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
},
}
Expand Down
7 changes: 7 additions & 0 deletions provider/internal/device/ios/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier"
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
"strings"

Expand Down Expand Up @@ -88,10 +89,16 @@ func (r *IosDeviceResource) Schema(ctx context.Context, req resource.SchemaReque
"port": schema.Int64Attribute{
MarkdownDescription: "The port used to connect to the device.",
Computed: true,
PlanModifiers: []planmodifier.Int64{
int64planmodifier.UseStateForUnknown(),
},
},
"host": schema.StringAttribute{
MarkdownDescription: "The host used to connect to the device.",
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"username": schema.StringAttribute{
MarkdownDescription: "The username used to authenticate with the device.",
Expand Down

0 comments on commit f6a418e

Please sign in to comment.