Commit af110d92 authored by Thomas Gelf's avatar Thomas Gelf
Browse files

AwsClient: allow to use a proxy

parent f2f7b46c
......@@ -12,3 +12,16 @@ access_key_id = RANDOMANFASDFNASDOFA
secret_access_key = WhatASDmn0asdnfASNDInafsdofdasJ980hansdf
```
Proxy usage
-----------
In case your server needs to use a proxy when connection to the AWS web service
please create `/etc/icingaweb2/modules/aws/config.ini` with a `network` section
like shown in this example:
```
[network]
proxy = "192.0.2.192:3128"
```
You could also pass proxy credentials in the form `user:pass@host:port`.
......@@ -4,6 +4,7 @@ namespace Icinga\Module\Aws;
use Aws\AutoScaling\AutoScalingClient;
use Aws\Common\Aws;
use Icinga\Application\Config;
class AwsClient
{
......@@ -80,10 +81,19 @@ class AwsClient
protected function initializeClient()
{
$this->client = Aws::factory([
$params = array(
'region' => $this->region,
'credentials' => $this->key->getCredentials(),
]);
);
$config = Config::module('aws');
if ($proxy = $config->get('network', 'proxy')) {
$params['request.options'] = array(
'proxy' => $proxy
);
}
$this->client = Aws::factory($params);
}
protected function prepareAwsLibs()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment