Westy92
Westy92

Reputation: 21335

Is there a way to use AWS's sam build with OpenTofu?

I'm trying to run and debug a lambda function locally using the AWS CLI and OpenTofu. Using sam build --hook-name terraform works great. However, now that Terraform is no longer open-source, I'd like to migrate to OpenTofu. Is there a way to use sam build with an OpenTofu hook?

Upvotes: -3

Views: 256

Answers (1)

Westy92
Westy92

Reputation: 21335

Since OpenTofu is backwards-compatible with Terraform, create a symbolic link for Terraform that is actually OpenTofu.

Note: you may need to use sudo.

$ which tofu
/usr/local/bin/tofu

$ ln -s /usr/local/bin/tofu /usr/local/bin/terraform

Another option is to install Terraform locally and use Terraform for sam build.

If you are only looking to debug a TypeScript lambda locally with VSCode, follow this.

Upvotes: 1

Related Questions