Skip to content

Instantly share code, notes, and snippets.

@franzwong
Last active January 24, 2019 10:17
Show Gist options
  • Save franzwong/b36b8b7daab047b76cab4e3d86a55bac to your computer and use it in GitHub Desktop.
Save franzwong/b36b8b7daab047b76cab4e3d86a55bac to your computer and use it in GitHub Desktop.
HowTo: Grant IAM role to Cognito authenticated user
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {"Federated": "cognito-identity.amazonaws.com"},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {"cognito-identity.amazonaws.com:aud": "<IDENTITY_POOL_ID>"},
"ForAnyValue:StringLike": {"cognito-identity.amazonaws.com:amr": "authenticated"}
}
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment