Skip to content

Support timeouts attribute from the codegen framework #143

@TheNilesh

Description

@TheNilesh

Use Cases or Problem Statement

Terraform lets you set timeouts in your resource configuration. However, the Terraform Plugin Codegen Framework doesn't have a way to add timeouts in the provider_code_spec.json file. This means the framework can't generate code that looks like this:

func (t *exampleResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
    resp.Schema = schema.Schema{
        Attributes: map[string]schema.Attribute{
            /* ... */
            "timeouts": timeouts.Attributes(ctx, timeouts.Opts{
                Create: true,
            }),
        },

I don't think the framework has built-in support for timeouts. I'm curious if there is an alternative approach or workaround that would allow me to include timeouts. Is it possible to use dynamic types, object types, or any other method to read timeouts value from the resource definition?

Proposal

Modify JSON schema to include special timeouts type.

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions