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

Cannot create custom_origins #74

Open
air3ijai opened this issue Oct 27, 2021 · 4 comments
Open

Cannot create custom_origins #74

air3ijai opened this issue Oct 27, 2021 · 4 comments
Labels
bug 🐛 An issue with the system

Comments

@air3ijai
Copy link

air3ijai commented Oct 27, 2021

Describe the Bug

Cannot create a custom origin behind the default one, because

  1. 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 add s3_origin_config
  2. 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:

  1. Run: terraform plan - get the error about missed s3_origin_config option
  2. Add required option
    s3_origin_config = {
      origin_access_identity = ""
    }
    
  3. 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!

@air3ijai air3ijai added the bug 🐛 An issue with the system label Oct 27, 2021
@weifan01
Copy link

I have the same problem,but I didn't apply. Shouldn't custom source have origin_access_identity? Adding this config will cause my origin to be recreate.
image

@ariretiarno
Copy link

same issue

@adrianwnuk
Copy link

Same here, now way to add different origin than S3.

IllegalUpdate: You must specify either a CustomOrigin or an S3Origin. You cannot specify both.

@fszymanski-blvd
Copy link

I just ran into this. There's no documentation or examples on this use case, but I figured out the solution by looking at the code.

Set s3_origin_config = null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

5 participants