You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat go.mod | grep terraform-plugin-sdk
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.0
$ terraform version
Terraform v1.4.2
on darwin_arm64
Your version of Terraform is out of date! The latest version
is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html
$ terraform version -json
{
"terraform_version": "1.4.2",
"platform": "darwin_arm64",
"provider_selections": {},
"terraform_outdated": true
}
Description
Our API returns type of any for a specific field, which can be string, int, or bool. However, it seems that the current implementation of the provider SDK does not support this (as we need to specify one primitive type). We need to find a way to handle fields of type string, int, or bool interchangeably.
Expected Behavior:
The Terraform provider SDK should provide support for fields that can accept values of multiple types, such as string, int, or bool.
Steps to Reproduce:
Specify a resource with a field that can accept values of multiple types (string, int, bool) in the Terraform provider SDK.
Attempt to create or update the resource with values of different types for the field.
Observe that the provider SDK throws an error or fails to handle the field correctly.
Actual Behavior:
The Terraform provider SDK does not support fields of type any, causing errors or incorrect handling when attempting to create or update resources with fields that can accept values of multiple types.
Relevant Provider Source Code
"basic_expressions": {
Description: "The basic expression which needs to be evaluated to be true for this rule to apply.",
Type: schema.TypeList,
Optional: true,
MinItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
....
"rhs": {
Description: "right hand side value",
Type: schema.TypeString, # API can respond with string, int or bool
Required: true,
},
},
},
},
Error while importing using Terraformer
2023/06/02 17:40:09 WARN: Fail read resource from provider, wait 300ms before retry
2023/06/02 17:40:09 json: cannot unmarshal number into Go struct field TaggingRuleCondition.data.rules.basic_expression.rhs of type string
2023/06/02 17:40:09 WARN: Fail read resource from provider, wait 300ms before retry
2023/06/02 17:40:10 json: cannot unmarshal number into Go struct field TaggingRuleCondition.data.rules.basic_expression.rhs of type string
2023/06/02 17:40:10 WARN: Fail read resource from provider, wait 300ms before retry
2023/06/02 17:40:10 json: cannot unmarshal number into Go struct field TaggingRuleCondition.data.rules.basic_expression.rhs of type string
2023/06/02 17:40:10 WARN: Fail read resource from provider, wait 300ms before retry
2023/06/02 17:40:10 json: cannot unmarshal number into Go struct field TaggingRuleCondition.data.rules.basic_expression.rhs of type string
2023/06/02 17:40:10 WARN: Fail read resource from provider, wait 300ms before retry
The text was updated successfully, but these errors were encountered:
SDK version
Description
Our API returns type of
any
for a specific field, which can bestring
,int
, orbool
. However, it seems that the current implementation of the provider SDK does not support this (as we need to specify one primitive type). We need to find a way to handle fields of typestring
,int
, orbool
interchangeably.Expected Behavior:
The Terraform provider SDK should provide support for fields that can accept values of multiple types, such as
string
,int
, orbool
.Steps to Reproduce:
Specify a resource with a field that can accept values of multiple types (string, int, bool) in the Terraform provider SDK.
Attempt to create or update the resource with values of different types for the field.
Observe that the provider SDK throws an error or fails to handle the field correctly.
Actual Behavior:
The Terraform provider SDK does not support fields of type any, causing errors or incorrect handling when attempting to create or update resources with fields that can accept values of multiple types.
Relevant Provider Source Code
Error while importing using
Terraformer
The text was updated successfully, but these errors were encountered: