Skip to content

Allow ResourceName to be a list such that one API can map to multiple resources #1917

Closed
aws-controllers-k8s/code-generator
#472
@Vandita2020

Description

@Vandita2020

Is your feature request related to a problem?

Allow ResourceName to be a list so that one API for an OperationType can map to multiple resources. This is required in certain cases where the same API, for same operation is used for multiple resources.

The feature is requested to solve the problem of assigning one API used for delete operation to more than one resource. The API used is DeleteFunction API and we want it to use for both Function and Version resource. As Version is a snapshot of a function code and configuration, it is deleted by calling the same API which is used to delete function, with an addition of mentioning version number along with the function name.

Describe the solution you'd like

The solution we would like to go with is to pass multiple resources for same API.

This should support cases:

  1. One API -> One Resource
PublishVersion:
    operation_type:
      - Create
    resource_name: 
      - Version
  1. One API -> Multiple Resource
DeleteFunction:
      operation_type:
        - Delete
      resource_name:
        - Function
        - Version
      

Describe alternatives you've considered

The alternate solution to support our case was to create custom delete_operation functionality similar to custom find_operation.

Version:
  delete_operation:
     custom_method_name: customDeleteFunction

However this changes could be long and can be ignored if we go with the first solution.

Metadata

Metadata

Assignees

Labels

area/code-generationIssues or PRs as related to controllers or docs code generationkind/enhancementCategorizes issue or PR as related to existing feature enhancements.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions