Unable to use task variables output in terraform configurations

we have a requirement to pass variables that are generated from the pre-provisiong as outputs to be passed into terraform spec templates in the provisioning phase but we are unable to use the values
we tried the below to get the values,but the values are not being derived.can you please suggest on how this can be done
taskcode is generateHostname,task name:Generate Hostname,Task result :generateHostname.Output

<%= results.generateHostname%>
<%= results[“Generate Hostname”]%>
<%= results.generateHostname.Output%>

<%= results.‘generate_hostname_output’.‘generate_hostname_output’ %>
<%= results[“Generate Hostname Output”]%>
<%= results.generateHostname.Output%>

It sounds like you’re trying to access Task results in a later phase, which is not possible. Task results can only be consumed within the same phase. One potential workaround is to use a Write Variables Task to store the results to the Instance map, then read them back into your Tasks in later phases. You can see an example of how Write Attributes works here: Using Morpheus Write Attributes Tasks and XaaS Instances | Morpheus Data - YouTube

How can we pass map to be written into write attribute, I have this printed my python task.

instance1={‘ebs_block_device_device_name’: [‘xvdf’, ‘xvdg’], ‘ebs_block_device_volume_id’: [‘vol-1234’, ‘vol-123456’], ‘ebs_block_device_volume_size’: [10, 20], ‘ebs_block_device_volume_type’: [‘gp3’, ‘gp3’], ‘ec2_test_tags_all’: {‘ApplicationDeploymentCIID’: ‘app’, ‘apple’: ‘apple’, ‘Cost’: ‘123456’, ‘Deploymenttype’: ‘newprovision’, ‘Description’: ‘Description’, ‘Name’: ‘ec2-1’, ‘ProjectCode’: ‘A123456’, ‘ProvisionType’: ‘new’, ‘RequestedBy’: ‘IOD’, ‘SharedInfrastructure’: ‘No’, ‘VCAC Owner’: ‘VCAC Owner’}, ‘iam_role’: ‘ec2-ROLE’, ‘image_id’: ‘ami-1234’}

When writing the same using write task only see part of map
{“instance_details”:“<%=results.machine_details.instance0%>”,}
‘instance_details’: “{‘ebs_block_device_device_name’: [‘xvdf’”