title: AWS "Missing required client configuration options" exception with Yii::createObject() default configuration
body: <p>I'm trying to get a simple web application working with the Yii 2 framework, a DynamoDB database hosted on AWS and the AWS SDK for PHP. I'm just saving/retrieving movie details to/from the database.</p>
  
  <p>(For the purposes of copying code here, I am not going to copy my real AWS key/secret.)</p>
  
  <p>Everything works as I want when I create my Aws\Sdk object like this:</p>
  
  <pre><code>$sdk = new Aws\Sdk([
      'region'   =&gt; 'us-west-2',
      'version'  =&gt; 'latest',
      'credentials' =&gt; [
          'key'     =&gt; 'KEYKEYKEYKEYKEYKEYKE',
          'secret'  =&gt; 'SECRETSECRETSECRETSECRETSECRETSECRETSECR'
      ]
  ]);
  $dynamodb = $sdk-&gt;createDynamoDb();
  </code></pre>
  
  <p>But I want to take advantage of Yii's <em>default configurations</em> with the Yii::createObject() method, so that I don't have to specify the region, version and credentials every place I create an Aws\Sdk object. So, as per the <a href="http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html#default-configurations" rel="nofollow noreferrer">Yii documentation</a>, I have saved into my application configuration:</p>
  
  <pre><code>\Yii::$container-&gt;set('Aws\Sdk', [
      'region'      =&gt; 'us-west-2',
      'version'     =&gt; 'latest',
      'credentials' =&gt; [
          'key'     =&gt; 'KEYKEYKEYKEYKEYKEYKE',
          'secret'  =&gt; 'SECRETSECRETSECRETSECRETSECRETSECRETSECR'
      ]
  ]);
  </code></pre>
  
  <p>and now wherever I create an Aws\Sdk object, my code looks like this:</p>
  
  <pre><code>$sdk = Yii::createObject('Aws\Sdk');
  $dynamodb = $sdk-&gt;createDynamoDb();
  </code></pre>
  
  <p>However, when I do it like this, I get an InvalidArgumentException from AWS about "Missing required client configuration options". If I <code>var_dump()</code> the <code>$sdk</code> variable immediately after it is assigned, I can see that the object has the required region, version and credentials attributes, but the next line where I assign the <code>$dynamodb</code> variable throws the exception.</p>
  
  <p>I am hoping that someone can show me where I am going wrong.</p>