Spaces:
Configuration error
Configuration error
Add DataRobot Pulumi program
Browse files- pulumi/datarobot/__main__.py +35 -0
pulumi/datarobot/__main__.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Pulumi (Python) program mirroring terraform/datarobot/main.tf.
|
| 2 |
+
|
| 3 |
+
Run: pulumi up (needs the datarobot Pulumi provider; credentials from env)
|
| 4 |
+
"""
|
| 5 |
+
from pulumi import ResourceOptions, export
|
| 6 |
+
import pulumi_datarobot as datarobot
|
| 7 |
+
|
| 8 |
+
env = datarobot.PredictionEnvironment(
|
| 9 |
+
"prod-env",
|
| 10 |
+
name="prod-env",
|
| 11 |
+
description="Production prediction environment",
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
model = datarobot.CustomModel(
|
| 15 |
+
"agent-main",
|
| 16 |
+
name="agent-main",
|
| 17 |
+
description="Main agent model",
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
registered = datarobot.RegisteredModel(
|
| 21 |
+
"agent-main-registered",
|
| 22 |
+
name="agent-main",
|
| 23 |
+
custom_model_version_id=model.version_id,
|
| 24 |
+
description="Registered version of agent-main",
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
deployment = datarobot.Deployment(
|
| 28 |
+
"agent-main-deployment",
|
| 29 |
+
label="agent-main-deployment",
|
| 30 |
+
prediction_environment_id=env.id,
|
| 31 |
+
registered_model_version_id=registered.version_id,
|
| 32 |
+
)
|
| 33 |
+
|
| 34 |
+
export("prediction_environment_id", env.id)
|
| 35 |
+
export("deployment_id", deployment.id)
|