Skip to content

Instantly share code, notes, and snippets.

@bmehul
bmehul / get_pool_credentials.py
Last active August 3, 2022 20:43
Boto3: Get Pool Credentials
import boto3
import sys
def get_pool_credentials(region, identity_pool):
client = boto3.client('cognito-identity', region_name=region)
_id = client.get_id(IdentityPoolId=identity_pool)
_id = _id['IdentityId']
credentials = client.get_credentials_for_identity(IdentityId=_id)