title: Cognito User Pool - Post confirmation trigger, access denied exception
body: <p>I am crating a Cognito user pool using GO SDK, I am using the API <code>CreateUserPoolInput.</code></p>
  
  <p>I have a post confirmation trigger, for this lambda function.</p>
  
  <p>So when the user confirmation happens, this lambda function is expected to trigger. </p>
  
  <p>But I am getting an error - Access denied.</p>
  
  <p>When I login to AWS console and re-configure this lambda function for this trigger, it works.</p>
  
  <p>Reference -
  <a href="https://forums.aws.amazon.com/thread.jspa?messageID=748566" rel="nofollow noreferrer">https://forums.aws.amazon.com/thread.jspa?messageID=748566</a></p>
  
  <p>I want to provide the invoke permission using the AWS APIs. </p>
  
  <p>Is there any API or code example, which I can refer to provide the required access?</p>