Hello,
We are currently developing a ForgeRock provider with the objective of creating OAuth Clients. However, we are encountering difficulties with the implementation of the import method.
In the midst of this process, we aim to exhibit the data that needs to be incorporated in the main.tf file.
Below is the struct we have at the moment:
type OAuth2ClientTF struct {
LastUpdated types.String `tfsdk:"last_updated" json:"lastUpdated"`
Name types.String `tfsdk:"name" json:"name"`
UserPasswordVersion types.Int64 `tfsdk:"user_password_version" json:"userPasswordVersion"`
AdvancedOAuth2ClientConfigTF types.Object `tfsdk:"advanced_oauth2_client_config" json:"advancedOAuth2ClientConfigTF"`
CoreOAuth2ClientConfigTF types.Object `tfsdk:"core_oauth2_client_config" json:"coreOpenIDClientConfigTF"`
CoreOpenIDClientConfigTF types.Object `tfsdk:"core_open_id_client_config" json:"coreOAuth2ClientConfigTF"`
}
In this struct, AdvancedOAuth2ClientConfigTF
, CoreOAuth2ClientConfigTF
, and CoreOpenIDClientConfigTF
are sub-structs, each comprising fields that are TF Types. Currently, we are facing a challenge in instantiating an OAuth2ClientTF
object with initialized sub-structs as they are being initialized with a nil value.
Given that we have the TF Schema (extracted from the resource.ImportStateResponse
parameter of the import method), we are curious to know if there is a feasible way to create an object directly from this schema, or if there is any alternative method to accomplish this. (We have seen the TF reflect.Into method but the package is private)
We appreciate your assistance and guidance on this matter.
Thank you.