1 Answer
- Newest
- Most votes
- Most comments
2
It looks like you're using CDK via Python. In a similar stack of mine that seems to be working okay, the main difference seems to be that I'm using the ContainerDefinitionProperty class rather than a plain dict:
sagemaker.CfnModel( self, "MyModel", execution_role_arn=sagemaker_role.role_arn, # Note class here: primary_container=sagemaker.CfnModel.ContainerDefinitionProperty( environment={...}, image="...", model_data_url="s3://...", ), )
Full disclosure: I'm actually referencing asset.s3_object_url rather than an s3:// URI string, where asset is an instance of s3assets.Asset. But I'm pretty sure from the s3assets.Asset.s3ObjectUrl doc that it should behave the same way.
You can find more complete code here - but that sample currently has some other deployment issues with fix in progress on PR50.
Relevant content
- AWS OFFICIALUpdated 8 months ago

Yep, needed that class. Really wish it would have thrown an error on the plain dict since that definitely wasn't working. Thanks so much, you ended several days of torment.