Skip to content

[Terraform Support] Error Linking Layer to Function Using Local Variable #4396

Open

Description

@mildaniel

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.

Activity

  1. added
    stage/needs-feedbackNeeds feedback from the community (are you also interested in/experiencing this?)
    on Nov 9, 2022
  2. changed the title [-][PLACEHOLDER] Incoming Issue B[/-] [+][Terraform Support] Error Linking Layer to Function Using Local Variable[/+] on Nov 15, 2022
  3. moelasmar commented on May 12, 2023

    @moelasmar
    Contributor

    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.

  4. bnusunny commented on Nov 13, 2026

    @bnusunny
    Contributor

    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.

  5. github-actions commented on Nov 13, 2026

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/terraformterraform support issuestage/needs-feedbackNeeds feedback from the community (are you also interested in/experiencing this?)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions