-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv_targets.py
More file actions
40 lines (30 loc) · 756 Bytes
/
env_targets.py
File metadata and controls
40 lines (30 loc) · 756 Bytes
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
"""Environment-specific resource targets for dev and prod."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict
@dataclass(frozen=True)
class Target:
bucket: str
service: str
batch_job_prefix: str
DEV = Target(
bucket="citb4-projects-dev",
service="citb4-dev",
batch_job_prefix="dev",
)
PROD = Target(
bucket="prod-projects",
service="citb4",
batch_job_prefix="prod",
)
TARGETS: Dict[str, Target] = {
"DEV": DEV,
"PROD": PROD,
}
def get_targets(env: str | None = None) -> Target:
"""Return the target config for the requested environment."""
if env:
key = env.upper()
if key in TARGETS:
return TARGETS[key]
return PROD