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

Generic support for API-side validation via validate_only param or similar #20713

Open
melinath opened this issue Dec 17, 2024 · 3 comments
Open
Labels
mmv1-generator Provider-wide changes to resource templates or other generator changes size/m technical-debt
Milestone

Comments

@melinath
Copy link
Collaborator

What kind of contribution is this issue about?

MMv1-based resource

Details

AIP-163 gives guidelines for how APIs can provide a mechanism to validate requests. Most APIs do not implement this AIP. For APIs that do implement it (or something similar), I believe we could add support for calling it during the plan computation process (since it looks like we have access to configured clients from CustomizeDiff).

At a minimum, it would be good to choose three resources that support validate_only and implement & document something that works for all of them. It could be a flag in MMv1, or it could be a shared helper function - maybe even a CustomizeDiff function if there were a way to make a generic one that just gets plugged in.

References

#20641

@melinath melinath changed the title Generated support for API-side validation via validate_only param or similar Generic support for API-side validation via validate_only param or similar Dec 17, 2024
@rileykarson
Copy link
Collaborator

I'm not sure if many APIs have supported this, and I'm unsure if they'd support unknown values, which would be important for proper support on our end.

@rileykarson rileykarson added the mmv1-generator Provider-wide changes to resource templates or other generator changes label Jan 6, 2025
@rileykarson rileykarson added this to the Backlog milestone Jan 6, 2025
@rileykarson
Copy link
Collaborator

note: size/m to implement on our side, but API-side implementation that we can hook into generically is size/xxxxxl or something.

@melinath
Copy link
Collaborator Author

melinath commented Jan 6, 2025

A lack of support for unknown values might be acceptable, since I think we could automatically ignore validation errors for those fields on the Terraform side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mmv1-generator Provider-wide changes to resource templates or other generator changes size/m technical-debt
Projects
None yet
Development

No branches or pull requests

2 participants