Hi Venkat,
You can do this in 2 ways.
First way - If your OS data can be hosted on a JSON source, you can use the REST option list and translation script. You would need to configure you JSON data as follows:
[{
“id”: 1,
“os”: “RHEL8”,
“az”: “us-east-1b”
}, {
“id”: 2,
“os”: “AL2”,
“az”: “us-east-1b”
}, {
“id”: 3,
“os”: “Windows”,
“az”: “us-east-1c”
}]
You could then use the following translation script on the operating system list:
for(var y=0;y < data.length; y++) {
if (input.az == data[y].az) {
results.push({name: data[y].os,value:data[y].os});
}}
Second way - This is more complex and requires more java scripting knowledge. This approach uses the manual option list and a mapper variable.
Create a manual option list for operating system.
In the dataset field, enter [ ] to create an empty list.
Then in the translation script, you would have to create a java script similar to this which generates the option list using the results.push method:
let mapperKey = input.az;
let mapper = {
“us-east-1b”: [
{“name”:“RHEL8”,“value”:“R8”},
{“name”:“AL2”,“value”:“A2”}
],
“us-east-1c”: [
{“name”:“Windows”,“value”:“WIN”}
],
“us-east-1d”: [
{“name”:“RHEL8”,“value”:“R8”},
{“name”:“AL2”,“value”:“A2”},
{“name”:“Windows”,“value”:“WIN”}
]
};
if (mapperKey in mapper) {
let localOptions = mapper[mapperKey];
for (let i = 0; i < localOptions.length; i++) {
results.push({“name”: localOptions[i].name, “value”: localOptions[i].value });
}
}
NOTE: In the above example, the availability input has the fieldname set to az. You also need to make the operating system input dependent on the availability zone input.