-
Notifications
You must be signed in to change notification settings - Fork 1.2k
change: add KMS key option for Endpoint Configs #762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
src/sagemaker/model.py
Outdated
@@ -235,6 +235,8 @@ def deploy(self, initial_instance_count, instance_type, accelerator_type=None, e | |||
If True, this will deploy a new EndpointConfig to an already existing endpoint and delete resources | |||
corresponding to the previous EndpointConfig. If False, a new endpoint will be created. Default: False | |||
tags(List[dict[str, str]]): The list of tags to attach to this specific endpoint. | |||
kms_key (str): The KMS key that is used to encrypt the data on the storage volume attached |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it clear that this is the arn of the kms_key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/integ/test_mxnet_train.py
Outdated
sts_client = sagemaker_session.boto_session.client('sts') | ||
account_id = sts_client.get_caller_identity()['Account'] | ||
kms_client = sagemaker_session.boto_session.client('kms') | ||
kms_key_arn = get_or_create_kms_key(kms_client, account_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional - I think it will make this code cleaner if get_or_create_kms_key just take sageamker_session as the argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
tests/integ/test_mxnet_train.py
Outdated
@@ -109,6 +110,30 @@ def test_deploy_model_with_tags(mxnet_training_job, sagemaker_session, mxnet_ful | |||
assert production_variants[0]['InitialInstanceCount'] == 1 | |||
|
|||
|
|||
def test_deploy_model_with_kms_key(mxnet_training_job, sagemaker_session, mxnet_full_version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just add this to an existing test? They are already taking so long to run use so much resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Description of changes:
This change exposes the option of using a KMS key to encrypt the instance hosting a SageMaker Endpoint.
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.