diff --git a/internal/resource_org_psk/sdk_to_terraform.go b/internal/resource_org_psk/sdk_to_terraform.go index 08481fc7..e1cd6c5f 100644 --- a/internal/resource_org_psk/sdk_to_terraform.go +++ b/internal/resource_org_psk/sdk_to_terraform.go @@ -16,7 +16,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (OrgPskModel, diag.Diagn var diags diag.Diagnostics var email types.String - var expire_time types.Int64 + var expire_time types.Int64 = types.Int64Value(0) var expiry_notification_time types.Int64 var id types.String var mac types.String diff --git a/internal/resource_org_psk/terraform_to_sdk.go b/internal/resource_org_psk/terraform_to_sdk.go index cd237232..cd2e5578 100644 --- a/internal/resource_org_psk/terraform_to_sdk.go +++ b/internal/resource_org_psk/terraform_to_sdk.go @@ -51,7 +51,7 @@ func TerraformToSdk(ctx context.Context, plan *OrgPskModel) (models.Psk, diag.Di unset["-max_usage"] = "" } - data.Name = plan.Name.String() + data.Name = plan.Name.ValueString() if !plan.Note.IsNull() && !plan.Note.IsUnknown() { data.Note = plan.Note.ValueStringPointer() diff --git a/internal/resource_site_psk/sdk_to_terraform.go b/internal/resource_site_psk/sdk_to_terraform.go index c7aced97..74b23d09 100644 --- a/internal/resource_site_psk/sdk_to_terraform.go +++ b/internal/resource_site_psk/sdk_to_terraform.go @@ -16,7 +16,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag var diags diag.Diagnostics var email types.String - var expire_time types.Int64 + var expire_time types.Int64 = types.Int64Value(0) var expiry_notification_time types.Int64 var id types.String var mac types.String @@ -30,6 +30,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag var passphrase types.String var role types.String var ssid types.String + var site_id types.String var usage types.String var vlan_id types.String @@ -78,6 +79,8 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag ssid = types.StringValue(d.Ssid) + site_id = types.StringValue(string(d.SiteId.String())) + usage = types.StringValue(string(*d.Usage)) if d.VlanId != nil { @@ -99,6 +102,7 @@ func SdkToTerraform(ctx context.Context, d *models.Psk) (SitePskModel, diag.Diag state.OrgId = org_id state.Role = role state.Ssid = ssid + state.SiteId = site_id state.Usage = usage state.VlanId = vlan_id diff --git a/internal/resource_site_psk/terraform_to_sdk.go b/internal/resource_site_psk/terraform_to_sdk.go index fc1cde0b..59769c6a 100644 --- a/internal/resource_site_psk/terraform_to_sdk.go +++ b/internal/resource_site_psk/terraform_to_sdk.go @@ -45,7 +45,7 @@ func TerraformToSdk(ctx context.Context, plan *SitePskModel) (models.Psk, diag.D unset["-macs"] = "" } - data.Name = plan.Name.String() + data.Name = plan.Name.ValueString() if !plan.Note.IsNull() && !plan.Note.IsUnknown() { data.Note = plan.Note.ValueStringPointer()