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 include body for lambda function association #5681


None yet
2 participants
Copy link

commented Aug 26, 2018

Changes proposed in this pull request:

Adding support for IncludeBody option to the lambda_function_association in cloudfront which is not supported by the terraform-provider-aws for using the lamda@edge implementation.

Here's an excerpt form the documentation:

"LambdaFunctionAssociations": {
  "Items": [
     "LambdaFunctionARN": "string",
      "EventType": "viewer-request"|"viewer-response"|"origin-request"|"origin-response",
      "IncludeBody": true|false
  • add the include_body parameter in the lambda_function_association in the cloudfront resource and set the default to false.

Example taken from the web console can be seen here:

Output from acceptance testing:

please note that I had to manually adjust the timeout to 1000m because the tests where timing out due to cloudfront being slow

make testacc TESTARGS='-run=TestAccAWSCloudFrontDistribution'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSCloudFrontDistribution -timeout 1000m
?	[no test files]
=== RUN   TestAccAWSCloudFrontDistribution_importBasic
--- PASS: TestAccAWSCloudFrontDistribution_importBasic (828.70s)
=== RUN   TestAccAWSCloudFrontDistribution_S3Origin
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (805.78s)
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1028.92s)
=== RUN   TestAccAWSCloudFrontDistribution_customOrigin
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (830.72s)
=== RUN   TestAccAWSCloudFrontDistribution_multiOrigin
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (1021.48s)
=== RUN   TestAccAWSCloudFrontDistribution_orderedCacheBehavior
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (964.56s)
=== RUN   TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (2.29s)
=== RUN   TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (2.09s)
=== RUN   TestAccAWSCloudFrontDistribution_noOptionalItemsConfig
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (832.29s)
=== RUN   TestAccAWSCloudFrontDistribution_HTTP11Config
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (748.69s)
=== RUN   TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (804.62s)
=== RUN   TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (919.45s)
ok	8789.627s

parabolic added some commits Aug 26, 2018


bflad approved these changes Sep 12, 2018

Copy link

left a comment

LGTM, thanks @parabolic! 🚀

12 tests passed (all tests)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (1.36s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (1.49s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (1512.80s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (1513.44s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (1513.56s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1516.36s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (1516.43s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (1518.41s)
--- PASS: TestAccAWSCloudFrontDistribution_importBasic (1520.43s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (1521.48s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (1521.63s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (1522.50s)

@bflad bflad added this to the v1.36.0 milestone Sep 12, 2018

@bflad bflad merged commit 5228cd1 into terraform-providers:master Sep 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

bflad added a commit that referenced this pull request Sep 12, 2018


This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2018

🎉 Great, thanks @bflad!


This comment has been minimized.

Copy link

commented Sep 13, 2018

This has been released in version 1.36.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.