Skip to content

Cannot create custom_origins #74

Description

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions