title: Accessing Cognito Custom Attributes in a post-confirmation lambda function
body: <p>I have a post-confirmation lambda function that writes user attribute information to a dynamoDB table. I've managed to get access to standard user attributes fields in the "event" parameter by doing stuff like </p>
  
  <pre><code>event.request.userAttributes.sub
  </code></pre>
  
  <p>but trying to run </p>
  
  <pre><code>event.request.userAttributes.role //where role is the name of my custom attribute
  </code></pre>
  
  <p>doesn't seem to work. Anyone know what the proper syntax for this is? And do I need to set any special read permissions for custom attributes? I created this custom attribute a long time after I originally made this user pool, if that changes things.</p>