UnknownServiceError: Unknown service: 'personalize-runtime'.
See original GitHub issueHi,
I am trying to run real-time recommendations from AWS Personalize campaign in AWS Lambda following below code mentioned in the documentation .
import boto3
if __name__ == "__main__":
personalizert = boto3.client('personalize-runtime', region_name='us-west-2')
response=personalizert.get_recommendations(
campaignArn="Campaign ARN",
userId='User ID',
itemId='Item ID')
print("Recommended items")
for item in response['itemList']:
print (item['itemId'])
https://docs.aws.amazon.com/personalize/latest/dg/getting-recommendations.html
However I am getting below error:
UnknownServiceError: Unknown service: ‘personalize-runtime’. Valid service names are: acm, acm-pca, alexaforbusiness, amplify, apigateway, apigatewaymanagementapi, apigatewayv2, application-autoscaling, appmesh, appstream, appsync, athena, autoscaling, autoscaling-plans, backup, batch, budgets, ce, chime, cloud9, clouddirectory, cloudformation, cloudfront, cloudhsm, cloudhsmv2, cloudsearch, cloudsearchdomain, cloudtrail, cloudwatch, codebuild, codecommit, codedeploy, codepipeline, codestar, cognito-identity, cognito-idp, cognito-sync, comprehend, comprehendmedical, config, connect, cur, datapipeline, datasync, dax, devicefarm, directconnect, discovery, dlm, dms, docdb, ds, dynamodb, dynamodbstreams, ec2, ecr, ecs, efs, eks, elasticache, elasticbeanstalk, elastictranscoder, elb, elbv2, emr, es, events, firehose, fms, fsx, gamelift, glacier, globalaccelerator, glue, greengrass, guardduty, health, iam, importexport, inspector, iot, iot-data, iot-jobs-data, iot1click-devices, iot1click-projects, iotanalytics, kafka, kinesis, kinesis-video-archived-media, kinesis-video-media, kinesisanalytics, kinesisanalyticsv2, kinesisvideo, kms, lambda, lex-models, lex-runtime, license-manager, lightsail, logs, machinelearning, macie, marketplace-entitlement, marketplacecommerceanalytics, mediaconnect, mediaconvert, medialive, mediapackage, mediastore, mediastore-data, mediatailor, meteringmarketplace, mgh, mobile, mq, mturk, neptune, opsworks, opsworkscm, organizations, pi, pinpoint, pinpoint-email, pinpoint-sms-voice, polly, pricing, quicksight, ram, rds, rds-data, redshift, rekognition, resource-groups, resourcegroupstaggingapi, robomaker, route53, route53domains, route53resolver, s3, s3control, sagemaker, sagemaker-runtime, sdb, secretsmanager, securityhub, serverlessrepo, servicecatalog, servicediscovery, ses, shield, signer, sms, sms-voice, snowball, sns, sqs, ssm, stepfunctions, storagegateway, sts, support, swf, transcribe, transfer, translate, waf, waf-regional, workdocs, worklink, workmail, workspaces, xray
Seems like personalize-runtime service is not present in boto3 yet.
Boto3 version used = 1.9.86 Region = us-east-1
Thanks in advance.
Rohan Hodarkar
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
you’ll need to package up the service files for use in lambda, https://docs.aws.amazon.com/personalize/latest/dg/aws-personalize-set-up-aws-cli.html
you’ll typically do that via setting AWS_DATA_PATH per to point to the directory within your lambda upload that contains your uploaded service files. AWS_DATA_PATH=$LAMBDA_TASK_ROOT/path_in_zip/ https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html#environment-variable-configuration
Here’s one way you can do this – by using Lambda Layers and manually adding the models to the sdk.
Read more about lambda layers here: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html
Update your AWS CLI to make sure it supports Lambda Layers
Steps:
The above should return an ARN for a layer in the form: