title: KnpGaufette/Symfony2/AmazonS3
body: <p>I am trying to combine Symfony2, KnpGaufetteBundle &amp; Amazon S3.
  From the KnpGaufette Bundle i got an xml definition to use for my config. But it's in xml and my config is in yml. And somehow i can't get my head around it. How do i define the following variables in yml? And what do they mean?</p>
  
  <pre><code>&lt;service id="acme.s3" class="AmazonS3"&gt;
      &lt;argument type="collection"&gt;
          &lt;argument key="key"&gt;%acme.aws_key%&lt;/argument&gt;
          &lt;argument key="secret"&gt;%acme.aws_secret_key%&lt;/argument&gt;
      &lt;/argument&gt;
  &lt;/service&gt;
  
  &lt;service id="acme.s3.adapter" class="Gaufrette\Adapter\AmazonS3"&gt;
      &lt;argument type="service" id="acme.s3"&gt;&lt;/argument&gt;
      &lt;argument&gt;%acme.s3.bucket_name%&lt;/argument&gt;
  &lt;/service&gt;
  
  &lt;service id="acme.fs" class="Gaufrette\Filesystem"&gt;
      &lt;argument type="service" id="acme.s3.adapter"&gt;&lt;/argument&gt;
  &lt;/service&gt;
  </code></pre>
  
  <hr>
  
  <h2>Update with full Solution</h2>
  
  <p>So, to actually get it working, not only do we have to put down the config in yml (which has been solved by chmeliuk -> thanks), but we also need to configure the cacert.pem file for curl.
  You can get a proper one here: <a href="http://curl.haxx.se/ca/cacert.pem" rel="nofollow">http://curl.haxx.se/ca/cacert.pem</a></p>
  
  <p>Now put this wherever you want and then use the following lines with the additional <strong>certificate_authority</strong> entry:</p>
  
  <pre><code>services:
      acme.s3:
          class: AmazonS3
          arguments:
              options: { key: %acme.aws_key%, secret: %acme.aws_secret_key%, certificate_authority: "pathWhereYouDidPutThisFile/cacert.pem" }
  
      acme.s3.adapter:
          class: Gaufrette\Adapter\AmazonS3
          arguments: 
              service: @acme.s3
              bucket_name: %acme.s3.bucket_name%
  
      acme.fs:
          class: Gaufrette\Filesystem
          arguments: 
              adapter: @acme.s3.adapter
  </code></pre>
  
  <p>This solves the CA Cert cURL Error 60 which you might have otherwise.</p>