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

Support timeouts attribute from the codegen framework #143

Open
1 task done
TheNilesh opened this issue Jun 12, 2024 · 0 comments
Open
1 task done

Support timeouts attribute from the codegen framework #143

TheNilesh opened this issue Jun 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@TheNilesh
Copy link

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
@TheNilesh TheNilesh added the enhancement New feature or request label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant