title: AWS Cognito IAM : InvalidSmsRoleTrustRelationshipException: Role does not have a trust relationship allowing Cognito to assume the role
body: <p>I am trying to create a Cognito user Pool through a lambda function, using Go lang.</p>
  
  <p>The IAM Role, IAM policy and the Trust relationship policy is getting created successfully.</p>
  
  <p>But when I try to create the Cognito pool, I am getting an error,</p>
  
  <p><code>InvalidSmsRoleTrustRelationshipException: Role does not have a trust relationship allowing Cognito to assume the role.</code></p>
  
  <p>The trust relationship policy is</p>
  
  <pre><code>{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "Service": "cognito-idp.amazonaws.com"
        },
        "Action": "sts:AssumeRole"
      }
    ]
  }
  </code></pre>
  
  <p>The Create user Pool API call is as below -</p>
  
  <pre><code>newUserPoolData := &amp;cognitoidentityprovider.CreateUserPoolInput{
          PoolName:               aws.String(poolName),
          Policies:               &amp;userPoolPolicyType,
          AutoVerifiedAttributes: autoVerifiedAttributes,
          UsernameAttributes:     userNameAttributes,
          SmsConfiguration:       &amp;smsConfingType,
      }
  </code></pre>
  
  <p>Am I missing something here?</p>