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

Add support for CloudFront functions #167

Merged
merged 6 commits into from
May 25, 2021

Conversation

alexjurkiewicz
Copy link
Contributor

@alexjurkiewicz alexjurkiewicz requested review from a team as code owners May 19, 2021 02:23
@alexjurkiewicz alexjurkiewicz requested review from jhosteny and adamcrews and removed request for a team May 19, 2021 02:24
@alexjurkiewicz alexjurkiewicz force-pushed the cloudfront-functions branch from bc2d51b to 28c0315 Compare May 19, 2021 03:33
This follows the naming of Terraform's AWS provider. Lambda@Edge
functions are "lambda functions", whereas CloudFront functions are
simply "functions".
@alexjurkiewicz alexjurkiewicz force-pushed the cloudfront-functions branch from 1d96fcc to ac97daa Compare May 19, 2021 03:40
@@ -462,6 +470,14 @@ resource "aws_cloudfront_distribution" "default" {
lambda_arn = lambda_function_association.value.lambda_arn
}
}

dynamic "function_association" {
for_each = lookup(ordered_cache_behavior.value, "function_association", [])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a lookup for backwards compatibility

@alexjurkiewicz
Copy link
Contributor Author

I've tested this by deploying my own distribution with an attached function 👍

@nitrocode
Copy link
Member

By adding this, shouldn't we also update the aws provider pin to > 3.41.0 ?

It would be nice to link the docs for the function_association resource argument.

@alexjurkiewicz
Copy link
Contributor Author

Thanks for the feedback, done both!

@nitrocode
Copy link
Member

/test all

@nitrocode nitrocode merged commit 13f3439 into cloudposse:master May 25, 2021
@alexjurkiewicz
Copy link
Contributor Author

thank you!

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.

3 participants