does it mean from General Questions Option 2 is not enough. Option 3 is actual workaround?
I wish I could say this, but it’s not. The thing is that both Options are more directions on how to deal with the firewall that protects your API from outside (the Internet). But it’s not possible to do that without changes in network configuration. Explicitly, without providing a way to access your API from the Internet.
Sorry, but not clear document, need an example or state what goes where?
It’s a workaround to solve the issue of the private DNS. Like in your case, your API has a hostname wmsx-conveyor-receiving-api.xxxxx-test.net,
but I believe that hostname is available only inside your private network (e.g., VPN). It’s impossible to get the real IP with that name outside of the Internet. It’s precisely what happens with the k6.
To avoid this private DNS issue, the k6’s can be configured:
export const options = {
hosts: {
'http://wmsx-conveyor-receiving-api.xxxxx-test.net': '1.2.3.4', // where 1.2.3.4 is a public IP of your API
},
};
And next time when the k6 should perform a call to wmsx-conveyor-receiving-api.xxxxx-test.net
, it will know that it should call the IP 1.2.3.4
.
for example, currently my swagger URL endpoint uses ip: 172.16.208.136
In that case, IP 172.16.208.136 is also the internal endpoint of your Privat Network (probably part of your AWS). And it’s not exposed to the Internet. So even the mapping from the Option 3 doesn’t help.
To sort that, I guess you have to coordinate with your DevOps (or who manages your cloud) and ask them if they can provide a way to access the API from the Internet.