You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-10Lines changed: 62 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,18 @@ Apart from the SaaS version of the ServerlessDebugger, we offer a way to install
8
8
9
9
You would need a couple of things ready before you start running commands.
10
10
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.
12
14
2. Install NPM package for AWS CDK
15
+
- See [github.com/aws/aws-cdk](https://github.com/aws/aws-cdk) for installation
13
16
- 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.
15
23
16
24
# Installation
17
25
@@ -23,30 +31,74 @@ You can start by just copying the `sample.env` as `.env` and move on from there.
23
31
cp sample.env .env
24
32
```
25
33
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.
27
35
28
36
Once the necessary environment variables are set, you can run the following commands in order.
29
37
30
38
```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.
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.
36
85
37
86
# What's in this CDK?
38
87
39
88
In this stack, there are various recources at play. In no particular order, the main resources includes the following;
40
89
41
90
1. One AWS ECS Cluster
91
+
- A **Task Definition** with the following resources
92
+
+ 0.25 vCPU
93
+
+ 512 MiB Memory
42
94
2. One AWS Fargate Service
43
95
3. One Internal ELB
44
96
- Internal Application Load Balancer
45
97
- With necessary Target Groups and Listeners
46
98
4. One External ELB
47
99
- Internet Facing Application Load Balancer
48
100
- With necessary Target Groups and Listeners
49
-
5. DNS Records to set custom domain
101
+
5.(Optional) DNS Records to set custom domain
50
102
51
103
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).
52
104
@@ -56,13 +108,13 @@ In an architectural view, self-hosted version can be used in multiple ways depen
| 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. |
59
113
| 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. |
60
114
| 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. |
61
115
| USE_HTTPS | Optional | false | - | Decide if the broker endpoints should use SSL encryption. Expects `SSL_CERTIFICATE_ARN`. |
62
116
| 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. |
63
117
| 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. |
66
118
| CREATE_DNS_MAPPING | Optional | false | - | Sets a custom domain for the self-hosted broker. |
67
119
| HOSTED_ZONE_NAME | Optional | - | CREATE_DNS_MAPPING | Hosted zone name to use. Requires `CREATE_DNS_MAPPING` to be set to true. |
68
120
| 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