I have a variable (var.http_proxy) that holds proxy details (ip address : port). I am setting env variable to a lambda and I have 2 variable , host and port. Now I need to use split the variable and assign proxy host and port instead of defining 2 new variables. I am using the code below and it is wrong -
environment = {
variables = {
proxy_host = "${split(":", var.http_proxy)[0]}"
proxy_port = "${split(":", var.http_proxy)[1]}"
}
}
The below fix resolved this -
proxy_host = "${element(split(":", var.http_proxy),0)}"
proxy_port = "${element(split(":", var.http_proxy),1)}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With