Skip to content
Snippets Groups Projects
Commit 63768638 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

caching betinget av api-nøkkel

parent 90caa553
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,19 @@ Resources: ...@@ -137,7 +137,19 @@ Resources:
Type: "ALLOW" Type: "ALLOW"
Priority: 5 Priority: 5
RuleId: !Ref APIRule RuleId: !Ref APIRule
APICachePolicy:
Type: "AWS::CloudFront::CachePolicy"
Properties:
CachePolicyConfig:
DefaultTTL: 10800
MaxTTL: 28800
MinTTL: 60
Name: "APICachePolicy"
ParametersInCacheKeyAndForwardedToOrigin:
HeadersConfig:
HeaderBehavior: whitelist
Headers:
- "x-api-key"
Distribution: Distribution:
Type: "AWS::CloudFront::Distribution" Type: "AWS::CloudFront::Distribution"
Properties: Properties:
...@@ -185,9 +197,7 @@ Resources: ...@@ -185,9 +197,7 @@ Resources:
- OPTIONS - OPTIONS
- PUT - PUT
- PATCH - PATCH
MaxTTL: 28800 CachePolicyId: !Ref APICachePolicy
DefaultTTL: 10800
MinTTL: 60
TargetOriginId: OrdbokCache TargetOriginId: OrdbokCache
LambdaFunctionAssociations: LambdaFunctionAssociations:
- EventType: viewer-request - EventType: viewer-request
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment