RebeccaW
Enthusiast
Enthusiast

vRA 8.8 Cloud Assembly dynamicEnum with projectId as input

Have a cloud template input with the drop down options based on a vRO Action. The input for that action is projectId as it needs to be Project specific. This is fine in the custom form as it can bind to the Project and pass the value of the projectId.

However, in Cloud Assembly allegedly environment variables can be used (https://docs.vmware.com/en/vRealize-Automation/8.8/Using-and-Managing-Cloud-Assembly/GUID-12F0BC64-6...) using the syntax for example ${env. projectId}. This however does not work. 

Has anyone successfully used an environment variable in a cloud template?

Since I can get this to work in the custom form I think I'd be able to just set the input in the cloud template to string as a freetext field. However, wouldn't that mean if someone provisioned a deployment via the API instead of Service Broker they could put whatever they want? How can the input from an API call to provision a deployment be validated before it is actioned? 

0 Kudos
3 Replies
bdamian
Expert
Expert

Hi RebeccaW, two questions in your post:

  1. The custom forms works only in Service Broker. I didn't find a way to test it from Cloud Assembly.
  2. There are different APIs for Cloud Assembly y Service Broker. A typical user doesn't have access to Cloud Assembly API so there will be no problem.

---
Damián Bacalov
vExpert 2017-2018-2019-2020-2021-2022
https://www.linkedin.com/in/damianbacalov/
twitter @bdamian
Tags (1)
xian_
Expert
Expert

Hi Rebecca,

i could attach ${env.projectName} as a custom property of a resource on the cloud template, it worked.

However I was not able to use it as an action input either. Have you found a solution to your question yet?

0 Kudos
eswoodford
Contributor
Contributor

I'd be curious if your VRO action is calculating the value passed along to it. I was working on a VRO action that would validate an IP address to see if already used in vSphere when the cloud template was being used. This Action worked fairly successfully if the entire IP address was pasted in all at once, otherwise, it tried to evaluate the entry as an integer. "192.168" cannot be evaluated as a string because it's type number.

I have added a custom property via the cloud template to tag each new AWS EC2 instance with the env.deploymentId value and that works seamlessly. 

0 Kudos