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
{{ message }}
Repository navigation
[Terraform Support] Error Linking Layer to Function Using Local Variable #4396
AWS SAM CLI support for Terraform is in preview as of today. The team has worked hard to implement a solid minimum viable product (MVP) to get feedback from our community. However, there are a few caveats. Please +1 on individual items to help us prioritize these.
AWS SAM CLI does not currently support linking a Lambda Layer to a Lambda Function using Terraform local variables. Doing this will result in a LocalVariablesLinkingLimitationException. Follow this issue for updates on this feature.
You can now try to run terraform apply for your project as a workaround for this limitation issue. You do not need to apply the project with every change you made to the project like updating the lambda function code, but you need it if you added a new Lambda function or a new Lambda Layer to your project, and you faced this limitation. This workaround is supported in SAM CLI stating from version 1.83.0.
Please share with us your feedback about this workaround, and if it is a visible solution for you or not. Also, we are looking for your feedback about if you would like that SAM CLI run terraform apply on behalf of you if it detects that the project is not applied. You will be prompted for sure before applying it.
Reopened: this issue was closed by mistake during a stale-issue sweep. It was not actually waiting on more information from the reporter. Sorry for the noise.
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Activity
[-][PLACEHOLDER] Incoming Issue B[/-][+][Terraform Support] Error Linking Layer to Function Using Local Variable[/+]moelasmar commentedon May 12, 2023
You can now try to run
terraform applyfor your project as a workaround for this limitation issue. You do not need to apply the project with every change you made to the project like updating the lambda function code, but you need it if you added a new Lambda function or a new Lambda Layer to your project, and you faced this limitation. This workaround is supported in SAM CLI stating from version 1.83.0.Please share with us your feedback about this workaround, and if it is a visible solution for you or not. Also, we are looking for your feedback about if you would like that SAM CLI run
terraform applyon behalf of you if it detects that the project is not applied. You will be prompted for sure before applying it.bnusunny commentedon Nov 13, 2026
Reopened: this issue was closed by mistake during a stale-issue sweep. It was not actually waiting on more information from the reporter. Sorry for the noise.
github-actions commentedon Nov 13, 2026
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.