crossplane / upjet

A code generation framework and runtime for Crossplane providers
Apache License 2.0
297 stars 86 forks source link

Add support for terraform plugin framework #130

Closed turkenh closed 7 months ago

turkenh commented 1 year ago

What problem are you facing?

It looks like upjet cannot generate providers built using https://github.com/hashicorp/terraform-plugin-framework

See:

How could Upjet help solve your problem?

Add support for https://github.com/hashicorp/terraform-plugin-framework

turkenh commented 1 year ago

We will most probably want to fix https://github.com/upbound/upjet/issues/131 before or together with this issue.

prafull01 commented 1 year ago

Is there any ETA on this enhancement?

I have tried the workaround mentioned in this comment and the resource generation is successful.

However, it is causing a different issue. I have nested objects in the terraform schema as follows:

"serverless": schema.SingleNestedAttribute{
                Optional: true,
                PlanModifiers: []planmodifier.Object{
                    objectplanmodifier.UseStateForUnknown(),
                },
                Attributes: map[string]schema.Attribute{
                    "spend_limit": schema.Int64Attribute{
                        Required: true,
                        PlanModifiers: []planmodifier.Int64{
                            int64planmodifier.UseStateForUnknown(),
                        },
                        MarkdownDescription: "Spend limit in US cents",
                    },
                    "routing_id": schema.StringAttribute{
                        Computed: true,
                        PlanModifiers: []planmodifier.String{
                            stringplanmodifier.UseStateForUnknown(),
                        },
                    },
                },
}

The types.go generated has the array instead of object for this but terraform expects the object.

// +kubebuilder:validation:Optional
Serverless []ServerlessParameters `json:"serverless,omitempty" tf:"serverless,omitempty"`

I expect that the ServerlessParameters should be object not an array, this is causing issues in Crossplane controller I have built.

zonybob commented 10 months ago

Will the comment made on #131 affect this and potentially allow support for terraform plugin framework? https://github.com/crossplane/upjet/issues/131#issuecomment-1755484121

zliang-akamai commented 8 months ago

Hey @turkenh, as many TF providers starts migrating to the plugin framework, may we have some updates about this issue? Thanks!

jeanduplessis commented 8 months ago

@zliang-akamai the team is actively working on Plugin Framework support for Upjet. It's turning out to be more complex than integrating with the SDK. The current estimation is that it will be ready in early February.

zliang-akamai commented 8 months ago

@jeanduplessis, thank you and the team for the effort to support the plugin framework, and that's really a good news!

jeanduplessis commented 7 months ago

With the release of Upjet 1.1.0 we now support resources implemented using the Terraform Plugin Framework.