[Alpha] AWS Lambda feature server
Warning: This is an experimental feature. It's intended for early testing and feedback, and could change without warnings in future releases.
Overview
The AWS Lambda feature server is an HTTP endpoint that serves features with JSON I/O, deployed as a Docker image through AWS Lambda and AWS API Gateway. This enables users to get features from Feast using any programming language that can make HTTP requests. A local feature server is also available. A remote feature server on GCP Cloud Run is currently being developed.
Deployment
The AWS Lambda feature server is only available to projects using the AwsProvider with registries on S3. It is disabled by default. To enable it, feature_store.yaml must be modified; specifically, the enable flag must be on and an execution_role_name must be specified. For example, after running feast init -t aws, changing the registry to be on S3, and enabling the feature server, the contents of feature_store.yaml should look similar to the following:
project: dev
registry: s3://feast/registries/dev
provider: aws
online_store:
region: us-west-2
offline_store:
cluster_id: feast
region: us-west-2
user: admin
database: feast
s3_staging_location: s3://feast/redshift/tests/staging_location
iam_role: arn:aws:iam::{aws_account}:role/redshift_s3_access_role
feature_server:
enabled: True
execution_role_name: arn:aws:iam::{aws_account}:role/lambda_execution_roleIf enabled, the feature server will be deployed during feast apply. After it is deployed, the feast endpoint CLI command will indicate the server's endpoint.
Permissions
Feast requires the following permissions in order to deploy and teardown AWS Lambda feature server:
lambda:CreateFunction
lambda:GetFunction
lambda:DeleteFunction
lambda:AddPermission
lambda:UpdateFunctionConfiguration
arn:aws:lambda:<region>:<account_id>:function:feast-*
ecr:CreateRepository
ecr:DescribeRepositories
ecr:DeleteRepository
ecr:PutImage
ecr:DescribeImages
ecr:BatchDeleteImage
ecr:CompleteLayerUpload
ecr:UploadLayerPart
ecr:InitiateLayerUpload
ecr:BatchCheckLayerAvailability
ecr:GetDownloadUrlForLayer
ecr:GetRepositoryPolicy
ecr:SetRepositoryPolicy
ecr:GetAuthorizationToken
*
iam:PassRole
arn:aws:iam::<account_id>:role/
apigateway:*
arn:aws:apigateway:::/apis//routes//routeresponses
arn:aws:apigateway:::/apis//routes//routeresponses/
arn:aws:apigateway:::/apis//routes/
arn:aws:apigateway:::/apis//routes
arn:aws:apigateway:::/apis//integrations
arn:aws:apigateway:::/apis//stages//routesettings/
arn:aws:apigateway:::/apis/
arn:aws:apigateway:*::/apis
The following inline policy can be used to grant Feast the necessary permissions:
Example
After feature_store.yaml has been modified as described in the previous section, it can be deployed as follows:
After the feature server starts, we can execute cURL commands against it:
Was this helpful?