Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serverless-compose #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

volenpopov
Copy link

#15

This PR:

  • introduces serverless-compose (meant to simplify orchestrating multiple services)
  • removes the UserPoolId and UserPoolClientId SSM parameter resources and instead uses CloudFormation outputs. The cross service output referencing is easily done through serverless-compose.

I proceeded as following, in order to see whether these changes can be a solution to issue #15

  • recreating the userpool (honestly there was no easy way to recreate it), so I had to:
    • manually delete the userpool from the AWS console
    • in auth/serverless.yaml comment out all the UserPool related resources and outputs (note: there is also an environment variable called CLIENT_ID that also needs to be commented out)
    • in the auth folder run npx serverless deploy
    • in auth/serverless.yaml bring back the UserPool related resources and outputs by removing the comments you made in the previous steps
    • again in the auth folder run npx serverless deploy
  • at the root of the project run npx serverless refresh-outputs
  • at the root of the project run npx serverless deploy

The API Gateway Authorizer should now reflect the updated values (Issuer which is a string containing your UserPoolId, and Audience, which is the UserPoolClientId)

@eoinsha
Copy link
Collaborator

eoinsha commented Feb 10, 2023

Thanks for the great idea for simplifying deployment, @volenpopov and sorry it took so long to get back to you.
I tried out deployment and noticed a couple of things we need to check first.

  1. Each serverless.yml loads the stage from config.cjs. When I deploy with serverless compose, this seems to be ignored and the deployment always goes to dev. Is there a way to get serverless-compose.yml to load the stage from config.cjs too?
  2. The change to use CF outputs for User Pool identifiers is more CloudFormation means that sls info does not work in the parent directory or in, say, the backend subfolder. I'm not always keen to use CloudFormation outputs because of the "hard" nature of these dependencies. SSM Parameters also allows the flexibility to delete stacks in any order. Would it be okay to separate out the CloudFormation output idea and just use serverless compose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants