forked from aws-samples/amazon-location-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amazon-location-udfs.yaml
75 lines (75 loc) · 2.58 KB
/
amazon-location-udfs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
Transform: AWS::Serverless-2016-10-31
Metadata:
'AWS::ServerlessRepo::Application':
Name: AmazonLocationUDFs
Description: Call Amazon Location APIs from Amazon Athena as user-defined functions.
Author: Amazon Location Service
SpdxLicenseId: MIT-0
LicenseUrl: LICENSE
ReadmeUrl: README.md
Labels:
- athena-federation
- amazon-location
HomePageUrl: https://github.com/aws-samples/amazon-location-samples/tree/main/athena-udfs
SemanticVersion: 1.0.1
SourceCodeUrl: https://github.com/aws-samples/amazon-location-samples/tree/main/athena-udfs
Parameters:
DataSource:
Description: The data source to use when geocoding ("Esri" or "Here")
Type: String
Default: Esri
AllowedValues:
- Esri
- Here
ReservedConcurrentExecutions:
Description: Lambda concurrency. More is not necessarily better, as functions may be rate-limited by Amazon Location.
Type: Number
Default: 10
LambdaFunctionName:
Description: The name you will give to Lambda function which executes your UDFs.
Default: amazon_location
Type: String
AllowedPattern: ^[a-z0-9-_]{1,64}$
LambdaTimeout:
Description: Maximum Lambda invocation runtime in seconds (1 - 900); UDF calls are handled sequentially by a shared set of invocations.
Default: 900
Type: Number
LambdaMemory:
Description: Lambda memory in MB (128 - 10240).
Default: 512
Type: Number
Resources:
PlaceIndex:
Type: AWS::Location::PlaceIndex
Properties:
DataSource: !Ref DataSource
DataSourceConfiguration:
IntendedUse: Storage
Description: Place index for use by Amazon Athena
IndexName:
Fn::Sub: ${AWS::StackName}
PricingPlan: RequestBasedUsage
ConnectorConfig:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Ref LambdaFunctionName
Handler: aws.samples.amazonlocation.AmazonLocationUDFHandler
ReservedConcurrentExecutions: !Ref ReservedConcurrentExecutions
CodeUri: ./target/athena-udfs-1.0-SNAPSHOT.jar
Description: This connector enables Amazon Athena to call Amazon Location APIs as UDFs.
Runtime: java11
Timeout: !Ref LambdaTimeout
MemorySize: !Ref LambdaMemory
Environment:
Variables:
PLACE_INDEX_NAME:
Ref: PlaceIndex
Policies:
- Statement:
- Action:
- geo:SearchPlaceIndex*
Effect: Allow
Resource:
- Fn::GetAtt: [PlaceIndex, Arn]