title: Mocking the AWS SDK in Golang?
body: <p>I am in a situation where I need to mock elements of the Lambda, API Gateway and S3 SDK packages for unit testing.</p>
  <p>I initially thought this wouldn't be such a bad idea but right now having to implement some in-memory data storage and mimic the entire AWS logic for those services seems impossible (or at least really time consuming).</p>
  <p>So basically my mock-implementation looks something like this</p>
  <pre><code>package awsmock
  
  type Lambda struct {
      lambda.Lambda
      data map[string]*LambdaFunction
  }
  
  func (svc *Lambda) CreateFunction(...) (...) {
      // mimic the AWS logic but save to svc.data
  }
  
  // etc
  </code></pre>
  <p>Is there any better way you could think of when it comes to mocking AWS SDK? If there isn't, I could write a library and post it on Github so other can use it and improve it too, but I hope I can manage without reimplementing this.</p>