⚠️ All commands and instructions in this file assume that the current working directory is the /chat
subdirectory of the dc-api-v2
project.
This only needs to be done once.
- Pull the
miscellany
repo. - Link the development
samconfig.yaml
fileln -s /path/to/miscellany/dc-api-v2/chat/samconfig.yaml .
- Log into AWS using your
staging-admin
profile. - Pick a unique stack name, e.g.,
dc-api-chat-[YOUR_INITIALS]
- Create or synchronize the development stack
sam sync --watch --config-env dev --stack-name [STACK_NAME]
The first time the sam sync
command is run, it will build the development stack. This takes longer than it will on subsequent runs.
While the sam sync
remains open, it will keep the development stack synchronized with any code changes you make. Each time you change a file, you'll need to wait for the output of that command to indicate that resource syncing is finished.
The first time the stack is created, it will show you the stack's outputs, including the websocket URL to use for interacting with the chat backend, e.g.:
-------------------------------------------------------------------------------------------------
CloudFormation outputs from deployed stack
-------------------------------------------------------------------------------------------------
Outputs
-------------------------------------------------------------------------------------------------
Key WebSocketURI
Description The WSS Protocol URI to connect to
Value wss://nmom3hnp3c.execute-api.us-east-1.amazonaws.com/latest
-------------------------------------------------------------------------------------------------
On subsequent sync runs, the outputs will not be displayed. If you need to retrieve the value again, you can run
sam list stack-outputs --stack-name [STACK_NAME]
To stop synchronizing changes, simply terminate the sam sync
process with Ctrl+C
.
The development stack will remain up and active even after sam sync
exits; it will simply not actively synchronize changes any more. To tear it down completely, you have to delete it yourself.
- Log into AWS using your
staging-admin
profile. - Delete the development stack
sam delete --stack-name [STACK_NAME]