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

feat: Allow specifing custom origins #78

Merged
merged 3 commits into from
Jun 27, 2020

Conversation

k911
Copy link
Contributor

@k911 k911 commented Mar 26, 2020

what

  • allow specifing/creating (additional) custom origins

why

  • This module is really useful for front-end website deployments but sometimes it is required to use the same domain for front-end and back-end (different paths) or add some back-end functionality to front-end website without creating real back-end
  • To configure API Gateway easily
  • We already have the ability to configure ordered_cache_behaviour so we technically support multiple strategies for different paths

references

example usage

module "cloudfront-s3" {
# ...
  ordered_cache = [{
    target_origin_id            = "api-gateway-with-lambda"
    path_pattern                = "/v1/lambda"
    allowed_methods             = ["HEAD", "GET"]
    cached_methods              = ["HEAD", "GET"]
    compress                    = true
    viewer_protocol_policy      = "redirect-to-https"
    min_ttl                     = 0
    default_ttl                 = 60
    max_ttl                     = 3600
    forward_header_values       = []
    forward_query_string        = true
    forward_cookies             = "none"
    lambda_function_association = []
  }]

  custom_origins = [{
    domain_name = "xxxxxxxxxx.execute-api.us-east-1.amazonaws.com"
    origin_id   = "api-gateway-with-lambda"
    origin_path = null
    custom_origin_config = {
      http_port                = 80
      https_port               = 443
      origin_protocol_policy   = "https-only"
      origin_ssl_protocols     = ["TLSv1.2"]
      origin_keepalive_timeout = 5
      origin_read_timeout      = 30
    }
  }]
}

@k911 k911 force-pushed the feat/custom-origins branch from f38eda8 to 43f75b8 Compare March 26, 2020 15:24
@Gowiem Gowiem requested a review from a team as a code owner June 27, 2020 18:00
@Gowiem Gowiem requested review from adamcrews and nitrocode and removed request for a team June 27, 2020 18:00
@Gowiem
Copy link
Member

Gowiem commented Jun 27, 2020

/rebuild-readme

@Gowiem
Copy link
Member

Gowiem commented Jun 27, 2020

/test all

@Gowiem Gowiem merged commit a1ad726 into cloudposse:master Jun 27, 2020
@Gowiem
Copy link
Member

Gowiem commented Jun 27, 2020

@k911 Thanks for the contribution! Released as 0.26.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants