dbt-platform-helper 13.1.2__tar.gz → 13.3.0__tar.gz
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-13.1.2 → dbt_platform_helper-13.3.0}/PKG-INFO +2 -2
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/application.py +2 -4
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/codebase.py +11 -7
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/conduit.py +1 -3
- dbt_platform_helper-13.3.0/dbt_platform_helper/commands/config.py +38 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/copilot.py +14 -8
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/database.py +17 -9
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/environment.py +5 -6
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/generate.py +2 -3
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/notify.py +1 -3
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/pipeline.py +1 -3
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/secrets.py +1 -3
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/version.py +2 -2
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/codebase.py +17 -9
- dbt_platform_helper-13.3.0/dbt_platform_helper/domain/config.py +345 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/copilot.py +158 -157
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/maintenance_page.py +42 -15
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/pipelines.py +1 -1
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/terraform_environment.py +1 -1
- dbt_platform_helper-13.3.0/dbt_platform_helper/domain/versioning.py +198 -0
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/aws.py → dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws/exceptions.py +10 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws/interfaces.py +13 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws/opensearch.py +23 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws/redis.py +21 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws/sso_auth.py +61 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/cache.py +40 -4
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/config.py +2 -1
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/config_validator.py +28 -25
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/copilot.py +1 -1
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/io.py +5 -2
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/kms.py +22 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/load_balancers.py +26 -15
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/parameter_store.py +47 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/platform_config_schema.py +17 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/semantic_version.py +76 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/terraform_manifest.py +1 -0
- dbt_platform_helper-13.3.0/dbt_platform_helper/providers/version.py +136 -0
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/semantic_version.py → dbt_platform_helper-13.3.0/dbt_platform_helper/providers/version_status.py +5 -71
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/yaml_file.py +0 -1
- dbt_platform_helper-13.3.0/dbt_platform_helper/utils/__init__.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/aws.py +24 -142
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/git.py +3 -1
- dbt_platform_helper-13.3.0/dbt_platform_helper/utils/tool_versioning.py +12 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/platform_helper.py +1 -1
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/pyproject.toml +2 -3
- dbt_platform_helper-13.1.2/dbt_platform_helper/commands/config.py +0 -340
- dbt_platform_helper-13.1.2/dbt_platform_helper/domain/versioning.py +0 -67
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/opensearch.py +0 -36
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/platform_helper_versioning.py +0 -107
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/redis.py +0 -34
- dbt_platform_helper-13.1.2/dbt_platform_helper/providers/version.py +0 -60
- dbt_platform_helper-13.1.2/dbt_platform_helper/templates/svc/manifest-backend.yml +0 -69
- dbt_platform_helper-13.1.2/dbt_platform_helper/templates/svc/manifest-public.yml +0 -109
- dbt_platform_helper-13.1.2/dbt_platform_helper/utils/cloudfoundry.py +0 -14
- dbt_platform_helper-13.1.2/dbt_platform_helper/utils/files.py +0 -59
- dbt_platform_helper-13.1.2/dbt_platform_helper/utils/manifests.py +0 -18
- dbt_platform_helper-13.1.2/dbt_platform_helper/utils/versioning.py +0 -91
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/LICENSE +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/COMMANDS.md +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/README.md +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/__init__.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/addon-plans.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/__init__.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/constants.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/default-extensions.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/__init__.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/conduit.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/copilot_environment.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/database_copy.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/jinja2_tags.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/platform_exception.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/__init__.py +0 -0
- {dbt_platform_helper-13.1.2/dbt_platform_helper/utils → dbt_platform_helper-13.3.0/dbt_platform_helper/providers/aws}/__init__.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/cloudformation.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/ecr.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/ecs.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/files.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/secrets.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/validation.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/providers/vpc.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/COMMANDS.md.jinja +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/README.md +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/svc/s3-cross-account-policy.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/env/manifest.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/environment-pipelines/main.tf +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/application.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/arn_parser.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/click.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/messages.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/template.py +0 -0
- {dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/utils/validation.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: dbt-platform-helper
|
|
3
|
-
Version: 13.
|
|
3
|
+
Version: 13.3.0
|
|
4
4
|
Summary: Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Department for Business and Trade Platform Team
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
-
Requires-Dist: Jinja2 (==3.1.
|
|
15
|
+
Requires-Dist: Jinja2 (==3.1.6)
|
|
16
16
|
Requires-Dist: PyYAML (==6.0.1)
|
|
17
17
|
Requires-Dist: aiohttp (>=3.8.4,<4.0.0)
|
|
18
18
|
Requires-Dist: boto3 (>=1.28.24,<2.0.0)
|
|
@@ -10,9 +10,7 @@ from datetime import timedelta
|
|
|
10
10
|
import click
|
|
11
11
|
from prettytable import PrettyTable
|
|
12
12
|
|
|
13
|
-
from dbt_platform_helper.
|
|
14
|
-
PlatformHelperVersioning,
|
|
15
|
-
)
|
|
13
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
16
14
|
from dbt_platform_helper.utils.application import load_application
|
|
17
15
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
18
16
|
|
|
@@ -141,7 +139,7 @@ def container_stats(env, app, storage, network):
|
|
|
141
139
|
storage_write = field[6]["value"]
|
|
142
140
|
network_read = field[7]["value"]
|
|
143
141
|
network_write = field[8]["value"]
|
|
144
|
-
cpu = "
|
|
142
|
+
cpu = f"{float(field[9]['value']):.1f}%"
|
|
145
143
|
memory = f"{field[10]['value']}M"
|
|
146
144
|
|
|
147
145
|
# Nothing to compare to at start.
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/codebase.py
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from dbt_platform_helper.domain.codebase import Codebase
|
|
4
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
4
5
|
from dbt_platform_helper.platform_exception import PlatformException
|
|
5
6
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
6
|
-
from dbt_platform_helper.providers.
|
|
7
|
-
|
|
8
|
-
)
|
|
7
|
+
from dbt_platform_helper.providers.parameter_store import ParameterStore
|
|
8
|
+
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
9
9
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
10
10
|
|
|
11
11
|
|
|
@@ -19,7 +19,7 @@ def codebase():
|
|
|
19
19
|
def prepare():
|
|
20
20
|
"""Sets up an application codebase for use within a DBT platform project."""
|
|
21
21
|
try:
|
|
22
|
-
Codebase().prepare()
|
|
22
|
+
Codebase(ParameterStore(get_aws_session_or_abort().client("ssm"))).prepare()
|
|
23
23
|
except PlatformException as err:
|
|
24
24
|
ClickIOProvider().abort_with_error(str(err))
|
|
25
25
|
|
|
@@ -35,7 +35,7 @@ def prepare():
|
|
|
35
35
|
def list(app, with_images):
|
|
36
36
|
"""List available codebases for the application."""
|
|
37
37
|
try:
|
|
38
|
-
Codebase().list(app, with_images)
|
|
38
|
+
Codebase(ParameterStore(get_aws_session_or_abort().client("ssm"))).list(app, with_images)
|
|
39
39
|
except PlatformException as err:
|
|
40
40
|
ClickIOProvider().abort_with_error(str(err))
|
|
41
41
|
|
|
@@ -51,7 +51,9 @@ def list(app, with_images):
|
|
|
51
51
|
def build(app, codebase, commit):
|
|
52
52
|
"""Trigger a CodePipeline pipeline based build."""
|
|
53
53
|
try:
|
|
54
|
-
Codebase().build(
|
|
54
|
+
Codebase(ParameterStore(get_aws_session_or_abort().client("ssm"))).build(
|
|
55
|
+
app, codebase, commit
|
|
56
|
+
)
|
|
55
57
|
except PlatformException as err:
|
|
56
58
|
ClickIOProvider().abort_with_error(str(err))
|
|
57
59
|
|
|
@@ -67,6 +69,8 @@ def build(app, codebase, commit):
|
|
|
67
69
|
@click.option("--commit", help="GitHub commit hash", required=True)
|
|
68
70
|
def deploy(app, env, codebase, commit):
|
|
69
71
|
try:
|
|
70
|
-
Codebase().deploy(
|
|
72
|
+
Codebase(ParameterStore(get_aws_session_or_abort().client("ssm"))).deploy(
|
|
73
|
+
app, env, codebase, commit
|
|
74
|
+
)
|
|
71
75
|
except PlatformException as err:
|
|
72
76
|
ClickIOProvider().abort_with_error(str(err))
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/conduit.py
RENAMED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
3
|
from dbt_platform_helper.domain.conduit import Conduit
|
|
4
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
4
5
|
from dbt_platform_helper.platform_exception import PlatformException
|
|
5
6
|
from dbt_platform_helper.providers.cloudformation import CloudFormation
|
|
6
7
|
from dbt_platform_helper.providers.ecs import ECS
|
|
7
8
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
8
|
-
from dbt_platform_helper.providers.platform_helper_versioning import (
|
|
9
|
-
PlatformHelperVersioning,
|
|
10
|
-
)
|
|
11
9
|
from dbt_platform_helper.providers.secrets import Secrets
|
|
12
10
|
from dbt_platform_helper.utils.application import load_application
|
|
13
11
|
from dbt_platform_helper.utils.click import ClickDocOptCommand
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from dbt_platform_helper.domain.config import Config
|
|
4
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
5
|
+
from dbt_platform_helper.providers.aws.sso_auth import SSOAuthProvider
|
|
6
|
+
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
7
|
+
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
8
|
+
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@click.group(cls=ClickDocOptGroup)
|
|
12
|
+
def config():
|
|
13
|
+
"""Perform actions on configuration files."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@config.command()
|
|
17
|
+
def validate():
|
|
18
|
+
"""Validate deployment or application configuration."""
|
|
19
|
+
try:
|
|
20
|
+
Config().validate()
|
|
21
|
+
except PlatformException as err:
|
|
22
|
+
ClickIOProvider().abort_with_error(str(err))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@config.command()
|
|
26
|
+
@click.option("--file-path", "-fp", default="~/.aws/config")
|
|
27
|
+
def aws(file_path):
|
|
28
|
+
"""
|
|
29
|
+
Writes a local config file containing all the AWS profiles to which the
|
|
30
|
+
logged in user has access.
|
|
31
|
+
|
|
32
|
+
If no `--file-path` is specified, defaults to `~/.aws/config`.
|
|
33
|
+
"""
|
|
34
|
+
try:
|
|
35
|
+
session = get_aws_session_or_abort()
|
|
36
|
+
Config(sso=SSOAuthProvider(session)).generate_aws(file_path)
|
|
37
|
+
except PlatformException as err:
|
|
38
|
+
ClickIOProvider().abort_with_error(str(err))
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/copilot.py
RENAMED
|
@@ -4,19 +4,16 @@ import click
|
|
|
4
4
|
|
|
5
5
|
from dbt_platform_helper.domain.copilot import Copilot
|
|
6
6
|
from dbt_platform_helper.domain.copilot_environment import CopilotTemplating
|
|
7
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
7
8
|
from dbt_platform_helper.providers.config import ConfigProvider
|
|
8
9
|
from dbt_platform_helper.providers.config_validator import ConfigValidator
|
|
9
10
|
from dbt_platform_helper.providers.files import FileProvider
|
|
10
11
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
11
|
-
from dbt_platform_helper.providers.
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
from dbt_platform_helper.providers.kms import KMSProvider
|
|
13
|
+
from dbt_platform_helper.providers.parameter_store import ParameterStore
|
|
14
|
+
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
14
15
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
15
16
|
|
|
16
|
-
# TODOs
|
|
17
|
-
# Figure out a pattern for copilot templating and the new copilot domain - probably a lot of overlap here that really belongs in the copilottemplating domain instead (atleast whatever is concerned with "templating")
|
|
18
|
-
# Check for E2E test coverage.
|
|
19
|
-
|
|
20
17
|
|
|
21
18
|
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
22
19
|
def copilot():
|
|
@@ -27,7 +24,16 @@ def copilot():
|
|
|
27
24
|
def make_addons():
|
|
28
25
|
"""Generate addons CloudFormation for each environment."""
|
|
29
26
|
try:
|
|
27
|
+
session = get_aws_session_or_abort()
|
|
28
|
+
parameter_provider = ParameterStore(session.client("ssm"))
|
|
30
29
|
config_provider = ConfigProvider(ConfigValidator())
|
|
31
|
-
Copilot(
|
|
30
|
+
Copilot(
|
|
31
|
+
config_provider,
|
|
32
|
+
parameter_provider,
|
|
33
|
+
FileProvider(),
|
|
34
|
+
CopilotTemplating(),
|
|
35
|
+
KMSProvider,
|
|
36
|
+
session,
|
|
37
|
+
).make_addons()
|
|
32
38
|
except Exception as err:
|
|
33
39
|
ClickIOProvider().abort_with_error(str(err))
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/database.py
RENAMED
|
@@ -2,6 +2,8 @@ import click
|
|
|
2
2
|
|
|
3
3
|
from dbt_platform_helper.commands.environment import AVAILABLE_TEMPLATES
|
|
4
4
|
from dbt_platform_helper.domain.database_copy import DatabaseCopy
|
|
5
|
+
from dbt_platform_helper.platform_exception import PlatformException
|
|
6
|
+
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
5
7
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
6
8
|
|
|
7
9
|
|
|
@@ -38,9 +40,11 @@ def database():
|
|
|
38
40
|
)
|
|
39
41
|
def dump(app, from_env, database, from_vpc, filename):
|
|
40
42
|
"""Dump a database into an S3 bucket."""
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
try:
|
|
44
|
+
data_copy = DatabaseCopy(app, database)
|
|
45
|
+
data_copy.dump(from_env, from_vpc, filename)
|
|
46
|
+
except PlatformException as err:
|
|
47
|
+
ClickIOProvider().abort_with_error(str(err))
|
|
44
48
|
|
|
45
49
|
|
|
46
50
|
@database.command(name="load")
|
|
@@ -68,9 +72,11 @@ def dump(app, from_env, database, from_vpc, filename):
|
|
|
68
72
|
)
|
|
69
73
|
def load(app, to_env, database, to_vpc, auto_approve, filename):
|
|
70
74
|
"""Load a database from an S3 bucket."""
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
try:
|
|
76
|
+
data_copy = DatabaseCopy(app, database, auto_approve)
|
|
77
|
+
data_copy.load(to_env, to_vpc, filename)
|
|
78
|
+
except PlatformException as err:
|
|
79
|
+
ClickIOProvider().abort_with_error(str(err))
|
|
74
80
|
|
|
75
81
|
|
|
76
82
|
@database.command(name="copy")
|
|
@@ -120,6 +126,8 @@ def copy(
|
|
|
120
126
|
no_maintenance_page,
|
|
121
127
|
):
|
|
122
128
|
"""Copy a database between environments."""
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
129
|
+
try:
|
|
130
|
+
data_copy = DatabaseCopy(app, database, auto_approve)
|
|
131
|
+
data_copy.copy(from_env, to_env, from_vpc, to_vpc, svc, template, no_maintenance_page)
|
|
132
|
+
except PlatformException as err:
|
|
133
|
+
ClickIOProvider().abort_with_error(str(err))
|
|
@@ -4,14 +4,12 @@ from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VER
|
|
|
4
4
|
from dbt_platform_helper.domain.copilot_environment import CopilotEnvironment
|
|
5
5
|
from dbt_platform_helper.domain.maintenance_page import MaintenancePage
|
|
6
6
|
from dbt_platform_helper.domain.terraform_environment import TerraformEnvironment
|
|
7
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
7
8
|
from dbt_platform_helper.platform_exception import PlatformException
|
|
8
9
|
from dbt_platform_helper.providers.cloudformation import CloudFormation
|
|
9
10
|
from dbt_platform_helper.providers.config import ConfigProvider
|
|
10
11
|
from dbt_platform_helper.providers.config_validator import ConfigValidator
|
|
11
12
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
12
|
-
from dbt_platform_helper.providers.platform_helper_versioning import (
|
|
13
|
-
PlatformHelperVersioning,
|
|
14
|
-
)
|
|
15
13
|
from dbt_platform_helper.providers.vpc import VpcProvider
|
|
16
14
|
from dbt_platform_helper.utils.application import load_application
|
|
17
15
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
@@ -94,9 +92,10 @@ def generate(name):
|
|
|
94
92
|
help=f"Override the default version of terraform-platform-modules. (Default version is '{DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION}').",
|
|
95
93
|
)
|
|
96
94
|
def generate_terraform(name, terraform_platform_modules_version):
|
|
97
|
-
|
|
95
|
+
click_io = ClickIOProvider()
|
|
98
96
|
try:
|
|
99
|
-
|
|
97
|
+
session = get_aws_session_or_abort()
|
|
98
|
+
config_provider = ConfigProvider(ConfigValidator(session=session))
|
|
100
99
|
TerraformEnvironment(config_provider).generate(name, terraform_platform_modules_version)
|
|
101
100
|
except PlatformException as err:
|
|
102
|
-
|
|
101
|
+
click_io.abort_with_error(str(err))
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/generate.py
RENAMED
|
@@ -3,7 +3,7 @@ import click
|
|
|
3
3
|
|
|
4
4
|
from dbt_platform_helper.commands.copilot import make_addons
|
|
5
5
|
from dbt_platform_helper.commands.pipeline import generate as pipeline_generate
|
|
6
|
-
from dbt_platform_helper.domain.versioning import
|
|
6
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
7
7
|
from dbt_platform_helper.utils.click import ClickDocOptCommand
|
|
8
8
|
|
|
9
9
|
|
|
@@ -16,7 +16,6 @@ def generate(ctx: click.Context):
|
|
|
16
16
|
|
|
17
17
|
Wraps pipeline generate and make-addons.
|
|
18
18
|
"""
|
|
19
|
-
|
|
20
|
-
RequiredVersion().check_platform_helper_version_mismatch()
|
|
19
|
+
PlatformHelperVersioning().check_platform_helper_version_mismatch()
|
|
21
20
|
ctx.invoke(pipeline_generate)
|
|
22
21
|
ctx.invoke(make_addons)
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/notify.py
RENAMED
|
@@ -2,9 +2,7 @@ import click
|
|
|
2
2
|
from slack_sdk import WebClient
|
|
3
3
|
from slack_sdk.models import blocks
|
|
4
4
|
|
|
5
|
-
from dbt_platform_helper.
|
|
6
|
-
PlatformHelperVersioning,
|
|
7
|
-
)
|
|
5
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
8
6
|
from dbt_platform_helper.utils.arn_parser import ARN
|
|
9
7
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
10
8
|
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/pipeline.py
RENAMED
|
@@ -3,13 +3,11 @@ import click
|
|
|
3
3
|
|
|
4
4
|
from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
|
|
5
5
|
from dbt_platform_helper.domain.pipelines import Pipelines
|
|
6
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
6
7
|
from dbt_platform_helper.providers.config import ConfigProvider
|
|
7
8
|
from dbt_platform_helper.providers.config_validator import ConfigValidator
|
|
8
9
|
from dbt_platform_helper.providers.ecr import ECRProvider
|
|
9
10
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
10
|
-
from dbt_platform_helper.providers.platform_helper_versioning import (
|
|
11
|
-
PlatformHelperVersioning,
|
|
12
|
-
)
|
|
13
11
|
from dbt_platform_helper.providers.terraform_manifest import TerraformManifestProvider
|
|
14
12
|
from dbt_platform_helper.utils.aws import get_codestar_connection_arn
|
|
15
13
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/secrets.py
RENAMED
|
@@ -6,9 +6,7 @@ import click
|
|
|
6
6
|
from botocore.exceptions import ClientError
|
|
7
7
|
from cloudfoundry_client.client import CloudFoundryClient
|
|
8
8
|
|
|
9
|
-
from dbt_platform_helper.
|
|
10
|
-
PlatformHelperVersioning,
|
|
11
|
-
)
|
|
9
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
12
10
|
from dbt_platform_helper.utils.application import get_application_name
|
|
13
11
|
from dbt_platform_helper.utils.aws import SSM_BASE_PATH
|
|
14
12
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/commands/version.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import click
|
|
2
2
|
|
|
3
|
-
from dbt_platform_helper.domain.versioning import
|
|
3
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
4
4
|
from dbt_platform_helper.platform_exception import PlatformException
|
|
5
5
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
6
6
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
@@ -32,6 +32,6 @@ def get_platform_helper_for_project(pipeline):
|
|
|
32
32
|
- Fall back on the version in the deprecated '.platform-helper-version' file
|
|
33
33
|
"""
|
|
34
34
|
try:
|
|
35
|
-
|
|
35
|
+
PlatformHelperVersioning().get_required_version(pipeline)
|
|
36
36
|
except PlatformException as err:
|
|
37
37
|
ClickIOProvider().abort_with_error(str(err))
|
{dbt_platform_helper-13.1.2 → dbt_platform_helper-13.3.0}/dbt_platform_helper/domain/codebase.py
RENAMED
|
@@ -11,6 +11,7 @@ from boto3 import Session
|
|
|
11
11
|
from dbt_platform_helper.platform_exception import PlatformException
|
|
12
12
|
from dbt_platform_helper.providers.files import FileProvider
|
|
13
13
|
from dbt_platform_helper.providers.io import ClickIOProvider
|
|
14
|
+
from dbt_platform_helper.providers.parameter_store import ParameterStore
|
|
14
15
|
from dbt_platform_helper.utils.application import Application
|
|
15
16
|
from dbt_platform_helper.utils.application import (
|
|
16
17
|
ApplicationEnvironmentNotFoundException,
|
|
@@ -20,6 +21,8 @@ from dbt_platform_helper.utils.aws import check_image_exists
|
|
|
20
21
|
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
21
22
|
from dbt_platform_helper.utils.aws import get_build_url_from_arn
|
|
22
23
|
from dbt_platform_helper.utils.aws import get_build_url_from_pipeline_execution_id
|
|
24
|
+
from dbt_platform_helper.utils.aws import get_image_build_project
|
|
25
|
+
from dbt_platform_helper.utils.aws import get_manual_release_pipeline
|
|
23
26
|
from dbt_platform_helper.utils.aws import list_latest_images
|
|
24
27
|
from dbt_platform_helper.utils.aws import start_build_extraction
|
|
25
28
|
from dbt_platform_helper.utils.aws import start_pipeline_and_return_execution_id
|
|
@@ -30,10 +33,13 @@ from dbt_platform_helper.utils.template import setup_templates
|
|
|
30
33
|
class Codebase:
|
|
31
34
|
def __init__(
|
|
32
35
|
self,
|
|
36
|
+
parameter_provider: ParameterStore,
|
|
33
37
|
io: ClickIOProvider = ClickIOProvider(),
|
|
34
38
|
load_application: Callable[[str], Application] = load_application,
|
|
35
39
|
get_aws_session_or_abort: Callable[[str], Session] = get_aws_session_or_abort,
|
|
36
40
|
check_image_exists: Callable[[str], str] = check_image_exists,
|
|
41
|
+
get_image_build_project: Callable[[str], str] = get_image_build_project,
|
|
42
|
+
get_manual_release_pipeline: Callable[[str], str] = get_manual_release_pipeline,
|
|
37
43
|
get_build_url_from_arn: Callable[[str], str] = get_build_url_from_arn,
|
|
38
44
|
get_build_url_from_pipeline_execution_id: Callable[
|
|
39
45
|
[str], str
|
|
@@ -46,10 +52,13 @@ class Codebase:
|
|
|
46
52
|
check_if_commit_exists: Callable[[str], str] = check_if_commit_exists,
|
|
47
53
|
run_subprocess: Callable[[str], str] = subprocess.run,
|
|
48
54
|
):
|
|
55
|
+
self.parameter_provider = parameter_provider
|
|
49
56
|
self.io = io
|
|
50
57
|
self.load_application = load_application
|
|
51
58
|
self.get_aws_session_or_abort = get_aws_session_or_abort
|
|
52
59
|
self.check_image_exists = check_image_exists
|
|
60
|
+
self.get_image_build_project = get_image_build_project
|
|
61
|
+
self.get_manual_release_pipeline = get_manual_release_pipeline
|
|
53
62
|
self.get_build_url_from_arn = get_build_url_from_arn
|
|
54
63
|
self.get_build_url_from_pipeline_execution_id = get_build_url_from_pipeline_execution_id
|
|
55
64
|
self.list_latest_images = list_latest_images
|
|
@@ -126,12 +135,13 @@ class Codebase:
|
|
|
126
135
|
self.check_if_commit_exists(commit)
|
|
127
136
|
|
|
128
137
|
codebuild_client = session.client("codebuild")
|
|
138
|
+
project_name = self.get_image_build_project(codebuild_client, app, codebase)
|
|
129
139
|
build_url = self.__start_build_with_confirmation(
|
|
130
140
|
codebuild_client,
|
|
131
141
|
self.get_build_url_from_arn,
|
|
132
142
|
f'You are about to build "{app}" for "{codebase}" with commit "{commit}". Do you want to continue?',
|
|
133
143
|
{
|
|
134
|
-
"projectName":
|
|
144
|
+
"projectName": project_name,
|
|
135
145
|
"artifactsOverride": {"type": "NO_ARTIFACTS"},
|
|
136
146
|
"sourceVersion": commit,
|
|
137
147
|
},
|
|
@@ -154,9 +164,10 @@ class Codebase:
|
|
|
154
164
|
|
|
155
165
|
self.check_image_exists(session, application, codebase, commit)
|
|
156
166
|
|
|
157
|
-
pipeline_name = f"{app}-{codebase}-manual-release-pipeline"
|
|
158
167
|
codepipeline_client = session.client("codepipeline")
|
|
159
168
|
|
|
169
|
+
pipeline_name = self.get_manual_release_pipeline(codepipeline_client, app, codebase)
|
|
170
|
+
|
|
160
171
|
build_url = self.__start_pipeline_execution_with_confirmation(
|
|
161
172
|
codepipeline_client,
|
|
162
173
|
self.get_build_url_from_pipeline_execution_id,
|
|
@@ -182,9 +193,8 @@ class Codebase:
|
|
|
182
193
|
"""List available codebases for the application."""
|
|
183
194
|
session = self.get_aws_session_or_abort()
|
|
184
195
|
application = self.load_application(app, session)
|
|
185
|
-
ssm_client = session.client("ssm")
|
|
186
196
|
ecr_client = session.client("ecr")
|
|
187
|
-
codebases = self.__get_codebases(application,
|
|
197
|
+
codebases = self.__get_codebases(application, session.client("ssm"))
|
|
188
198
|
|
|
189
199
|
self.io.info("The following codebases are available:")
|
|
190
200
|
|
|
@@ -201,11 +211,9 @@ class Codebase:
|
|
|
201
211
|
self.io.info("")
|
|
202
212
|
|
|
203
213
|
def __get_codebases(self, application, ssm_client):
|
|
204
|
-
parameters =
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
)["Parameters"]
|
|
208
|
-
|
|
214
|
+
parameters = self.parameter_provider.get_ssm_parameters_by_path(
|
|
215
|
+
f"/copilot/applications/{application.name}/codebases"
|
|
216
|
+
)
|
|
209
217
|
codebases = [json.loads(p["Value"]) for p in parameters]
|
|
210
218
|
|
|
211
219
|
if not codebases:
|