Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CLI can not interpret AWS Terraform conditional statements. #6407

Closed
yemi-gbenebor opened this issue Dec 6, 2023 · 1 comment
Closed
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.

Comments

@yemi-gbenebor
Copy link

Description:

I have followed the suggested setup using: https://github.com/aws-samples/aws-sam-terraform-examples/blob/main/ga/api_gateway_v1/tf-resources/functions.tf

When I run sam local start-lambda, I get the following error:

Error: An error occurred when attempting to link two resources: Could not use the value each.value.authorizer.enabled as a destination for the source resource module.api.aws_apigatewayv2_route.route. The expected destination resources should be of destination resource type aws_apigatewayv2_authorizer. using id property.

This is due to a TF conditional statement, I would expect SAM CLI to download the TD module used and correctly interpret conditional instead, it thinks the conditional is the input value.

Steps to reproduce:

Observed result:

Expected result:

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:
  2. sam --version:
  3. AWS region:
# Paste the output of `sam --info` here

Add --debug flag to command you are running

@yemi-gbenebor yemi-gbenebor added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Dec 6, 2023
Copy link
Contributor

github-actions bot commented Dec 6, 2023

⚠️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
Labels
stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

No branches or pull requests

1 participant