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

Lambda for extensible redirect / rewrite rules #61

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module "cloudfront" {
module.waf]
cloudfront_class = var.cloudfront_class
waf_acl_arn = var.waf_enabled ? module.waf[0].waf_acl_arn : null
rewrite_rules = var.rewrite_rules
}

module "waf" {
Expand Down
13 changes: 13 additions & 0 deletions modules/cloudfront/lambda_rewrite/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

const RuleSet = require('./rules.js');

let ruleSet = new RuleSet();

module.exports.handler = (e, ctx, cb) => {
return ruleSet
.loadRules()
.then(() => {
cb(null,ruleSet.applyRules(e).res);
});
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions modules/cloudfront/lambda_rewrite/node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading