Skip to content

Commit 2819138

Browse files
committed
Update README
1 parent 86af7e2 commit 2819138

File tree

1 file changed

+62
-10
lines changed

1 file changed

+62
-10
lines changed

README.md

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ Apart from the SaaS version of the ServerlessDebugger, we offer a way to install
88

99
You would need a couple of things ready before you start running commands.
1010

11-
1. NodeJS and NPM
11+
1. NodeJS and
12+
- See [nodejs.org/en/download/](https://nodejs.org/en/download/) for installation.
13+
- Installation through [Node Version Manager](https://github.com/nvm-sh/nvm) is recommended.
1214
2. Install NPM package for AWS CDK
15+
- See [github.com/aws/aws-cdk](https://github.com/aws/aws-cdk) for installation
1316
- This project currently uses v2.27.0.
14-
3. AWS Account and AWS CLI
17+
+ `npm install -g [email protected]` to install the minimum version required.
18+
3. AWS Account
19+
- Create an account from [AWS Console](https://aws.amazon.com/).
20+
4. AWS CLI
21+
- See [AWS CLI Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) for more information about the installation.
22+
- See [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) for more information about the configuration.
1523

1624
# Installation
1725

@@ -23,30 +31,74 @@ You can start by just copying the `sample.env` as `.env` and move on from there.
2331
cp sample.env .env
2432
```
2533

26-
In the `.env` file, we've documented which variables are needed and why. Some parts of this stack is optional and some are required. See [below](#environment-variables) for more details.
34+
In the `.env` file, we've documented which variables are needed and why. Some parts of this stack is optional and some are required. `SUBNET_IDS` and `THUNDRA_LICENSE_KEY` must be specified in the `.env` file. See [below](#environment-variables) for more details.
2735

2836
Once the necessary environment variables are set, you can run the following commands in order.
2937

3038
```bash
31-
npm install # To install the necessary dependencies.
32-
cdk bootstrap # To prepare the AWS account with CDK Toolkit.
33-
cdk synth # To see if the stack synthesises without any problem.
34-
cdk deploy # To deploy the stack on the AWS account.
39+
# To install the necessary dependencies.
40+
npm install
41+
42+
# To prepare the AWS account with CDK Toolkit.
43+
# This command will create or update CDK Toolkit stack
44+
# on the AWS Region you're deploying.
45+
cdk bootstrap
46+
47+
# To see if the stack synthesises without any problem.
48+
# This will print out a YAML/JSON of this CDK application
49+
# as CloudFormation template.
50+
cdk synth
51+
52+
# To deploy the stack on the AWS account.
53+
cdk deploy
54+
```
55+
56+
Once the stack creation finished successfully, the stack will print out the access URLs and ports for the ServerlessDebugger broker. The stack will output protocol `ws://` and port `80` for HTTP use. Similarly, `wss://` and port `443` for HTTPS.
57+
58+
```bash
59+
Outputs:
60+
# ws:// for HTTP
61+
sls-debugger-main-stack.slsdbrokerexternalurldev = wss://<INTERNET_FACING_URL>
62+
sls-debugger-main-stack.slsdbrokerinternalurldev = wss://<INTERNAL_URL>
63+
# 80 for HTTP
64+
sls-debugger-main-stack.slsdbrokerportdev = 443
3565
```
66+
After getting the URLs, update your `debug-client.json` by using the `Serverless Debugger: Edit configuration` command of the ServerlessDebugger's [VSCode Extension](https://github.com/serverlessdebugger/serverlessdebugger-vscode-extension).
67+
68+
```json
69+
{
70+
"profiles": {
71+
"default": {
72+
"debugger": {
73+
// ...
74+
"brokerHost": "<SET_INTERNET_FACING_URL>",
75+
"brokerPort": 443 // or 80 for HTTP
76+
}
77+
}
78+
}
79+
}
80+
```
81+
82+
In your Lambda function, set the `THUNDRA_AGENT_LAMBDA_DEBUGGER_BROKER_HOST` environment variable to **either** Internet Facing URL or the Internal URL of the broker, depending on your Lambda's network configuration. **You don't need to update port value for your Lambda function**.
83+
84+
If you encounter any issue or need any help, feel free to reach out to us.
3685

3786
# What's in this CDK?
3887

3988
In this stack, there are various recources at play. In no particular order, the main resources includes the following;
4089

4190
1. One AWS ECS Cluster
91+
- A **Task Definition** with the following resources
92+
+ 0.25 vCPU
93+
+ 512 MiB Memory
4294
2. One AWS Fargate Service
4395
3. One Internal ELB
4496
- Internal Application Load Balancer
4597
- With necessary Target Groups and Listeners
4698
4. One External ELB
4799
- Internet Facing Application Load Balancer
48100
- With necessary Target Groups and Listeners
49-
5. DNS Records to set custom domain
101+
5. (Optional) DNS Records to set custom domain
50102

51103
In an architectural view, self-hosted version can be used in multiple ways depending on whether your lambdas are in a VPC or not. See the below image to have an understanding of what's going on. If you encounter any issue or have feedbacks, don't hesitate to [contact us](https://serverlessdebugger.com/contact-us).
52104

@@ -56,13 +108,13 @@ In an architectural view, self-hosted version can be used in multiple ways depen
56108

57109
| Variable Name | Expectation | Default | Requires | Description |
58110
|--- |--- |--- |--- |--- |
111+
| SUBNET_IDS | **Required** | - | At least 2 subnet ids | Subnets to use to deploy the application. Requires at least 2 subnet ids. |
112+
| THUNDRA_LICENSE_KEY | **Required** | - | - | Thundra License Key for the self-hosted ServerlessDebugger. [Contact Us](https://www.serverlessdebugger.com/contact-us) if needed. |
59113
| STAGE | Optional | dev | - | Sets a suffix to all the resources. Used to separate environments, such as dev, staging, prod. Beware of that some resources have a name limitation of 32 characters. Can set this to and empty string. |
60114
| ENTITY_PREFIX | Optional | slsd | - | Sets a prefix to all the resources. Used to differentiate ServerlessDebugger resources from others. Beware of that some resources have a name limitation of 32 characters. Can set this to and empty string. |
61115
| USE_HTTPS | Optional | false | - | Decide if the broker endpoints should use SSL encryption. Expects `SSL_CERTIFICATE_ARN`. |
62116
| SSL_CERTIFICATE_ARN | Optional | - | USE_HTTPS | Requires `USE_HTTPS` to be set to true. We expect customers to create and manage their own SSL certification. |
63117
| VPC_ID | Optional | Default VPC | - | VPC to use to deploy the application. If it's not given, stack will use the default VPC. |
64-
| SUBNET_IDS | **Required** | - | At least 2 subnet ids | Subnets to use to deploy the application. Requires at least 2 subnet ids. |
65-
| THUNDRA_LICENSE_KEY | **Required** | - | - | Thundra License Key for the self-hosted ServerlessDebugger. [Contact Us](https://www.serverlessdebugger.com/contact-us) if needed. |
66118
| CREATE_DNS_MAPPING | Optional | false | - | Sets a custom domain for the self-hosted broker. |
67119
| HOSTED_ZONE_NAME | Optional | - | CREATE_DNS_MAPPING | Hosted zone name to use. Requires `CREATE_DNS_MAPPING` to be set to true. |
68120
| BROKER_PUBLIC_SUBDOMAIN | Optional | - | CREATE_DNS_MAPPING | Subdomain for the internet facing ELB to use. Requires `CREATE_DNS_MAPPING` to be set to true. |

0 commit comments

Comments
 (0)