Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
2961a518
Commit
2961a518
authored
4 years ago
by
Ole Voldsæter
Browse files
Options
Downloads
Patches
Plain Diff
la til lambdaffunksjon for å skrive om request
parent
20de7c52
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aws/beta.ordbok.uib.no_stack.yaml
+32
-0
32 additions, 0 deletions
aws/beta.ordbok.uib.no_stack.yaml
with
32 additions
and
0 deletions
aws/beta.ordbok.uib.no_stack.yaml
+
32
−
0
View file @
2961a518
...
...
@@ -38,6 +38,38 @@ Parameters:
Resources
:
###############################################################################
LambdaRole
:
Type
:
"
AWS::IAM::Role"
Properties
:
AssumeRolePolicyDocument
:
Version
:
"
2012-10-17"
Statement
:
-
Effect
:
"
Allow"
Principal
:
Service
:
-
"
lambda.amazonaws.com"
-
"
edgelambda.amazonaws.com"
Action
:
-
"
sts:AssumeRole"
RewriteLambda
:
Type
:
"
AWS::Lambda::Function"
Properties
:
Code
:
ZipFile
:
!Sub
|
'use strict';
// lambda@edge Origin Request trigger to remove the first path element
// compatible with either Node.js 6.10 or 8.10 Lambda runtime environment
exports.handler = (event, context, callback) => {
const request = event.Records[0].cf.request; // extract the request object
request.uri = request.uri.replace(/^\/[^\/]+\//,'/'); // modify the URI
return callback(null, request); // return control to CloudFront
};
Handler
:
index.handler
Role
:
!GetAtt
LambdaRole.Arn
Runtime
:
node8.10
DNS
:
Type
:
"
AWS::Route53::RecordSet"
Properties
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment