Added documentation for sls create_domain

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-17 15:09:19 +01:00
parent ac0717d9f3
commit f43e8fd5c5

View file

@ -106,6 +106,29 @@ Remember, the dummy JWT is meant for testing purposes only and should not be
used in production environments. The /dummy-token endpoint is not available
in non-local environments.
# Custom Domain Setup for AWS API Gateway
Before you deploy your Serverless application for the first time, you need to set up a custom domain for AWS API Gateway. This is done using the sls create_domain command, which creates a custom domain in API Gateway that your services can use.
To set up a custom domain, use the following command:
```bash
sls create_domain --stage dev --aws-profile DevAdmin --verbose
```
Replace dev with the name of the stage you're deploying to. This command only needs to be run once per custom domain,
and not every time you deploy your application. After running this command,
you can associate your AWS Lambda functions with this domain using the customDomain
configuration in your serverless.yml file.
This command requires the Serverless Domain Manager plugin,
so make sure you have it installed and properly configured in your serverless.yml file.
Please note that the process of creating and associating a custom domain can take up to 40 minutes.
Once the custom domain is created, it's immediately available for use in your Serverless applications.
Remember to replace DevAdmin with the profile that has appropriate permissions in your AWS account.
The --verbose flag is optional and is used to print detailed logs to the console.
### Thoughts for authenticating the frontend with the backend
To provide secure communication between your frontend Next.js application and your backend FastAPI service, you have several options. Here are a few popular approaches: