Skip to content

Commit 00d3763

Browse files
authored
fix: use correct client for create env client, fix environment creation (#4787)
1 parent a195149 commit 00d3763

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

ml_ops/sm-datazone_import/import-sagemaker-domain.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,16 @@ def _configure_blueprint(self):
253253
managed_key, self.managed_blueprint_id
254254
)
255255
)
256-
print("--------------------------------------------------------------------")
257256

258-
decision = input(
259-
"Do you need to enable the configuration for the specified environment blueprint into Amazon DataZone? (put_env_blueprint_config)? [y/n]: "
257+
# if already enabled returns success
258+
self.dz_client.put_environment_blueprint_configuration(
259+
domainIdentifier=self.dz_domain_id,
260+
environmentBlueprintIdentifier=self.managed_blueprint_id,
261+
enabledRegions=[self.region],
260262
)
261-
if decision == "y":
262-
self.dz_client.put_environment_blueprint_configuration(
263-
domainIdentifier=self.dz_domain_id,
264-
environmentBlueprintIdentifier=self.managed_blueprint_id,
265-
enabledRegions=[self.region],
266-
)
263+
264+
print("--------------------------------------------------------------------")
265+
267266
return self.managed_blueprint_id
268267

269268
def _configure_environment(self):
@@ -336,7 +335,7 @@ def _add_environment_action(self):
336335
sm_env_action = item
337336

338337
if sm_env_action is None:
339-
self.dz_client.create_environment_action(
338+
self.byod_client.create_environment_action(
340339
domainIdentifier=self.dz_domain_id,
341340
environmentIdentifier=self.env_id,
342341
name="SageMaker Environment Action Link",
@@ -479,10 +478,10 @@ def import_interactive(self):
479478
self._choose_sm_domain()
480479
self._choose_dz_domain()
481480
self._choose_dz_project()
481+
self._configure_blueprint()
482482
self._configure_environment()
483483
self._tag_sm_domain()
484484
self._map_users()
485-
self._configure_blueprint()
486485
self._add_environment_action()
487486
self._associate_fed_role()
488487
self._link_domain()

0 commit comments

Comments
 (0)