Closed mtahaahmed closed 3 months ago
Turns out, during console testing it was adding managed origin_policy and origin_request_policy_id
Adding them in TF helped resolved the issue.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
Using these AWS docs to integrate ALB with Cloudfront:
When I tested the setup manually, it worked. The request was reaching to my ingress controller.
Upon setting up terraform, it doesn't work and gives:
I tried creating another one manually and import the resource in terraform to see if I am missing something, but it all looks same (on the origin config). Yet TF still recreates the origin and the same working cloudfront starts giving the 504 error upon applying.
⚠️ Note
Versions
Module version [Required]:
Terraform version: 1.8.0
Provider version(s): 5.51.1
Cloudfront Module https://github.com/terraform-aws-modules/terraform-aws-cloudfront (3.4.0)
Terragrunt Version v0.58.13
Reproduction Code [Required]
variables.tf:
The resource import I tried for the working CDN (which didn't work after completing the import):
Expected Behavior
Upon restoring, the origin shouldn't get recreated.