Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device credential conversion to terraform is not working #31

Open
flyinghermit opened this issue Apr 7, 2023 · 1 comment
Open

Device credential conversion to terraform is not working #31

flyinghermit opened this issue Apr 7, 2023 · 1 comment

Comments

@flyinghermit
Copy link
Contributor

Device credential data is not getting converted to terraform. Results in null state

message DeviceCredential {
  string id = 1 [(gogoproto.jsontag) = "id"];
  bytes public_key_der = 2 [(gogoproto.jsontag) = "public_key_der"];
}
type DeviceCredential struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
	PublicKeyDer         []byte   `protobuf:"bytes,2,opt,name=public_key_der,json=publicKeyDer,proto3" json:"public_key_der"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}
@flyinghermit
Copy link
Contributor Author

Is it possibly because of issue with []byte <> string type conversion?
Here's generated schema for credential.

"credential": {
	Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{
		"id": {
			Description: "",
			Optional:    true,
			Type:        github_com_hashicorp_terraform_plugin_framework_types.StringType,
		},
		"public_key_der": {
			Description: "",
			Optional:    true,
			Type:        github_com_hashicorp_terraform_plugin_framework_types.StringType,
		},
	}),
	Description: "",
	Optional:    true,
},

Notice PublicKeyDer as StringType, though that's defined as bytes in protos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant