Update Custom Options during Workflow executions

Greetings Team,

We are looking forward to update custom options based on the task execution in a configuration phase. E.g., we have a task to get an IP address through an external API call from a particular subnet. We wanted to update the new IP address leased from IPAM tool after we receive an output through the API call task.

How do update an existing custom options with the results received through tasks executed in workflows of every stage like configuration, pre-provision, provision and post-provision? Would be helpful if we get a good reference code or a sample video to explore on updating the payload during the workflows executions.

Below is a template parameter code, I want to get that updated as well in the configuration phase with new set of values (E.g., updating a instance_type or hostname) before Terraform gets executed in the pre-provisioning phase.

Also, can I create a new variable and add it to Template parameter during the configuration phase? Say E.g., VPC_Security_groups=sgXXXXXXXXX passed directly from configuration phase.


@Venkat Some examples: Edit Instance Configuration Before Deployment