Skip to content

Return latest version number of aws_lambda_function #21

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

Closed
wants to merge 2 commits into from

Conversation

rstml
Copy link

@rstml rstml commented Jul 4, 2022

what

To associate a lambda function to CloudFront distribution as a Lambda@Edge (using a cache behiavor's lambda_function_association block), it is required to provide a numbered version. The qualified_arn, unfortunately, always returns $LATEST which is not supported by Lambda@Edge.

why

There appears to be no easy way to query aws_lambda_function.version either.

See:
hashicorp/terraform-provider-aws#10038
hashicorp/terraform-provider-aws#25448

To associate a lambda function to CloudFront distribution as a Lambda@Edge (using a cache behiavor's lambda_function_association block), it is required to provide a numbered version. The `qualified_arn`, unfortunately, always returns `$LATEST` which is not supported by Lambda@Edge. There appears to be no easy way to query `aws_lambda_function.version` either.

See:
hashicorp/terraform-provider-aws#10038
hashicorp/terraform-provider-aws#25448
@rstml rstml requested review from a team as code owners July 4, 2022 00:08
@rstml rstml requested review from srhopkins and joe-niland July 4, 2022 00:08
@rstml
Copy link
Author

rstml commented Jul 4, 2022

Rushed with the PR. Even .version returns unsupported $LATEST qualifier. Given that this module supports lambda_at_edge parameter, I wonder how others use it for Lambda@Edge?

@rstml rstml closed this Jul 4, 2022
@rstml
Copy link
Author

rstml commented Jul 4, 2022

Figured out the root cause of the issue: #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants