CiscoDevNet / terraform-provider-sdwan

Terraform Cisco SD-WAN Provider
https://registry.terraform.io/providers/CiscoDevNet/sdwan
Mozilla Public License 2.0
17 stars 11 forks source link

[UX2.0] Errors when pushing basic parcel #240

Closed tzarski0 closed 1 month ago

tzarski0 commented 2 months ago

Push of basic parcel fails with:

│ Error: Configuration Read Error
│ 
│   with module.sdwan.sdwan_system_basic_profile_parcel.system_basic_profile_parcel["system2-basic"],
│   on ../terraform-sdwan-nac-sdwan/sdwan_profile_parcels.tf line 152, in resource "sdwan_system_basic_profile_parcel" "system_basic_profile_parcel":
│  152:   gps_longitude                       = try(each.value.basic.longitude, null)
│ 
│ An unexpected error was encountered trying to convert an attribute value from the
│ configuration. This is always an error in the provider. Please report the following to the
│ provider developer:
│ 
│ Error: Value %!s(*big.Float=-10.1) is not an integer.
╵

I assume in resource_sdwan_system_basic_profile_parcel.go we should change: From:

"gps_longitude": schema.Int64Attribute{
    MarkdownDescription: helpers.NewAttributeDescription("Set the device physical longitude").AddIntegerRangeDescription(-180, 180).String,
    Optional:            true,
    Validators: []validator.Int64{
        int64validator.Between(-180, 180),
    },
},
"gps_longitude_variable": schema.StringAttribute{
    MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
    Optional:            true,
},
"gps_latitude": schema.Int64Attribute{
    MarkdownDescription: helpers.NewAttributeDescription("Set the device physical latitude").AddIntegerRangeDescription(-90, 90).String,
    Optional:            true,
    Validators: []validator.Int64{
        int64validator.Between(-90, 90),
    },
},

to:

"gps_longitude": schema.Int64Attribute{
    MarkdownDescription: helpers.NewAttributeDescription("Set the device physical longitude").AddIntegerRangeDescription(-180, 180).String,
    Optional:            true,
    Validators: []validator.Float64{
        float64validator.Between(-180, 180),
    },
},
"gps_longitude_variable": schema.StringAttribute{
    MarkdownDescription: helpers.NewAttributeDescription("Variable name").String,
    Optional:            true,
},
"gps_latitude": schema.Int64Attribute{
    MarkdownDescription: helpers.NewAttributeDescription("Set the device physical latitude").AddIntegerRangeDescription(-90, 90).String,
    Optional:            true,
    Validators: []validator.Float64{
        float64validator.Between(-90, 90),
    },
},
tzarski0 commented 1 month ago

Verified and will be fixed in 0.3.10.