Transform: 'AWS::Serverless-2016-10-31' Metadata: 'AWS::ServerlessRepo::Application': Name: AthenaUDFandSageMaker Description: 'This connector enables Amazon Athena to leverage Amazon SageMaker with UDFs made available via Lambda.' Author: 'default author' SpdxLicenseId: Apache-2.0 LicenseUrl: LICENSE.txt ReadmeUrl: README.md Labels: - athena-federation HomePageUrl: 'https://github.com/awslabs/aws-athena-query-federation' SemanticVersion: 0.0.10 SourceCodeUrl: 'https://github.com/awslabs/aws-athena-query-federation' Parameters: LambdaFunctionName: Description: 'The name you will give to Lambda function which executes your UDFs. This name must satisfy the pattern ^[a-z0-9-_]{1,64}$' Type: String Default: 'athena-udf' AllowedPattern: ^[a-z0-9-_]{1,64}$ SageMakerRoleArn: Description: 'The arn of a role that can perform SageMaker functions such as start a training job' Type: String LambdaTimeout: Description: 'Maximum Lambda invocation runtime in seconds. (min 1 - 900 max)' Default: 900 Type: Number LambdaMemory: Description: 'Lambda memory in MB (min 128 - 3008 max).' Default: 3008 Type: Number Resources: ConnectorConfig: Type: 'AWS::Serverless::Function' Properties: FunctionName: !Ref LambdaFunctionName Handler: "com.amazonaws.athena.connectors.udfs.AthenaUDFHandler" CodeUri: "./target/athena-udfs-1.0.jar" Description: "This connector enables Amazon Athena to leverage Amazon SageMaker with UDFs made available via Lambda." Runtime: java8 Timeout: !Ref LambdaTimeout MemorySize: !Ref LambdaMemory Environment: Variables: SAGEMAKER_ROLE_ARN: !Ref SageMakerRoleArn Policies: - Statement: - Effect: "Allow" Action: - "sagemaker:CreateTrainingJob" Resource: "*" - Effect: "Allow" Action: - "iam:PassRole" Resource: !Ref SageMakerRoleArn Version: '2012-10-17'