dbt-platform-helper 12.3.0__py3-none-any.whl → 12.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbt-platform-helper might be problematic. Click here for more details.
- dbt_platform_helper/COMMANDS.md +6 -1
- dbt_platform_helper/commands/codebase.py +1 -1
- dbt_platform_helper/commands/conduit.py +2 -2
- dbt_platform_helper/commands/config.py +4 -4
- dbt_platform_helper/commands/copilot.py +13 -15
- dbt_platform_helper/commands/database.py +17 -4
- dbt_platform_helper/commands/environment.py +3 -2
- dbt_platform_helper/commands/pipeline.py +1 -29
- dbt_platform_helper/constants.py +3 -1
- dbt_platform_helper/domain/codebase.py +23 -5
- dbt_platform_helper/domain/conduit.py +0 -6
- dbt_platform_helper/domain/database_copy.py +14 -13
- dbt_platform_helper/domain/maintenance_page.py +9 -9
- dbt_platform_helper/platform_exception.py +5 -0
- dbt_platform_helper/providers/aws.py +32 -0
- dbt_platform_helper/providers/cache.py +83 -0
- dbt_platform_helper/providers/cloudformation.py +8 -1
- dbt_platform_helper/providers/copilot.py +2 -5
- dbt_platform_helper/providers/ecs.py +19 -4
- dbt_platform_helper/providers/load_balancers.py +11 -5
- dbt_platform_helper/providers/platform_config_schema.py +605 -0
- dbt_platform_helper/providers/secrets.py +51 -10
- dbt_platform_helper/providers/validation.py +19 -0
- dbt_platform_helper/utils/application.py +14 -2
- dbt_platform_helper/utils/arn_parser.py +1 -1
- dbt_platform_helper/utils/aws.py +22 -21
- dbt_platform_helper/utils/files.py +0 -70
- dbt_platform_helper/utils/git.py +2 -2
- dbt_platform_helper/utils/validation.py +3 -551
- dbt_platform_helper/utils/versioning.py +8 -8
- {dbt_platform_helper-12.3.0.dist-info → dbt_platform_helper-12.4.1.dist-info}/METADATA +1 -1
- {dbt_platform_helper-12.3.0.dist-info → dbt_platform_helper-12.4.1.dist-info}/RECORD +35 -35
- dbt_platform_helper/addons-template-map.yml +0 -29
- dbt_platform_helper/exceptions.py +0 -147
- dbt_platform_helper/templates/pipelines/environments/buildspec.yml +0 -80
- dbt_platform_helper/templates/pipelines/environments/manifest.yml +0 -48
- dbt_platform_helper/templates/pipelines/environments/overrides/cfn.patches.yml +0 -21
- {dbt_platform_helper-12.3.0.dist-info → dbt_platform_helper-12.4.1.dist-info}/LICENSE +0 -0
- {dbt_platform_helper-12.3.0.dist-info → dbt_platform_helper-12.4.1.dist-info}/WHEEL +0 -0
- {dbt_platform_helper-12.3.0.dist-info → dbt_platform_helper-12.4.1.dist-info}/entry_points.txt +0 -0
|
@@ -4,7 +4,7 @@ import botocore
|
|
|
4
4
|
from cfn_tools import dump_yaml
|
|
5
5
|
from cfn_tools import load_yaml
|
|
6
6
|
|
|
7
|
-
from dbt_platform_helper.
|
|
7
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class CloudFormation:
|
|
@@ -125,3 +125,10 @@ class CloudFormation:
|
|
|
125
125
|
raise CloudFormationException(
|
|
126
126
|
stack_name, f"Error while waiting for stack status: {str(err)}"
|
|
127
127
|
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class CloudFormationException(PlatformException):
|
|
131
|
+
def __init__(self, stack_name: str, current_status: str):
|
|
132
|
+
super().__init__(
|
|
133
|
+
f"The CloudFormation stack '{stack_name}' is not in a good state: {current_status}"
|
|
134
|
+
)
|
|
@@ -4,7 +4,7 @@ import time
|
|
|
4
4
|
from botocore.exceptions import ClientError
|
|
5
5
|
|
|
6
6
|
from dbt_platform_helper.constants import CONDUIT_DOCKER_IMAGE_LOCATION
|
|
7
|
-
from dbt_platform_helper.
|
|
7
|
+
from dbt_platform_helper.providers.aws import CreateTaskTimeoutException
|
|
8
8
|
from dbt_platform_helper.providers.secrets import Secrets
|
|
9
9
|
from dbt_platform_helper.utils.application import Application
|
|
10
10
|
from dbt_platform_helper.utils.messages import abort_with_error
|
|
@@ -13,7 +13,6 @@ from dbt_platform_helper.utils.messages import abort_with_error
|
|
|
13
13
|
def create_addon_client_task(
|
|
14
14
|
iam_client,
|
|
15
15
|
ssm_client,
|
|
16
|
-
secrets_manager_client,
|
|
17
16
|
subprocess,
|
|
18
17
|
application: Application,
|
|
19
18
|
env: str,
|
|
@@ -32,7 +31,6 @@ def create_addon_client_task(
|
|
|
32
31
|
elif access == "admin":
|
|
33
32
|
create_postgres_admin_task(
|
|
34
33
|
ssm_client,
|
|
35
|
-
secrets_manager_client,
|
|
36
34
|
subprocess,
|
|
37
35
|
application,
|
|
38
36
|
addon_name,
|
|
@@ -74,7 +72,6 @@ def create_addon_client_task(
|
|
|
74
72
|
|
|
75
73
|
def create_postgres_admin_task(
|
|
76
74
|
ssm_client,
|
|
77
|
-
secrets_manager_client,
|
|
78
75
|
subprocess,
|
|
79
76
|
app: Application,
|
|
80
77
|
addon_name: str,
|
|
@@ -147,7 +144,7 @@ def connect_to_addon_client_task(
|
|
|
147
144
|
time.sleep(1)
|
|
148
145
|
|
|
149
146
|
if not running:
|
|
150
|
-
raise
|
|
147
|
+
raise CreateTaskTimeoutException(task_name, application_name, env)
|
|
151
148
|
|
|
152
149
|
|
|
153
150
|
def _normalise_secret_name(addon_name: str) -> str:
|
|
@@ -3,8 +3,7 @@ import string
|
|
|
3
3
|
import time
|
|
4
4
|
from typing import List
|
|
5
5
|
|
|
6
|
-
from dbt_platform_helper.
|
|
7
|
-
from dbt_platform_helper.exceptions import NoClusterError
|
|
6
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
class ECS:
|
|
@@ -36,7 +35,7 @@ class ECS:
|
|
|
36
35
|
if app_key_found and env_key_found and cluster_key_found:
|
|
37
36
|
return cluster_arn
|
|
38
37
|
|
|
39
|
-
raise
|
|
38
|
+
raise NoClusterException(self.application_name, self.env)
|
|
40
39
|
|
|
41
40
|
def get_or_create_task_name(self, addon_name: str, parameter_name: str) -> str:
|
|
42
41
|
"""Fetches the task name from SSM or creates a new one if not found."""
|
|
@@ -84,4 +83,20 @@ class ECS:
|
|
|
84
83
|
time.sleep(1)
|
|
85
84
|
|
|
86
85
|
if execute_command_agent_status != "RUNNING":
|
|
87
|
-
raise
|
|
86
|
+
raise ECSAgentNotRunningException
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class ECSException(PlatformException):
|
|
90
|
+
pass
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class ECSAgentNotRunningException(ECSException):
|
|
94
|
+
def __init__(self):
|
|
95
|
+
super().__init__("""ECS exec agent never reached "RUNNING" status""")
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class NoClusterException(ECSException):
|
|
99
|
+
def __init__(self, application_name: str, environment: str):
|
|
100
|
+
super().__init__(
|
|
101
|
+
f"""No ECS cluster found for "{application_name}" in "{environment}" environment."""
|
|
102
|
+
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import boto3
|
|
2
2
|
|
|
3
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
def find_load_balancer(session: boto3.Session, app: str, env: str) -> str:
|
|
5
7
|
lb_client = session.client("elbv2")
|
|
@@ -16,7 +18,7 @@ def find_load_balancer(session: boto3.Session, app: str, env: str) -> str:
|
|
|
16
18
|
load_balancer_arn = lb["ResourceArn"]
|
|
17
19
|
|
|
18
20
|
if not load_balancer_arn:
|
|
19
|
-
raise
|
|
21
|
+
raise LoadBalancerNotFoundException()
|
|
20
22
|
|
|
21
23
|
return load_balancer_arn
|
|
22
24
|
|
|
@@ -34,18 +36,22 @@ def find_https_listener(session: boto3.Session, app: str, env: str) -> str:
|
|
|
34
36
|
pass
|
|
35
37
|
|
|
36
38
|
if not listener_arn:
|
|
37
|
-
raise
|
|
39
|
+
raise ListenerNotFoundException()
|
|
38
40
|
|
|
39
41
|
return listener_arn
|
|
40
42
|
|
|
41
43
|
|
|
42
|
-
class
|
|
44
|
+
class LoadBalancerException(PlatformException):
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class LoadBalancerNotFoundException(LoadBalancerException):
|
|
43
49
|
pass
|
|
44
50
|
|
|
45
51
|
|
|
46
|
-
class
|
|
52
|
+
class ListenerNotFoundException(LoadBalancerException):
|
|
47
53
|
pass
|
|
48
54
|
|
|
49
55
|
|
|
50
|
-
class
|
|
56
|
+
class ListenerRuleNotFoundException(LoadBalancerException):
|
|
51
57
|
pass
|