Our VPC requires the use of our managed HTTPS proxy for egress. I tried every possible way to set an environment variable to get the lambda to use the proxy. Nothing worked. I had to modify the code like this:
https_proxy = os.environ.get('HTTPS_PROXY')
proxy_definitions = {
'https': https_proxy,
}
config = Config(region_name=aws_region, connect_timeout=boto_timeout, retries={'max_attempts': boto_retries}, proxies_config={'proxy_use_forwarding_for_https': True}, proxies=proxy_definitions)
I'm sure this could all be made more generic so that you could control the proxy config without code changes, but I just wanted to share what worked for me.