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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ You only need to specify the `domain` name but you can also change the default `
To deploy all the stacks you can run:

```bash
./deploy.sh
npx serverless deploy
```

> **Warning**: The first deployment will need some manual intervention. The deployment will create a new Route 53 hosted zone. You will need to make sure that the DNS are propagated correctly to that new Hosted Zone. This is something that needs to be done **DURING THE FIRST DEPLOYMENT**. In fact, the deployment will also create a certificate in ACM and it will try to validate it based on resolving some DNS on that hosted zone. Until ACM is able to validate the domain, your deployment will be pending. See below how to manually configure the Hosted zone.
Expand Down Expand Up @@ -182,7 +182,10 @@ For more info use `weshare --help`
To remove this app from this account you need to:

1. Delete all the files from your files bucket and the bucket itself
2. Run `./remove.sh` to remove all the stacks
2. To remove all the stacks run:
```bash
npx serverless remove
```
3. Clean up DNS-related changes (e.g. delegation from another hosted zone or name server configuration in your domain provider)


Expand Down
22 changes: 7 additions & 15 deletions auth/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,6 @@ resources:
CSS: ${file(./user-pool-css.cjs)}
UserPoolId: !Ref UserPool

UserPoolId:
Type: AWS::SSM::Parameter
Properties:
Name: /weshare/${sls:stage}/userPoolId
Type: String
Value: !Ref UserPool

UserPoolClientId:
Type: AWS::SSM::Parameter
Properties:
Name: /weshare/${sls:stage}/userPoolClientId
Type: String
Value: !Ref UserPoolClient

Table:
Type: AWS::DynamoDB::Table
Properties:
Expand Down Expand Up @@ -229,4 +215,10 @@ resources:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
Projection:
ProjectionType: ALL
ProjectionType: ALL

Outputs:
UserPoolId:
Value: !Ref UserPool
UserPoolClientId:
Value: !Ref UserPoolClient
12 changes: 2 additions & 10 deletions backend/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ provider:
jwtAuthorizer:
type: jwt
identitySource: $request.header.Authorization
issuerUrl: !Sub 'https://cognito-idp.${AWS::Region}.amazonaws.com/${UserPoolIdParameter}'
issuerUrl: !Sub 'https://cognito-idp.${AWS::Region}.amazonaws.com/${param:UserPoolId}'
audience:
- !Ref UserPoolClientIdParameter
- ${param:UserPoolClientId}

custom:
domainName: ${file(../config.cjs):config.domain}
Expand Down Expand Up @@ -67,14 +67,6 @@ functions:
- !Sub "arn:aws:s3:::${FileBucket}/shares/*"

resources:
Parameters:
UserPoolIdParameter:
Type: AWS::SSM::Parameter::Value<String>
Default: /weshare/${sls:stage}/userPoolId
UserPoolClientIdParameter:
Type: AWS::SSM::Parameter::Value<String>
Default: /weshare/${sls:stage}/userPoolClientId

Resources:
CustomDomainPathMapping:
Type: AWS::ApiGatewayV2::ApiMapping
Expand Down
12 changes: 0 additions & 12 deletions deploy.sh

This file was deleted.

Loading