From f43e8fd5c505fc351c83eda41f6b95a837b713e1 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 17 Jul 2023 15:09:19 +0100 Subject: [PATCH] Added documentation for sls create_domain --- backend/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/backend/README.md b/backend/README.md index 4cde0d5f..f68f9776 100644 --- a/backend/README.md +++ b/backend/README.md @@ -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: