mirror of
https://github.com/protomaps/PMTiles.git
synced 2026-02-04 10:51:07 +00:00
AWS updates (#447)
* AWS updates * CloudFormation stack parameter for changing CloudFront tile cache TTL. * S3 requests are always set as Requester Pays, enabling fetching from buckets in other accounts.
This commit is contained in:
@@ -2,10 +2,15 @@ AWSTemplateFormatVersion: '2010-09-09'
|
||||
Description: Serve Z/X/Y tiles through CloudFront + Lambda from an existing S3 bucket.
|
||||
Parameters:
|
||||
BucketName:
|
||||
Description: 'Name of an existing S3 bucket with .pmtiles tilesets. Should be in the same region as your CloudFormation stack.'
|
||||
Description: 'Name of an existing S3 bucket with .pmtiles tilesets. Should be in the same region as your CloudFormation stack. Can be a RequesterPays bucket in another account.'
|
||||
Type: String
|
||||
MinLength: 1
|
||||
|
||||
DefaultTTL:
|
||||
Description: Default time-to-live for cached tiles in the CloudFront distribution.
|
||||
Type: Number
|
||||
Default: 86400
|
||||
|
||||
AllowedOrigins:
|
||||
Description: 'Comma-separated list of domains (e.g. example.com) allowed by browser CORS policy, or * for all origins.'
|
||||
Type: List<String>
|
||||
@@ -17,11 +22,12 @@ Parameters:
|
||||
|
||||
Outputs:
|
||||
CloudFrontDistributionUrl:
|
||||
Description: 'URL of the CloudFront distribution'
|
||||
Description: 'URL of the CloudFront distribution for cached tiles.'
|
||||
Value: !Sub "https://${CloudFrontDistribution.DomainName}"
|
||||
Export:
|
||||
Name: !Sub "${AWS::StackName}-CloudFrontDistributionURL"
|
||||
|
||||
|
||||
Conditions:
|
||||
IsPublicHostnameProvided:
|
||||
Fn::Not:
|
||||
@@ -127,7 +133,7 @@ Resources:
|
||||
Properties:
|
||||
CachePolicyConfig:
|
||||
Name: !Sub "${AWS::StackName}-CachePolicyConfig"
|
||||
DefaultTTL: 86400
|
||||
DefaultTTL: !Ref DefaultTTL
|
||||
MaxTTL: 31536000
|
||||
MinTTL: 0
|
||||
ParametersInCacheKeyAndForwardedToOrigin:
|
||||
|
||||
Reference in New Issue
Block a user