Reputation: 25731
So before I begin full on coding going down the wrong path, I'm looking into Angular Universal be the SSR and reading on AWS docs to do it. The SSR is mainly for speed and for Googlebot/SEO.
I am reading the white paper here:
AWS Serverless Multi-Tier Architectures with Amazon API Gateway and AWS Lambda
I love this approach but I am missing two things in the diagram that I need research on:
The AWS docs I've read say push it to AWS Lambda with the AWS CLI which includes some TS files (lambda.ts) and such.
Side note: I haven't use AWS in this full capacity yet and trying to figure out how to integrate the enviornment I want based on my needs outlined above.
Upvotes: 0
Views: 1626
Reputation: 2913
I want to have my own auth with AWS Cognito (and maybe a third-party identity manager like Google or GiHub added latter)
AWS API gateway supports integration with AWS Cognito.
For REST API Gateways: Control access to a REST API using Amazon Cognito user pools as authorizer
For HTTP API Gateways: Controlling access to HTTP APIs with JWT authorizers (You can use Amazon Cognito as a JWT issuer: Reference)
Where does the SSR pages go?
The most conventional architecture is to build your Angular project and convert it to static files (using Webpack or other means), upload the static output files to S3, and then serve the static files via CloudFront (recommended) or directly from S3. This is the architecture depicted in the linked AWS Whitepaper and the diagram.
The AWS docs I've read say push it to AWS Lambda with the AWS CLI which includes some TS files (lambda.ts) and such.
- does this make the bucket obsolete and not used for the SPA?
Yes, if you use the approach you are describing here, you won't be using S3. Instead, you would be serving your SPA through API Gateway.
Upvotes: 1