Based on what's described here and on other pages, I created via CDK a Cognito User Pool and an Identity Pool, and, after manually mapping the custom attributes, access is granted based on the custom attributes in the User Pool.
Now I'm trying to do everything in CDK, but I can't figure how to do the mapping of the custom attributes. The only thing I found that knows about attribute mapping is UserPoolIdentityProvider / CfnUserPoolIdentityProvider, but that is of the wrong type, and I cannot use it with a CfnIdentityPool in cognitoIdentityProviders.
I saw some unanswered posts about the same issue (this, or this), but hope dies last, so I thought maybe there will be an answer this time.
I was under the impression that everything is doable via CloudFormation, but this seems mistaken, as this post and others suggest.
So can the attribute mapping be done with CDK, or I need to use custom resources and Lambdas (or perhaps something else) if I want to automate this?