I’m starting this discussion to get an idea on tips, tricks and conventions when it comes to writing custom resource types.
Resource types are very appealing to support high level of customizability and use-case-specific functionality in the pipeline. I however find it a bit tricky (and error-prone) to debug and test resource types. Something as simple as putting output logs in the resource implementation would require multiple steps. So I would like to know how the community approach resource type development and if there are common conventions when it comes to debugging those custom implementations.
The way I have been doing it is:
- Develop the resource locally (as per this)
- Build the docker image of the resource
- Push the image to my dockerhub repo
- Build a test pipeline locally that includes my test resource as a resource_type
- Put the resource in action and observe output logs from there
As you can see this can be a tedious process for learning and development purposes, even if one wants to try out different features to implement in a resource type.
Any suggestions or “better” practice people could offer? What is your favorite/efficient way to write custom resources and develop new features? Are there any recommended tutorials on resource types development other than than the main docs website? Any input on this is greatly appreciated!