Skip to content

Commit ae261f0

Browse files
Merge branch 'fix/update-dependencies'
2 parents 066761e + 7ebf00b commit ae261f0

File tree

83 files changed

+25882
-13480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+25882
-13480
lines changed

.github/workflows/common-test.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ jobs:
567567
role-to-assume: ${{ secrets.AWS_ROLE }}
568568
role-session-name: GitHubActions
569569
- name: Setup Terraform
570-
uses: hashicorp/setup-terraform@v1
570+
uses: hashicorp/setup-terraform@v3
571571
- name: Terraform Init
572572
run: |
573573
./create_bucket.sh lld-terraform-basic
@@ -584,3 +584,59 @@ jobs:
584584
run: npx vitest --retry 1 test/terraform-basic.test.ts
585585
- name: Test - observability mode
586586
run: OBSERVABLE_MODE=true npx vitest --retry 1 test/terraform-basic.test.ts
587+
588+
test-opentofu-basic:
589+
runs-on: ubuntu-latest
590+
concurrency:
591+
group: test-opentofu-basic
592+
steps:
593+
- uses: actions/checkout@v4
594+
- name: Use Node.js
595+
uses: actions/setup-node@v4
596+
with:
597+
node-version: ${{ env.node_version }}
598+
registry-url: 'https://registry.npmjs.org'
599+
- name: Install dependencies
600+
run: |
601+
node prepareForTest.js opentofu-basic
602+
npm i
603+
- name: Download build artifact
604+
uses: actions/download-artifact@v4
605+
if: ${{ inputs.mode == 'build' }}
606+
with:
607+
name: dist
608+
path: dist
609+
- name: Install lambda-live-debugger globally
610+
if: ${{ inputs.mode == 'global' }}
611+
run: |
612+
npm i lambda-live-debugger -g
613+
working-directory: test
614+
- name: Install lambda-live-debugger locally
615+
if: ${{ inputs.mode == 'local' }}
616+
run: |
617+
npm i lambda-live-debugger
618+
working-directory: test
619+
- name: Configure AWS Credentials
620+
uses: aws-actions/configure-aws-credentials@v4
621+
with:
622+
aws-region: eu-west-1
623+
role-to-assume: ${{ secrets.AWS_ROLE }}
624+
role-session-name: GitHubActions
625+
- name: Setup OpenTofu
626+
uses: opentofu/setup-opentofu@v1
627+
- name: OpenTofu Init
628+
run: |
629+
./create_bucket.sh lld-opentofu-basic
630+
tofu init -backend-config="bucket=lld-opentofu-basic"
631+
working-directory: test/opentofu-basic
632+
- name: Destroy
633+
run: npm run destroy
634+
working-directory: test/opentofu-basic
635+
continue-on-error: true
636+
- name: Deploy
637+
run: npm run deploy
638+
working-directory: test/opentofu-basic
639+
- name: Test
640+
run: npx vitest --retry 1 test/opentofu-basic.test.ts
641+
- name: Test - observability mode
642+
run: OBSERVABLE_MODE=true npx vitest --retry 1 test/opentofu-basic.test.ts

.github/workflows/update-npm-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
for file in $package_files; do
3131
dir=$(dirname "$file")
3232
echo "Updating packages in $dir"
33-
(cd "$dir" && ncu -u)
33+
(cd "$dir" && ncu -u --reject "serverless,chokidar")
3434
done
3535
3636
- name: Install updated packages in root

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,26 @@
261261
"type": "node",
262262
"cwd": "${workspaceRoot}/test/terraform-basic"
263263
},
264+
{
265+
"name": "LLDebugger - OpenTofu basic",
266+
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
267+
"args": ["../../src/lldebugger.ts", "--config-env=test"],
268+
"request": "launch",
269+
"skipFiles": ["<node_internals>/**"],
270+
"console": "integratedTerminal",
271+
"type": "node",
272+
"cwd": "${workspaceRoot}/test/opentofu-basic"
273+
},
274+
{
275+
"name": "LLDebugger - OpenTofu basic - observability",
276+
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",
277+
"args": ["../../src/lldebugger.ts", "--config-env=test", "-o"],
278+
"request": "launch",
279+
"skipFiles": ["<node_internals>/**"],
280+
"console": "integratedTerminal",
281+
"type": "node",
282+
"cwd": "${workspaceRoot}/test/opentofu-basic"
283+
},
264284
{
265285
"name": "LLDebugger - CDK config",
266286
"program": "${workspaceRoot}/node_modules/tsx/dist/cli.mjs",

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It supports the following frameworks:
99
- AWS CDK v2
1010
- Serverless Framework v3 (SLS) and [`osls` fork](https://github.com/oss-serverless/serverless)
1111
- AWS Serverless Application Model (SAM)
12-
- Terraform
12+
- Terraform and OpenTofu
1313
- Any other framework or setup by implementing a simple function in TypeScript
1414
- ... (Need support for another framework? Let me know!)
1515

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

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

214-
### Terraform
215+
### Terraform and OpenTofu
215216

216-
Only the basic setup is supported. Check the [test case](https://github.com/ServerlessLife/lambda-live-debugger/tree/main/test/terraform-basic).
217+
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).
217218

218-
I am not a Terraform developer, so I only know the basics. Please provide a sample project so I can build better support.
219+
If you use TypeScript, Lambda Live Debugger should automatically locate source files, even when they are transpiled to JavaScript.
220+
221+
If you encounter an unsupported configuration, please open a [GitHub Issue](https://github.com/ServerlessLife/lambda-live-debugger/issues).
219222

220223
### Custom Setup
221224

0 commit comments

Comments
 (0)