- Newest
- Most votes
- Most comments
Hi. The HealthImaging APIs were introduced in boto3 v1.28.6 . As such - the default Lambda runtimes currently available (as of Dec 2023) do not include those APIs. Those will be updated with the next released runtime version, but until then - you have a few options.
Firstly, you can continue using your code - but simply update to the current model file and production endpoints. You can find those here . However, that does mean that you will need to continue having to manage the Endpoint configuration yourself. To avoid that, and use the automatically provided endpoints - you can use a Lambda layer to bring in either an updated boto3 or just the HealthImaging model, as described in the Loaders reference . I would probably choose the last method (model only layer) as you can continue using the default runtimes, and only add a very lightweight layer to your Lambdas.
The steps to accomplish that would roughly be:
- Create the layer zip file following the directory structure described in the loaders reference. (eg. models/medical-imaging/2023/07/19/service-2.json).
- Upload the layer zip file and add it to your Lambda function. The content of the zip file will be uzipped under the "/opt" directory on the Lambda function filesystem. More info on Lambda layers here.
- Add an environment variable to the Lambda called 'AWS_DATA_PATH' with a value of '/opt/models'. This specifies the additional search path for the loader.
Hi there, you are still using the model files and boto client configuration specific to the preview of our service. HealthImaging is now Generally Available as of 7/26/23; the preview plus model is no longer valid and there is no longer any need to configure boto with the old model file. The AWS SDK now has medical-imaging service officially available. As part of the GA launch, HealthImaging changed endpoints. Upgrading the AWS SDK should automatically provide the correct endpoint.
Adding an update for those viewing this post, in recent days...Lambda runtime (Python) does, by default, now invoke a version of Boto3 that natively supports 'medical-imaging' API calls.
As Jordan pointed out that this was released (for Boto3) in version 1.28.6, and very likely, if you create a Lambda function now, you'll receive a higher version of Boto3 (1.34.42+).
Also, if you want to check the version of Boto3 and Boto3 core, you can use the below code to print out the version for verification:
import boto3
import botocore
def lambda_handler(event, context):
print(f'boto3 version: {boto3.__version__}')
print(f'botocore version: {botocore.__version__}')
Relevant content
- Accepted Answerasked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago