Open
Description
Describe the Bug
Cannot create a custom origin behind the default one, because
The given value is not suitable for child module variable "custom_origins" defined at .terraform/modules/cloudfront-cdn/variables.tf:327,1-26: element 0: attribute "s3_origin_config" is required.
Or when we adds3_origin_config
Error: error updating CloudFront Distribution (E2WW4FISAR8BSH): IllegalUpdate: You must specify either a CustomOrigin or an S3Origin. You cannot specify both.
Expected Behavior
We should be able to add a custom origin accordingly to the documentation
Steps to Reproduce
Add the following block to the main.tf
custom_origins = [
{
domain_name = "domain.com"
origin_id = "custom-origin-staging"
origin_path = "/staging"
custom_headers = []
custom_origin_config = {
http_port = 80
https_port = 443
origin_protocol_policy = "https-only"
origin_ssl_protocols = ["TLSv1", "TLSv1.1", "TLSv1.2"]
origin_keepalive_timeout = 5
origin_read_timeout = 30
}
}
]
Steps to reproduce the behavior:
- Run:
terraform plan
- get the error about misseds3_origin_config
option - Add required option
s3_origin_config = { origin_access_identity = "" }
- Run terraform apply and the the error from CloudFront
Error: error updating CloudFront Distribution (XXXXXXXXXXXXXX): IllegalUpdate: You must specify either a CustomOrigin or an S3Origin. You cannot specify both.
Environment
cloudposse/cloudfront-cdn/aws = 0.22.1
aws = 3.63.0
Additional Context
Maybe something is missing in my configuration, and where we can find a working example with a custom origin?
Thank you!