(This was actually from a few months ago but it was sitting in my drafts un-dated).
I'm gonna have an app that will use S3 for user content storage. Cognito's ability to generate temp security creds of the type that AWS Services understand, had me finally grudgingly yielding to the idea of poking around with it. It did not last long. The following is what happened:
(be logged into your aws management console).
OK so, within a minute of googling for cognito integrations, you run into Amplify. Which is like a dev-friendly sdk/toolkit for talking to AWS and asking it nicely to do things for us. OK So:
amplify init
UnauthRole AWS::IAM::Role CREATE_COMPLETE
AuthRole AWS::IAM::Role CREATE_COMPLETE
DeploymentBucket AWS::S3::Bucket CREATE_COMPLETE
DeploymentBucket
? Did not ask for a deployment bucket. I did not ask for any buckets! Peeked in my S3 console and sure enough, a new bucket. It seemed to just contain stack metadata tho. OK. Fair enoughnpm install aws-amplify @aws-amplify/ui-react
Steps are here.
aws-exports.js
file: so it turns out this file is auto-generated for you by Amplify.OK - this seems pretty cool; lots of heavy lifting done for you via cloudFormation. But:
Other than that, I dunno. It's... a LOT, you know? I'm also surprised at how long it took to provision initially. Like, what else is being built behind the scenes, and do I really need it? I don't want all the extra stuff. It almost manages to make auth0/okta feel like a more pleasant experience. Not sure...
Otoh, the tooling/cli is nice; it's totally in line with similar tooling for tucking away complexities that most fullstackers don't really want to be dealing with.
I actually asked someone if they remembered setting up cognito auth in the buff, sans amplify (you have to understand: I have avoided Cognito at every turn). Anyhow: we paired on it and besides a few missteps and UX glitches, we got a user pool up and running (mostly, it has to be said, from what he remembered of it, not what I remembered of it. In fact I was surprised to find an old email for my yebbie project kicking around in Cognito's memory, evidencing that I had been down this road before, before ditching it for auth0. LOL).
Regardless: This was better. Much nicer experience and waaaay less bloated. But now I'd be responsible for the integration and url redirects etc to make everything work with app endpoints. I guess that'll be my next lab on this, but the app in question is no longer a priority right now so...
To be continued.