dbt-platform-helper 13.2.0__py3-none-any.whl → 13.3.0__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.

Files changed (35) hide show
  1. dbt_platform_helper/commands/codebase.py +10 -4
  2. dbt_platform_helper/commands/config.py +12 -314
  3. dbt_platform_helper/commands/copilot.py +10 -6
  4. dbt_platform_helper/commands/database.py +17 -9
  5. dbt_platform_helper/commands/environment.py +2 -3
  6. dbt_platform_helper/domain/codebase.py +7 -7
  7. dbt_platform_helper/domain/config.py +345 -0
  8. dbt_platform_helper/domain/copilot.py +155 -157
  9. dbt_platform_helper/domain/versioning.py +48 -7
  10. dbt_platform_helper/providers/aws/__init__.py +0 -0
  11. dbt_platform_helper/providers/aws/exceptions.py +10 -0
  12. dbt_platform_helper/providers/aws/sso_auth.py +61 -0
  13. dbt_platform_helper/providers/config.py +2 -1
  14. dbt_platform_helper/providers/config_validator.py +15 -13
  15. dbt_platform_helper/providers/io.py +2 -2
  16. dbt_platform_helper/providers/parameter_store.py +47 -0
  17. dbt_platform_helper/providers/platform_config_schema.py +17 -0
  18. dbt_platform_helper/providers/semantic_version.py +15 -88
  19. dbt_platform_helper/providers/terraform_manifest.py +1 -0
  20. dbt_platform_helper/providers/version.py +82 -24
  21. dbt_platform_helper/providers/version_status.py +80 -0
  22. dbt_platform_helper/utils/aws.py +0 -141
  23. dbt_platform_helper/utils/git.py +3 -1
  24. dbt_platform_helper/utils/tool_versioning.py +0 -84
  25. {dbt_platform_helper-13.2.0.dist-info → dbt_platform_helper-13.3.0.dist-info}/METADATA +2 -2
  26. {dbt_platform_helper-13.2.0.dist-info → dbt_platform_helper-13.3.0.dist-info}/RECORD +30 -30
  27. {dbt_platform_helper-13.2.0.dist-info → dbt_platform_helper-13.3.0.dist-info}/WHEEL +1 -1
  28. platform_helper.py +1 -1
  29. dbt_platform_helper/templates/svc/manifest-backend.yml +0 -69
  30. dbt_platform_helper/templates/svc/manifest-public.yml +0 -109
  31. dbt_platform_helper/utils/cloudfoundry.py +0 -14
  32. dbt_platform_helper/utils/files.py +0 -53
  33. dbt_platform_helper/utils/manifests.py +0 -18
  34. {dbt_platform_helper-13.2.0.dist-info → dbt_platform_helper-13.3.0.dist-info}/LICENSE +0 -0
  35. {dbt_platform_helper-13.2.0.dist-info → dbt_platform_helper-13.3.0.dist-info}/entry_points.txt +0 -0
@@ -4,21 +4,16 @@ import time
4
4
  import urllib.parse
5
5
  from configparser import ConfigParser
6
6
  from pathlib import Path
7
- from typing import Tuple
8
7
 
9
8
  import boto3
10
9
  import botocore
11
10
  import botocore.exceptions
12
11
  import click
13
- import yaml
14
12
  from boto3 import Session
15
13
  from botocore.exceptions import ClientError
16
14
 
17
15
  from dbt_platform_helper.constants import REFRESH_TOKEN_MESSAGE
18
16
  from dbt_platform_helper.platform_exception import PlatformException
19
- from dbt_platform_helper.providers.aws.exceptions import (
20
- CopilotCodebaseNotFoundException,
21
- )
22
17
  from dbt_platform_helper.providers.aws.exceptions import ImageNotFoundException
23
18
  from dbt_platform_helper.providers.aws.exceptions import LogGroupNotFoundException
24
19
  from dbt_platform_helper.providers.aws.exceptions import RepositoryNotFoundException
@@ -206,15 +201,6 @@ def set_ssm_param(
206
201
  client.put_parameter(**parameter_args)
207
202
 
208
203
 
209
- def check_response(response):
210
- if response["ResponseMetadata"]["HTTPStatusCode"] != 200:
211
- click.secho(
212
- f"Unknown response error from AWS.\nStatus Code: {response['ResponseMetadata']['HTTPStatusCode']}",
213
- fg="red",
214
- )
215
- exit()
216
-
217
-
218
204
  def get_codestar_connection_arn(app_name):
219
205
  session = get_aws_session_or_abort()
220
206
  response = session.client("codestar-connections").list_connections()
@@ -232,114 +218,6 @@ def get_account_details(sts_client=None):
232
218
  return response["Account"], response["UserId"]
233
219
 
234
220
 
235
- def get_public_repository_arn(repository_uri):
236
- session = get_aws_session_or_abort()
237
- response = session.client("ecr-public", region_name="us-east-1").describe_repositories()
238
- repository = [
239
- repo for repo in response["repositories"] if repo["repositoryUri"] == repository_uri
240
- ]
241
-
242
- return repository[0]["repositoryArn"] if repository else None
243
-
244
-
245
- def get_load_balancer_domain_and_configuration(
246
- project_session: Session, app: str, env: str, svc: str
247
- ) -> Tuple[str, dict]:
248
- response = get_load_balancer_configuration(project_session, app, env, svc)
249
-
250
- # Find the domain name
251
- with open(f"./copilot/{svc}/manifest.yml", "r") as fd:
252
- conf = yaml.safe_load(fd)
253
- if "environments" in conf:
254
- if env in conf["environments"]:
255
- for domain in conf["environments"].items():
256
- if domain[0] == env:
257
- if (
258
- domain[1] is None
259
- or domain[1]["http"] is None
260
- or domain[1]["http"]["alias"] is None
261
- ):
262
- click.secho(
263
- f"No domains found, please check the ./copilot/{svc}/manifest.yml file",
264
- fg="red",
265
- )
266
- exit()
267
- domain_name = domain[1]["http"]["alias"]
268
- else:
269
- click.secho(
270
- f"Environment {env} not found, please check the ./copilot/{svc}/manifest.yml file",
271
- fg="red",
272
- )
273
- exit()
274
-
275
- return domain_name, response["LoadBalancers"][0]
276
-
277
-
278
- def get_load_balancer_configuration(
279
- project_session: Session, app: str, env: str, svc: str
280
- ) -> list[Session]:
281
- proj_client = project_session.client("ecs")
282
-
283
- response = proj_client.list_clusters()
284
- check_response(response)
285
- no_items = True
286
- for cluster_arn in response["clusterArns"]:
287
- cluster_name = cluster_arn.split("/")[1]
288
- if cluster_name.startswith(f"{app}-{env}-Cluster"):
289
- no_items = False
290
- break
291
-
292
- if no_items:
293
- click.echo(
294
- click.style("There are no clusters for environment ", fg="red")
295
- + click.style(f"{env} ", fg="white", bold=True)
296
- + click.style("of application ", fg="red")
297
- + click.style(f"{app} ", fg="white", bold=True)
298
- + click.style("in AWS account ", fg="red")
299
- + click.style(f"{project_session.profile_name}", fg="white", bold=True),
300
- )
301
- exit()
302
-
303
- response = proj_client.list_services(cluster=cluster_name)
304
- check_response(response)
305
- no_items = True
306
- for service_arn in response["serviceArns"]:
307
- fully_qualified_service_name = service_arn.split("/")[2]
308
- if fully_qualified_service_name.startswith(f"{app}-{env}-{svc}-Service"):
309
- no_items = False
310
- break
311
-
312
- if no_items:
313
- click.echo(
314
- click.style("There are no services called ", fg="red")
315
- + click.style(f"{svc} ", fg="white", bold=True)
316
- + click.style("for environment ", fg="red")
317
- + click.style(f"{env} ", fg="white", bold=True)
318
- + click.style("of application ", fg="red")
319
- + click.style(f"{app} ", fg="white", bold=True)
320
- + click.style("in AWS account ", fg="red")
321
- + click.style(f"{project_session.profile_name}", fg="white", bold=True),
322
- )
323
- exit()
324
-
325
- elb_client = project_session.client("elbv2")
326
-
327
- elb_arn = elb_client.describe_target_groups(
328
- TargetGroupArns=[
329
- proj_client.describe_services(
330
- cluster=cluster_name,
331
- services=[
332
- fully_qualified_service_name,
333
- ],
334
- )["services"][0]["loadBalancers"][0]["targetGroupArn"],
335
- ],
336
- )["TargetGroups"][0]["LoadBalancerArns"][0]
337
-
338
- response = elb_client.describe_load_balancers(LoadBalancerArns=[elb_arn])
339
- check_response(response)
340
- return response
341
-
342
-
343
221
  def get_postgres_connection_data_updated_with_master_secret(session, parameter_name, secret_arn):
344
222
  # Todo: This is pretty much the same as dbt_platform_helper.providers.secrets.Secrets.get_postgres_connection_data_updated_with_master_secret
345
223
  ssm_client = session.client("ssm")
@@ -390,25 +268,6 @@ def start_pipeline_and_return_execution_id(codepipeline_client, build_options):
390
268
  return response["pipelineExecutionId"]
391
269
 
392
270
 
393
- # Todo: This should probably be in the AWS Copilot provider
394
- def check_codebase_exists(session: Session, application, codebase: str):
395
- try:
396
- # Todo: Can this leverage dbt_platform_helper.providers.secrets.Secrets.get_connection_secret_arn?
397
- ssm_client = session.client("ssm")
398
- json.loads(
399
- ssm_client.get_parameter(
400
- Name=f"/copilot/applications/{application.name}/codebases/{codebase}"
401
- )["Parameter"]["Value"]
402
- )
403
- except (
404
- KeyError,
405
- ValueError,
406
- ssm_client.exceptions.ParameterNotFound,
407
- json.JSONDecodeError,
408
- ):
409
- raise CopilotCodebaseNotFoundException(codebase)
410
-
411
-
412
271
  def check_image_exists(session, application, codebase, commit):
413
272
  ecr_client = session.client("ecr")
414
273
  repository = f"{application.name}/{codebase}"
@@ -1,8 +1,10 @@
1
1
  import re
2
2
  import subprocess
3
3
 
4
+ from dbt_platform_helper.platform_exception import PlatformException
4
5
 
5
- class CommitNotFoundException(Exception):
6
+
7
+ class CommitNotFoundException(PlatformException):
6
8
  pass
7
9
 
8
10
 
@@ -1,32 +1,4 @@
1
- import re
2
- import subprocess
3
- from pathlib import Path
4
-
5
1
  from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
6
- from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
7
- from dbt_platform_helper.providers.config import ConfigProvider
8
- from dbt_platform_helper.providers.semantic_version import PlatformHelperVersionStatus
9
- from dbt_platform_helper.providers.semantic_version import SemanticVersion
10
- from dbt_platform_helper.providers.semantic_version import VersionStatus
11
- from dbt_platform_helper.providers.validation import ValidationException
12
- from dbt_platform_helper.providers.version import DeprecatedVersionFileVersionProvider
13
- from dbt_platform_helper.providers.version import GithubVersionProvider
14
- from dbt_platform_helper.providers.version import InstalledVersionProvider
15
- from dbt_platform_helper.providers.version import PyPiVersionProvider
16
- from dbt_platform_helper.providers.yaml_file import YamlFileProvider
17
-
18
-
19
- # TODO to be removed after config tests are updated - temporary wrapper mid-refactor
20
- def get_platform_helper_version_status(
21
- include_project_versions=True,
22
- yaml_provider=YamlFileProvider,
23
- ) -> PlatformHelperVersionStatus:
24
- return PlatformHelperVersioning(
25
- pypi_provider=PyPiVersionProvider,
26
- installed_version_provider=InstalledVersionProvider(),
27
- version_file_version_provider=DeprecatedVersionFileVersionProvider(yaml_provider),
28
- config_provider=ConfigProvider(),
29
- )._get_version_status(include_project_versions=include_project_versions)
30
2
 
31
3
 
32
4
  def get_required_terraform_platform_modules_version(
@@ -38,59 +10,3 @@ def get_required_terraform_platform_modules_version(
38
10
  DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION,
39
11
  ]
40
12
  return [version for version in version_preference_order if version][0]
41
-
42
-
43
- ##################################################################################
44
- # Only used in Config domain
45
- # TODO Relocate along with tests when we refactor config command in DBTP-1538
46
- ##################################################################################
47
-
48
-
49
- # Getting version from the "Generated by" comment in a file that was generated from a template
50
- # TODO where does this belong? It sort of belongs to our platform-helper templating
51
- def get_template_generated_with_version(template_file_path: str) -> SemanticVersion:
52
- try:
53
- template_contents = Path(template_file_path).read_text()
54
- template_version = re.match(
55
- r"# Generated by platform-helper ([v.\-0-9]+)", template_contents
56
- ).group(1)
57
- return SemanticVersion.from_string(template_version)
58
- except (IndexError, AttributeError):
59
- raise ValidationException(f"Template {template_file_path} has no version information")
60
-
61
-
62
- def validate_template_version(app_version: SemanticVersion, template_file_path: str):
63
- app_version.validate_compatibility_with(get_template_generated_with_version(template_file_path))
64
-
65
-
66
- # Local version and latest release of tool.
67
- # Used only in config command.
68
- # TODO Move to config domain
69
- def get_copilot_versions() -> VersionStatus:
70
- copilot_version = None
71
-
72
- try:
73
- response = subprocess.run("copilot --version", capture_output=True, shell=True)
74
- [copilot_version] = re.findall(r"[0-9.]+", response.stdout.decode("utf8"))
75
- except ValueError:
76
- pass
77
-
78
- return VersionStatus(
79
- SemanticVersion.from_string(copilot_version),
80
- GithubVersionProvider.get_latest_version("aws/copilot-cli"),
81
- )
82
-
83
-
84
- # Local version and latest release of tool.
85
- # Used only in config command.
86
- # TODO Move to config domain
87
- def get_aws_versions() -> VersionStatus:
88
- aws_version = None
89
- try:
90
- response = subprocess.run("aws --version", capture_output=True, shell=True)
91
- matched = re.match(r"aws-cli/([0-9.]+)", response.stdout.decode("utf8"))
92
- aws_version = SemanticVersion.from_string(matched.group(1))
93
- except ValueError:
94
- pass
95
-
96
- return VersionStatus(aws_version, GithubVersionProvider.get_latest_version("aws/aws-cli", True))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-platform-helper
3
- Version: 13.2.0
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.5)
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)
@@ -4,12 +4,12 @@ dbt_platform_helper/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
4
4
  dbt_platform_helper/addon-plans.yml,sha256=O46a_ODsGG9KXmQY_1XbSGqrpSaHSLDe-SdROzHx8Go,4545
5
5
  dbt_platform_helper/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  dbt_platform_helper/commands/application.py,sha256=OUQsahXXHSEKxmXAmK8fSy_bTLNwM_TdLuv6CvffRPk,10126
7
- dbt_platform_helper/commands/codebase.py,sha256=Hl1QW1_9WbgRtcyfN3iN9OXl0pVzD78k9czT2graRyo,2355
7
+ dbt_platform_helper/commands/codebase.py,sha256=lwkZ9PZ7Zp1jQ2NaZ5-10gOMy85rYsHBa1-w8fU52k8,2763
8
8
  dbt_platform_helper/commands/conduit.py,sha256=v5geTJzRHkOnbFfOqmjO6b57HXhs4YxTo_zJgDEYB0A,2300
9
- dbt_platform_helper/commands/config.py,sha256=hyOPbLkO-DEh_gcNbpYq-J2zo7e_FAMUZws3lknmYbg,11791
10
- dbt_platform_helper/commands/copilot.py,sha256=YYYcS-PHJ8IQ_aCyqTzcswwx745gd8OQH9OSssljILs,1521
11
- dbt_platform_helper/commands/database.py,sha256=aG3zcMHL5PE96b7LSAu0FGCbgcycQej3AGRcd-bpXUo,4115
12
- dbt_platform_helper/commands/environment.py,sha256=kOmS6NQnl2X21eYpEhajvAIBeg5KyQ5Mm81SaOBkjqE,4003
9
+ dbt_platform_helper/commands/config.py,sha256=7XRFgLHUg1n-k6DReEouVm9NzOm0zFtnBwDLyDLSBLw,1225
10
+ dbt_platform_helper/commands/copilot.py,sha256=L9UUuqD62q0aFrTTEUla3A1WJBz-vFBfVi6p455TTgQ,1458
11
+ dbt_platform_helper/commands/database.py,sha256=2RJZEzaSqcNtDG1M2mZw-nB6agAd3GNAJsg2pjFF7vc,4407
12
+ dbt_platform_helper/commands/environment.py,sha256=JTCkAVrlIOqgzdlT2y2pXp_9rQHc2In0sxhbQyj3jFw,3975
13
13
  dbt_platform_helper/commands/generate.py,sha256=4M0ZiGN2w-bwgPMxeItFfT6vA7sOMjuceHEN7RAYkhc,735
14
14
  dbt_platform_helper/commands/notify.py,sha256=MWVlNalASSq0WghE5LjMrM6C7cGv8QosbmU5iXuI2bo,3864
15
15
  dbt_platform_helper/commands/pipeline.py,sha256=tw6pE429FVGj8JoAvDnrpkJzC-qi6JJch7PDz2cKBvM,2983
@@ -18,39 +18,44 @@ dbt_platform_helper/commands/version.py,sha256=gRQkmcFTz90SbYhO1L-j727AuZ_gnjQfc
18
18
  dbt_platform_helper/constants.py,sha256=DpHGG54lwjw3XGp2TKCEGNmzaz083lAWMGkEabujDrw,1050
19
19
  dbt_platform_helper/default-extensions.yml,sha256=SU1ZitskbuEBpvE7efc3s56eAUF11j70brhj_XrNMMo,493
20
20
  dbt_platform_helper/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
- dbt_platform_helper/domain/codebase.py,sha256=sdQ9qL-HZ5NbVEXWCqyDhlRsDrJsoO_CdFE0Yf97a1A,10808
21
+ dbt_platform_helper/domain/codebase.py,sha256=2rSVCwGsnbFZbs9JvAFwjq2yPKfTqCPiBegYLvmCgIQ,10914
22
22
  dbt_platform_helper/domain/conduit.py,sha256=5C5GnF5jssJ1rFFCY6qaKgvLjYUkyytRJE4tHlanYa0,4370
23
- dbt_platform_helper/domain/copilot.py,sha256=K6nw3BvZ0DyFHQCBTl3BRqMB4Iu5zjFdEOcmA2sMLdo,14648
23
+ dbt_platform_helper/domain/config.py,sha256=au45EnEAjv0RZUEDJ_0IQnsRV7wM0hHi-ZJ6LOnavYc,13361
24
+ dbt_platform_helper/domain/copilot.py,sha256=9L4h-WFwgRU8AMjf14PlDqwLqOpIRinkuPvhe-8Uk3c,15034
24
25
  dbt_platform_helper/domain/copilot_environment.py,sha256=yPt6ZarOvFPo06XwY1sU5MOQsoV7TEsKSQHyM-G8aGc,9058
25
26
  dbt_platform_helper/domain/database_copy.py,sha256=CKvI9LsHyowg0bPT9jImk07w4TyQLPoInQoU2TUDiJQ,9485
26
27
  dbt_platform_helper/domain/maintenance_page.py,sha256=h7uYlUi4rlaDV9DvdElb2yD4H6Nz7dHMx3RIQfjHFZw,14258
27
28
  dbt_platform_helper/domain/pipelines.py,sha256=mUvGaNMtBAUemsb-fHDcpWV-9LfqGoSogI2LwDnvt0I,6503
28
29
  dbt_platform_helper/domain/terraform_environment.py,sha256=7ZKLZ8Zk6-V_IPaCDUP8eYTRudqDjHxvFnbG6LIlLO4,1759
29
- dbt_platform_helper/domain/versioning.py,sha256=JLIvonvZvjdaTdBF6bt9Tbrhu4GE8gHg8o9u3b6Djsg,6154
30
+ dbt_platform_helper/domain/versioning.py,sha256=9AdQ_pW20RUwdvdSgY_OzqlDkFaevLNAeh5WZ-w0Xww,7865
30
31
  dbt_platform_helper/jinja2_tags.py,sha256=hKG6RS3zlxJHQ-Op9r2U2-MhWp4s3lZir4Ihe24ApJ0,540
31
32
  dbt_platform_helper/platform_exception.py,sha256=bheZV9lqGvrCVTNT92349dVntNDEDWTEwciZgC83WzE,187
32
33
  dbt_platform_helper/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- dbt_platform_helper/providers/aws/exceptions.py,sha256=mlorH0fni6m8aUpm1x2jQPhaI3T0QsDMWpoGiSURBcI,1387
34
+ dbt_platform_helper/providers/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ dbt_platform_helper/providers/aws/exceptions.py,sha256=LcTRdjnABDx44BEC4kd4Qb9HNrEcyyCY4yzG16kV3eE,1712
34
36
  dbt_platform_helper/providers/aws/interfaces.py,sha256=0JFggcUTJ8zERdxNVVpIiKvaaZeT2c-VECDG--MOi8E,285
35
37
  dbt_platform_helper/providers/aws/opensearch.py,sha256=Qne2SoPllmacVSc7AxtjBlEbSBsRMbR_ySEkEymSF9k,581
36
38
  dbt_platform_helper/providers/aws/redis.py,sha256=i3Kb00_BdqssjQg1wgZ-8GRXcEWQiORWnIEq6qkAXjQ,551
39
+ dbt_platform_helper/providers/aws/sso_auth.py,sha256=1cE9gVu0XZoE3Nycs1anShistRU_CZCOGMFzFpaAq0w,2275
37
40
  dbt_platform_helper/providers/cache.py,sha256=1hEwp0y9WYbEfgsp-RU9MyzIgCt1-4BxApgd_0uVweE,3615
38
41
  dbt_platform_helper/providers/cloudformation.py,sha256=SvCZgEVqxdpKfQMRAG3KzFQ43YeOEDqMm2tKmFGtacY,5347
39
- dbt_platform_helper/providers/config.py,sha256=nGpL2_-ko94Dd4YM5vDEpME_8IGEhWpFcLQqKkb_h8E,4145
40
- dbt_platform_helper/providers/config_validator.py,sha256=o67poy69XeCujefUodvRIz5FWTGcBNepuvBivP0IidQ,11139
42
+ dbt_platform_helper/providers/config.py,sha256=X84xQxTVWDcuLAeGBM4A5uVhEiXIzjiVfCB9nAjqVf8,4249
43
+ dbt_platform_helper/providers/config_validator.py,sha256=-n9KjfTQhk2NPK5Vw1Bbz9z-uTSQfWPWUbtRLp1EbTs,11088
41
44
  dbt_platform_helper/providers/copilot.py,sha256=Pgdh1JS-so2thT7Jqipol5aVkA_CgU6doUmy3YjYSXs,5328
42
45
  dbt_platform_helper/providers/ecr.py,sha256=lmLKGR5OQT8EyGsX-9M7oO0DHIyoMqgchBAVQBeoBZs,639
43
46
  dbt_platform_helper/providers/ecs.py,sha256=XlQHYhZiLGrqR-1ZWMagGH2R2Hy7mCP6676eZL3YbNQ,3842
44
47
  dbt_platform_helper/providers/files.py,sha256=cJdOV6Eupi-COmGUMxZMF10BZnMi3MCCipTVUnE_NPA,857
45
- dbt_platform_helper/providers/io.py,sha256=KurX_2yfst8IzWkKaeUe3TG612Jy7OamIJHQzcsLERU,1344
48
+ dbt_platform_helper/providers/io.py,sha256=FrVwWZqm8TFxp4Ph2AqbgsePpt6tryNdaPzc4wyGJmA,1364
46
49
  dbt_platform_helper/providers/kms.py,sha256=JR2EU3icXePoJCtr7QnqDPj1wWbyn5Uf9CRFq3_4lRs,647
47
50
  dbt_platform_helper/providers/load_balancers.py,sha256=KTsdpNttdUay_2d_IfC6oWbC8rWfs4Oh2eSgGMyK1Ag,10572
48
- dbt_platform_helper/providers/platform_config_schema.py,sha256=1PjqzdOnhSncyX3BPpewl0be9xOBauCfnLLHOW40f2c,26972
51
+ dbt_platform_helper/providers/parameter_store.py,sha256=klxDhcQ65Yc2KAc4Gf5P0vhpZOW7_vZalAVb-LLAA4s,1568
52
+ dbt_platform_helper/providers/platform_config_schema.py,sha256=yDfZ61qJLpKUJWu3M9HaGninf02dojmlbGRoQ6g5i9o,27588
49
53
  dbt_platform_helper/providers/secrets.py,sha256=6cYIR15dLdHmqxtWQpM6R71e0_Xgsg9V291HBG-0LV0,5272
50
- dbt_platform_helper/providers/semantic_version.py,sha256=slUKfSgHbLSQP-vqcfaTzZCw6EIGc8yIlmEvh0Qx6zo,5266
51
- dbt_platform_helper/providers/terraform_manifest.py,sha256=hrCjkuQIV0Ymt5MPLkh-BfXHtuAScXhWwNkVEp9K5Jg,9354
54
+ dbt_platform_helper/providers/semantic_version.py,sha256=zVEYRnonWs1eENzMULp4VLEH5sRbxLQgiXAEcx-lp1E,2455
55
+ dbt_platform_helper/providers/terraform_manifest.py,sha256=65lVbq3nSsMpADoSUse78LCRWFTsQeV6r6Az8sDZWdQ,9459
52
56
  dbt_platform_helper/providers/validation.py,sha256=i2g-Mrd4hy_fGIfGa6ZQy4vTJ40OM44Fe_XpEifGWxs,126
53
- dbt_platform_helper/providers/version.py,sha256=qdwoRi5_EHvDG2dKOWgNPQ_sZtsAuGmu9DCbarbtxs0,2888
57
+ dbt_platform_helper/providers/version.py,sha256=uVPnFdwNhkIj0J-RYgMfJy3zTCoGAb7Y12ZZhpkPGeg,5086
58
+ dbt_platform_helper/providers/version_status.py,sha256=6BgUqhqfGFKkne1xd3Zv9MhV9WR7Jt8A295A58mtkAU,2988
54
59
  dbt_platform_helper/providers/vpc.py,sha256=EIjjD71K1Ry3V1jyaAkAjZwlwu_FSTn-AS7kiJFiipA,2953
55
60
  dbt_platform_helper/providers/yaml_file.py,sha256=q-1DWtuG9bfR24lOYzwCwzgOpGPwDaoJpLUB1DtdEmE,2179
56
61
  dbt_platform_helper/templates/.copilot/config.yml,sha256=J_bA9sCtBdCPBRImpCBRnYvhQd4vpLYIXIU-lq9vbkA,158
@@ -76,25 +81,20 @@ dbt_platform_helper/templates/environment-pipelines/main.tf,sha256=qElclUHb0pv-N
76
81
  dbt_platform_helper/templates/svc/maintenance_pages/default.html,sha256=OTZ-qwwSXu7PFbsgp4kppdm1lsg_iHK7FCFqhPnvrEs,741
77
82
  dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html,sha256=qvI6tHuI0UQbMBCuvPgK1a_zLANB6w7KVo9N5d8r-i0,829
78
83
  dbt_platform_helper/templates/svc/maintenance_pages/migration.html,sha256=GiQsOiuaMFb7jG5_wU3V7BMcByHBl9fOBgrNf8quYlw,783
79
- dbt_platform_helper/templates/svc/manifest-backend.yml,sha256=aAD9ndkbXnF7JBAKS21rl6wmCuIQufHaaAO7yqVHgj4,2571
80
- dbt_platform_helper/templates/svc/manifest-public.yml,sha256=6NHVR_onBu5hbwynLrB6roDRce7JcylSc0qeYvzlPdI,3664
81
84
  dbt_platform_helper/templates/svc/overrides/cfn.patches.yml,sha256=W7-d017akuUq9kda64DQxazavcRcCPDjaAik6t1EZqM,742
82
85
  dbt_platform_helper/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
83
86
  dbt_platform_helper/utils/application.py,sha256=_O2ywJRYYdWfBVz4LzD07PLO9hSPJf7FylE6toH19KM,5448
84
87
  dbt_platform_helper/utils/arn_parser.py,sha256=BaXzIxSOLdFmP_IfAxRq-0j-0Re1iCN7L4j2Zi5-CRQ,1304
85
- dbt_platform_helper/utils/aws.py,sha256=2QqONqwivHTLa18p5DlpnYO-5ZspzhuhmXE4iusRSn4,17767
88
+ dbt_platform_helper/utils/aws.py,sha256=trdBgq1HqbW9rczog1LTZ1XLTwn2L1liUFrl9QSTDNA,12589
86
89
  dbt_platform_helper/utils/click.py,sha256=Fx4y4bbve1zypvog_sgK7tJtCocmzheoEFLBRv1lfdM,2943
87
- dbt_platform_helper/utils/cloudfoundry.py,sha256=GnQ4fVLnDfOdNSrsJjI6ElZHqpgwINeoPn77cUH2UFY,484
88
- dbt_platform_helper/utils/files.py,sha256=adQtG2E1IQHDKfeX06l6j1B7UTYukwBuR_uhJHaoi5M,1873
89
- dbt_platform_helper/utils/git.py,sha256=7JGZMaI8-cU6-GjXIXjOlsYfKu_RppLOGyAicBd4n_8,704
90
- dbt_platform_helper/utils/manifests.py,sha256=ji3UYHCxq9tTpkm4MlRa2y0-JOYYqq1pWZ2h_zpj0UU,507
90
+ dbt_platform_helper/utils/git.py,sha256=pVa6K9LFscAHFpVEOZFoUwj-uHZP-52MFH7_C-uPQGs,782
91
91
  dbt_platform_helper/utils/messages.py,sha256=nWA7BWLb7ND0WH5TejDN4OQUJSKYBxU4tyCzteCrfT0,142
92
92
  dbt_platform_helper/utils/template.py,sha256=g-Db-0I6a6diOHkgK1nYA0IxJSO4TRrjqOvlyeOR32o,950
93
- dbt_platform_helper/utils/tool_versioning.py,sha256=iepmQJkiXS2jPDnJcoR1T4PYrRbt3OIdvddJcG3ZVOU,4206
93
+ dbt_platform_helper/utils/tool_versioning.py,sha256=UXrICUnnWCSpOdIIJaVnZcN2U3pgCUbpjvL4exevDbw,510
94
94
  dbt_platform_helper/utils/validation.py,sha256=coN7WsKW_nPGW9EU23AInBkAuvUl1NfQvc2bjVtgs14,1188
95
- platform_helper.py,sha256=lUGBsVgsGGJSDXxRvtvZCo2ybRAWuJXosbzfTzkIxU8,1892
96
- dbt_platform_helper-13.2.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
97
- dbt_platform_helper-13.2.0.dist-info/METADATA,sha256=jtiVbjA6HBJYRorbDd_aHvMwq-zcMN00UnXsIOiAE2Y,3243
98
- dbt_platform_helper-13.2.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
99
- dbt_platform_helper-13.2.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
100
- dbt_platform_helper-13.2.0.dist-info/RECORD,,
95
+ platform_helper.py,sha256=_YNNGtMkH5BcpC_mQQYJrmlf2mt7lkxTYeH7ZgflPoA,1925
96
+ dbt_platform_helper-13.3.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
97
+ dbt_platform_helper-13.3.0.dist-info/METADATA,sha256=ebTgbrOTabzJ8qyfYiXRv_sPazEI02tdhbhu7v3XUbg,3243
98
+ dbt_platform_helper-13.3.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
99
+ dbt_platform_helper-13.3.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
100
+ dbt_platform_helper-13.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
platform_helper.py CHANGED
@@ -42,4 +42,4 @@ platform_helper.add_command(database_commands)
42
42
  platform_helper.add_command(version_commands)
43
43
 
44
44
  if __name__ == "__main__":
45
- platform_helper()
45
+ platform_helper(auto_envvar_prefix="DBT_PLATFORM")
@@ -1,69 +0,0 @@
1
- # {% version_info %}
2
- # The manifest for the "{{ name }}" service.
3
- # Read the full specification for the "Backend Service" type at:
4
- # https://aws.github.io/copilot-cli/docs/manifest/backend-service/
5
-
6
- # Your service name will be used in naming your resources like log groups, ECS services, etc.
7
- name: {{ name }}
8
- type: Backend Service
9
-
10
- # Your service does not allow any traffic.
11
-
12
- # Configuration for your containers and service.
13
- image:
14
- location: {{ image_location }}
15
- # Your task should have a health check.
16
- # Celery example: https://github.com/uktrade/copilot-python?tab=readme-ov-file#celery-health-check
17
- healthcheck:
18
- command: [ "CMD-SHELL", "launcher bash -c 'echo \"Dummy health check - please replace\"'" ]
19
- interval: 10s
20
- timeout: 5s
21
- retries: 2
22
- start_period: 10s
23
-
24
- cpu: 256 # Number of CPU units for the task.
25
- memory: 512 # Amount of memory in MiB used by the task.
26
- count: # See https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
27
- range: 2-10
28
- cooldown:
29
- in: 120s
30
- out: 60s
31
- cpu_percentage: 50
32
- exec: true # Enable running commands in your container.
33
- network:
34
- connect: true # Enable Service Connect for intra-environment traffic between services.
35
- vpc:
36
- placement: 'private'
37
-
38
- storage:
39
- readonly_fs: true # Limit to read-only access to mounted root filesystems.
40
-
41
- variables: # Pass environment variables as key value pairs.
42
- PORT: 8080 # The bootstrap container requires a $PORT env var
43
- {%- for envvar, value in env_vars.items() %}
44
- {{ envvar }}: {{ value }}
45
- {%- endfor %}
46
-
47
- {% if secrets %}
48
- secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
49
- {%- for secret, value in secrets.items() %}
50
- {{ secret }}: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/{{ value }}{% endfor -%}
51
- {% else %}
52
- # secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
53
- {% endif %}
54
-
55
-
56
- # You can override any of the values defined above by environment.
57
- environments:
58
- {%- for env_name, env in environments.items() %}
59
- {{ env_name }}:
60
- {%- if env.memory %}
61
- memory: {{ env.memory }}
62
- {%- endif %}
63
- {%- if env.count and env.count is mapping %}
64
- count: # For options see https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
65
- {{ env.count | to_yaml | indent(6) | trim }}
66
- {%- elif env.count %}
67
- count: {{ env.count }} # For options see https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
68
- {%- endif %}
69
- {%- endfor %}
@@ -1,109 +0,0 @@
1
- # {% version_info %}
2
- # The manifest for the "{{ name }}" service.
3
- # Read the full specification for the "Load Balanced Web Service" type at:
4
- # https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
5
-
6
- # Your service name will be used in naming your resources like log groups, ECS services, etc.
7
- name: {{ name }}
8
- type: Load Balanced Web Service
9
-
10
- # Distribute traffic to your service.
11
- http:
12
- # Requests to this path will be forwarded to your service.
13
- # To match all requests you can use the "/" path.
14
- path: '/'
15
- # You can specify a custom health check path. The default is "/".
16
- # healthcheck: '/'
17
- target_container: nginx
18
- healthcheck:
19
- path: '/'
20
- port: 8080
21
- success_codes: '200,301,302'
22
- healthy_threshold: 3
23
- unhealthy_threshold: 2
24
- grace_period: 180s
25
-
26
- sidecars:
27
- nginx:
28
- port: 443
29
- image: public.ecr.aws/uktrade/nginx-dbt-platform:latest
30
- variables:
31
- SERVER: localhost:8000
32
-
33
- ipfilter:
34
- port: 8000
35
- image: public.ecr.aws/uktrade/ip-filter:latest
36
- variables:
37
- PORT: 8000
38
- SERVER: localhost:8080
39
- APPCONFIG_PROFILES: ipfilter:default:default
40
- IPFILTER_ENABLED: {{ ipfilter }}
41
- EMAIL: sre@digital.trade.gov.uk
42
- ADDITIONAL_IP_LIST: /${AWS_PROFILE}/EGRESS_IPS
43
-
44
- appconfig:
45
- port: 2772
46
- image: public.ecr.aws/aws-appconfig/aws-appconfig-agent:2.x
47
- essential: true
48
- variables:
49
- ROLE_ARN: arn:aws:iam::763451185160:role/AppConfigIpFilterRole
50
-
51
- # Configuration for your containers and service.
52
- image:
53
- location: {{ image_location }}
54
- # Port exposed through your container to route traffic to it.
55
- port: 8080
56
-
57
- cpu: 256 # Number of CPU units for the task.
58
- memory: 512 # Amount of memory in MiB used by the task.
59
- count: # See https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
60
- range: 2-10
61
- cooldown:
62
- in: 120s
63
- out: 60s
64
- cpu_percentage: 50
65
- exec: true # Enable running commands in your container.
66
- network:
67
- connect: true # Enable Service Connect for intra-environment traffic between services.
68
- vpc:
69
- placement: 'private'
70
-
71
- # The application currently may not work if the file system is readonly, e.g...
72
- # FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/workspace']
73
- # ...so you may need to comment out the two lines below...
74
- storage:
75
- readonly_fs: true # Limit to read-only access to mounted root filesystems.
76
-
77
- # Optional fields for more advanced use-cases.
78
- #
79
- variables: # Pass environment variables as key value pairs.
80
- PORT: 8080
81
- {%- for envvar, value in env_vars.items() %}
82
- {{ envvar }}: {{ value }}
83
- {%- endfor %}
84
-
85
- {% if secrets %}
86
- secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
87
- {%- for secret, value in secrets.items() %}
88
- {{ secret }}: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/{{ value }}{% endfor -%}
89
- {% else %}
90
- # secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
91
- {% endif %}
92
-
93
-
94
- # You can override any of the values defined above by environment.
95
- environments:
96
- {%- for env_name, env in environments.items() %}
97
- {{ env_name }}:
98
- http:
99
- alias: {{ env.url }}
100
- {%- if env.memory %}
101
- memory: {{ env.memory }}
102
- {%- endif %}
103
- {%- if env.count and env.count is mapping %}
104
- count: # For options see https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
105
- {{ env.count | to_yaml | indent(6) | trim }}
106
- {%- elif env.count %}
107
- count: {{ env.count }} # For options see https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/#count
108
- {%- endif %}
109
- {%- endfor %}
@@ -1,14 +0,0 @@
1
- import click
2
- from cloudfoundry_client.client import CloudFoundryClient
3
-
4
-
5
- def get_cloud_foundry_client_or_abort():
6
- try:
7
- client = CloudFoundryClient.build_from_cf_config()
8
- click.secho("Logged in to Cloud Foundry", fg="green")
9
- return client
10
- except Exception as ex:
11
- click.secho("Could not connect to Cloud Foundry: ", fg="red", nl=False)
12
- click.secho(str(ex))
13
- click.secho("Please log in with: cf login", fg="yellow")
14
- exit(1)