-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
34 lines (30 loc) · 1.23 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
#!/usr/bin/env python3
import os
import aws_cdk as cdk
from aws_cdk import Aspects
from cdk_nag import AwsSolutionsChecks
from cdk_nag import HIPAASecurityChecks
from gen_ai_workflow_orchestrator.gen_ai_workflow_orchestrator_stack import GenAIWorkflowOrchestratorStack
SUPPORTED_REGIONS = ['us-east-1', 'us-west-2']
if os.getenv('CDK_REGION') not in SUPPORTED_REGIONS:
raise ValueError(
f"Unsupported AWS region: {os.getenv('CDK_REGION')}. "
'Based on current Bedrock Model availability, the supported regions '
f"for this solution are: {', '.join(SUPPORTED_REGIONS)}")
app = cdk.App()
stack = GenAIWorkflowOrchestratorStack(
app,
'GenAIWorkflowOrchestratorStack',
description='Resources for the Generative AI Workflow Orchestrator',
env=cdk.Environment(
account=os.getenv('CDK_ACCOUNT'),
region=os.getenv('CDK_REGION')
)
)
cdk.Tags.of(stack).add(stack.node.try_get_context('project_tag_key'),
stack.node.try_get_context('project_tag_value'))
cdk.Tags.of(stack).add(stack.node.try_get_context(
'environment_tag_key'), stack.node.try_get_context('environment_tag_value'))
Aspects.of(app).add(AwsSolutionsChecks())
Aspects.of(app).add(HIPAASecurityChecks())
app.synth()