-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathapp.py
53 lines (42 loc) · 1.08 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env python3
import os
import aws_cdk as cdk
from cdk_stacks import (
VpcStack,
S3Stack,
AuroraMysqlStack,
MLflowOnEC2InstanceStack,
SageMakerStudioStack,
)
AWS_ENV = cdk.Environment(
account=os.environ["CDK_DEFAULT_ACCOUNT"],
region=os.environ["CDK_DEFAULT_REGION"]
)
app = cdk.App()
vpc_stack = VpcStack(app, "MLflowVpcStack",
env=AWS_ENV)
s3_stack = S3Stack(app, "MLflowS3ArtifactsStack",
env=AWS_ENV
)
s3_stack.add_dependency(vpc_stack)
rds_stack = AuroraMysqlStack(app, "MLflowRDSStack",
vpc_stack.vpc,
env=AWS_ENV
)
rds_stack.add_dependency(s3_stack)
mlflow_ec2_instance_stack = MLflowOnEC2InstanceStack(app, "MLflowOnEC2InstanceStack",
vpc_stack.vpc,
s3_stack.artifact_bucket,
rds_stack.sg_rds_client,
rds_stack.database_endpoint,
rds_stack.database_secret,
rds_stack.database_name,
env=AWS_ENV
)
mlflow_ec2_instance_stack.add_dependency(rds_stack)
sagemaker_studio_stack = SageMakerStudioStack(app, "MLflowSageMakerStudioStack",
vpc_stack.vpc,
env=AWS_ENV
)
sagemaker_studio_stack.add_dependency(mlflow_ec2_instance_stack)
app.synth()