Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion .github/workflows/common-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
uses: hashicorp/setup-terraform@v3
- name: Terraform Init
run: |
./create_bucket.sh lld-terraform-basic
Expand All @@ -584,3 +584,59 @@ jobs:
run: npx vitest --retry 1 test/terraform-basic.test.ts
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 1 test/terraform-basic.test.ts

test-opentofu-basic:
runs-on: ubuntu-latest
concurrency:
group: test-opentofu-basic
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: |
node prepareForTest.js opentofu-basic
npm i
- name: Download build artifact
uses: actions/download-artifact@v4
if: ${{ inputs.mode == 'build' }}
with:
name: dist
path: dist
- name: Install lambda-live-debugger globally
if: ${{ inputs.mode == 'global' }}
run: |
npm i lambda-live-debugger -g
working-directory: test
- name: Install lambda-live-debugger locally
if: ${{ inputs.mode == 'local' }}
run: |
npm i lambda-live-debugger
working-directory: test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE }}
role-session-name: GitHubActions
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1
- name: OpenTofu Init
run: |
./create_bucket.sh lld-opentofu-basic
tofu init -backend-config="bucket=lld-opentofu-basic"
working-directory: test/opentofu-basic
- name: Destroy
run: npm run destroy
working-directory: test/opentofu-basic
continue-on-error: true
- name: Deploy
run: npm run deploy
working-directory: test/opentofu-basic
- name: Test
run: npx vitest --retry 1 test/opentofu-basic.test.ts
- name: Test - observability mode
run: OBSERVABLE_MODE=true npx vitest --retry 1 test/opentofu-basic.test.ts
2 changes: 1 addition & 1 deletion .github/workflows/update-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
for file in $package_files; do
dir=$(dirname "$file")
echo "Updating packages in $dir"
(cd "$dir" && ncu -u)
(cd "$dir" && ncu -u --reject "serverless,chokidar")
done

- name: Install updated packages in root
Expand Down
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,26 @@
"type": "node",
"cwd": "${workspaceRoot}/test/terraform-basic"
},
{
"name": "LLDebugger - OpenTofu basic",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
"args": ["../../src/lldebugger.ts", "--config-env=test"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"type": "node",
"cwd": "${workspaceRoot}/test/opentofu-basic"
},
{
"name": "LLDebugger - OpenTofu basic - observability",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
"args": ["../../src/lldebugger.ts", "--config-env=test", "-o"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal",
"type": "node",
"cwd": "${workspaceRoot}/test/opentofu-basic"
},
{
"name": "LLDebugger - CDK config",
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It supports the following frameworks:
- AWS CDK v2
- Serverless Framework v3 (SLS) and [`osls` fork](https://github.com/oss-serverless/serverless)
- AWS Serverless Application Model (SAM)
- Terraform
- Terraform and OpenTofu
- Any other framework or setup by implementing a simple function in TypeScript
- ... (Need support for another framework? Let me know!)

Expand Down Expand Up @@ -110,6 +110,7 @@ The configuration is saved to `lldebugger.config.ts`.
-m, --subfolder <subfolder> Monorepo subfolder
-o, --observable Observability mode
-i --interval <interval> Observability mode interval (default: "3000")
-a --approval User approval required for AWS infrastructure changes, like adding a Lambda layer
--config-env <evironment> SAM environment
--sam-config-file <file> SAM configuration file
--sam-template-file <file> SAM template file
Expand Down Expand Up @@ -211,11 +212,13 @@ Use the `stage` parameter to pass the stage/environment name.

Use the `config-env` parameter to pass the stage/environment name.

### Terraform
### Terraform and OpenTofu

Only the basic setup is supported. Check the [test case](https://github.com/ServerlessLife/lambda-live-debugger/tree/main/test/terraform-basic).
Multiple configurations are supported, including [serverless.tf](https://serverless.tf/) framework. You can explore [relevant test cases here](https://github.com/ServerlessLife/lambda-live-debugger/tree/main/test/terraform-basic).

I am not a Terraform developer, so I only know the basics. Please provide a sample project so I can build better support.
If you use TypeScript, Lambda Live Debugger should automatically locate source files, even when they are transpiled to JavaScript.

If you encounter an unsupported configuration, please open a [GitHub Issue](https://github.com/ServerlessLife/lambda-live-debugger/issues).

### Custom Setup

Expand Down
Loading