Skip to content

Commit 43c1349

Browse files
committed
Merge branch 'master' of https://github.com/aws/sagemaker-python-sdk into debugger-docstrings
2 parents 6c4c288 + 5f52f95 commit 43c1349

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/sagemaker/pipeline.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def deploy(
111111
wait=True,
112112
update_endpoint=False,
113113
data_capture_config=None,
114+
kms_key=None,
114115
):
115116
"""Deploy the ``Model`` to an ``Endpoint``.
116117
@@ -156,6 +157,9 @@ def deploy(
156157
data_capture_config (sagemaker.model_monitor.DataCaptureConfig): Specifies
157158
configuration related to Endpoint data capture for use with
158159
Amazon SageMaker Model Monitoring. Default: None.
160+
kms_key (str): The ARN, Key ID or Alias of the KMS key that is used to
161+
encrypt the data on the storage volume attached to the instance hosting
162+
the endpoint.
159163
160164
Returns:
161165
callable[string, sagemaker.session.Session] or None: Invocation of
@@ -192,6 +196,7 @@ def deploy(
192196
initial_instance_count=initial_instance_count,
193197
instance_type=instance_type,
194198
tags=tags,
199+
kms_key=kms_key,
195200
data_capture_config_dict=data_capture_config_dict,
196201
)
197202
self.sagemaker_session.update_endpoint(
@@ -202,6 +207,7 @@ def deploy(
202207
name=self.endpoint_name,
203208
production_variants=[production_variant],
204209
tags=tags,
210+
kms_key=kms_key,
205211
wait=wait,
206212
data_capture_config_dict=data_capture_config_dict,
207213
)

tests/unit/test_pipeline_model.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def test_deploy(tfo, time, sagemaker_session):
113113
model = PipelineModel(
114114
models=[framework_model, sparkml_model], role=ROLE, sagemaker_session=sagemaker_session
115115
)
116-
model.deploy(instance_type=INSTANCE_TYPE, initial_instance_count=1)
116+
kms_key = "pipeline-model-deploy-kms-key"
117+
model.deploy(instance_type=INSTANCE_TYPE, initial_instance_count=1, kms_key=kms_key)
117118
sagemaker_session.endpoint_from_production_variants.assert_called_with(
118119
name="mi-1-2017-10-10-14-14-15",
119120
production_variants=[
@@ -126,6 +127,7 @@ def test_deploy(tfo, time, sagemaker_session):
126127
}
127128
],
128129
tags=None,
130+
kms_key=kms_key,
129131
wait=True,
130132
data_capture_config_dict=None,
131133
)
@@ -154,6 +156,7 @@ def test_deploy_endpoint_name(tfo, time, sagemaker_session):
154156
}
155157
],
156158
tags=None,
159+
kms_key=None,
157160
wait=True,
158161
data_capture_config_dict=None,
159162
)
@@ -183,6 +186,7 @@ def test_deploy_update_endpoint(tfo, time, sagemaker_session):
183186
initial_instance_count=INSTANCE_COUNT,
184187
instance_type=INSTANCE_TYPE,
185188
tags=None,
189+
kms_key=None,
186190
data_capture_config_dict=None,
187191
)
188192
config_name = sagemaker_session.create_endpoint_config(
@@ -275,6 +279,7 @@ def test_deploy_tags(tfo, time, sagemaker_session):
275279
],
276280
tags=tags,
277281
wait=True,
282+
kms_key=None,
278283
data_capture_config_dict=None,
279284
)
280285

0 commit comments

Comments
 (0)