Skip to content

Proposal to add "Fine Grained Update Requests" generation configuration #1598

@a-hilaly

Description

@a-hilaly

We have noticed that the Code Generator is currently generating code that includes all Custom Resource fields in update requests, even if the field values have not changed. This is causing some update requests to fail, as some APIs reject calls that attempt to set certain fields together, even if only one of them has actually changed.

This issue was observed with the mq, lambda, and eventbridge controllers, and we are aware that other controllers might be impacted as well.

We would like to request that the Code Generator consider generating code that only includes fields in update requests if their values have actually changed. One possible solution to this issue would be to add a generation configuration called fine_grained_update_requests <boolean> that instructs the code generator to generate code that checks whether a field has changed (as indicated by its inclusion in the delta object) before setting it in the SDK request. This would prevent unnecessary update requests from failing and improve the reliability of our code.

Steps to reproduce:

  • Use the Code Generator to generate code for updating a Custom Resource.
  • Observe that the generated code includes all Custom Resource fields in the update request.
  • Attempt to update a resource using the generated code, and observe that the request fails due to unnecessary fields being included.

Actual behavior:

  • Update requests currently include all Custom Resource fields, regardless of whether their values have changed. This can cause update requests to fail.

/cc @embano1 @csantanapr @jaypipes @jljaco @RedbackThomson

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/api/awsIssues or PRs related to AWS APIsarea/code-generationIssues or PRs as related to controllers or docs code generationkind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions