dbt-platform-helper 12.5.1__tar.gz → 12.6.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.

Files changed (107) hide show
  1. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/PKG-INFO +2 -2
  2. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/COMMANDS.md +38 -35
  3. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/codebase.py +5 -8
  4. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/conduit.py +2 -2
  5. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/config.py +1 -1
  6. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/environment.py +32 -18
  7. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/pipeline.py +0 -3
  8. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/codebase.py +13 -20
  9. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/conduit.py +10 -12
  10. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/config_validator.py +40 -7
  11. dbt_platform_helper-12.6.0/dbt_platform_helper/domain/copilot_environment.py +208 -0
  12. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/database_copy.py +38 -37
  13. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/maintenance_page.py +206 -193
  14. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/pipelines.py +10 -11
  15. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/terraform_environment.py +3 -3
  16. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/cloudformation.py +12 -1
  17. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/config.py +10 -12
  18. dbt_platform_helper-12.6.0/dbt_platform_helper/providers/io.py +31 -0
  19. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/load_balancers.py +29 -3
  20. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/platform_config_schema.py +10 -7
  21. dbt_platform_helper-12.6.0/dbt_platform_helper/providers/vpc.py +106 -0
  22. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/COMMANDS.md.jinja +5 -3
  23. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/package-lock.json +819 -623
  24. dbt_platform_helper-12.6.0/dbt_platform_helper/utils/messages.py +5 -0
  25. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/pyproject.toml +2 -2
  26. dbt_platform_helper-12.5.1/dbt_platform_helper/domain/copilot_environment.py +0 -204
  27. dbt_platform_helper-12.5.1/dbt_platform_helper/providers/vpc.py +0 -57
  28. dbt_platform_helper-12.5.1/dbt_platform_helper/utils/messages.py +0 -6
  29. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/LICENSE +0 -0
  30. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/README.md +0 -0
  31. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/__init__.py +0 -0
  32. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/addon-plans.yml +0 -0
  33. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/__init__.py +0 -0
  34. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/application.py +0 -0
  35. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/copilot.py +0 -0
  36. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/database.py +0 -0
  37. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/generate.py +0 -0
  38. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/notify.py +0 -0
  39. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/secrets.py +0 -0
  40. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/commands/version.py +0 -0
  41. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/constants.py +0 -0
  42. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/default-extensions.yml +0 -0
  43. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/__init__.py +0 -0
  44. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/domain/test_platform_terraform_manifest_generator.py +0 -0
  45. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/jinja2_tags.py +0 -0
  46. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/platform_exception.py +0 -0
  47. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/__init__.py +0 -0
  48. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/aws.py +0 -0
  49. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/cache.py +0 -0
  50. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/copilot.py +0 -0
  51. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/ecs.py +0 -0
  52. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/files.py +0 -0
  53. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/opensearch.py +0 -0
  54. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/redis.py +0 -0
  55. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/secrets.py +0 -0
  56. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/validation.py +0 -0
  57. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/providers/yaml_file.py +0 -0
  58. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
  59. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
  60. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
  61. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
  62. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
  63. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
  64. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
  65. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/README.md +0 -0
  66. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
  67. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
  68. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/svc/s3-cross-account-policy.yml +0 -0
  69. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
  70. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
  71. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
  72. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
  73. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
  74. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/env/manifest.yml +0 -0
  75. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
  76. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/environment-pipelines/main.tf +0 -0
  77. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/environments/main.tf +0 -0
  78. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/manifest.yml +0 -0
  79. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/.gitignore +0 -0
  80. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/bin/override.ts +0 -0
  81. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.deploy.yml +0 -0
  82. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/buildspec.image.yml +0 -0
  83. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/cdk.json +0 -0
  84. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/package.json +0 -0
  85. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/stack.ts +0 -0
  86. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/tsconfig.json +0 -0
  87. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/pipelines/codebase/overrides/types.ts +0 -0
  88. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
  89. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
  90. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
  91. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/manifest-backend.yml +0 -0
  92. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/manifest-public.yml +0 -0
  93. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +0 -0
  94. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/__init__.py +0 -0
  95. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/application.py +0 -0
  96. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/arn_parser.py +0 -0
  97. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/aws.py +0 -0
  98. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/click.py +0 -0
  99. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/cloudfoundry.py +0 -0
  100. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/files.py +0 -0
  101. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/git.py +0 -0
  102. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/manifests.py +0 -0
  103. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/platform_config.py +0 -0
  104. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/template.py +0 -0
  105. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/validation.py +0 -0
  106. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/dbt_platform_helper/utils/versioning.py +0 -0
  107. {dbt_platform_helper-12.5.1 → dbt_platform_helper-12.6.0}/platform_helper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-platform-helper
3
- Version: 12.5.1
3
+ Version: 12.6.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
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: Jinja2 (==3.1.4)
16
+ Requires-Dist: Jinja2 (==3.1.5)
17
17
  Requires-Dist: PyYAML (==6.0.1)
18
18
  Requires-Dist: aiohttp (>=3.8.4,<4.0.0)
19
19
  Requires-Dist: boto3 (>=1.28.24,<2.0.0)
@@ -1,40 +1,40 @@
1
1
  # Commands Reference
2
2
 
3
3
  - [platform-helper](#platform-helper)
4
- - [platform-helper application](#platform-helper-application)
5
- - [platform-helper application container-stats](#platform-helper-application-container-stats)
6
- - [platform-helper application task-stats](#platform-helper-application-task-stats)
7
- - [platform-helper codebase](#platform-helper-codebase)
8
- - [platform-helper codebase prepare](#platform-helper-codebase-prepare)
9
- - [platform-helper codebase list](#platform-helper-codebase-list)
10
- - [platform-helper codebase build](#platform-helper-codebase-build)
11
- - [platform-helper codebase deploy](#platform-helper-codebase-deploy)
12
- - [platform-helper conduit](#platform-helper-conduit)
13
- - [platform-helper config](#platform-helper-config)
14
- - [platform-helper config validate](#platform-helper-config-validate)
15
- - [platform-helper config aws](#platform-helper-config-aws)
16
- - [platform-helper copilot](#platform-helper-copilot)
17
- - [platform-helper copilot make-addons](#platform-helper-copilot-make-addons)
18
- - [platform-helper environment](#platform-helper-environment)
19
- - [platform-helper environment offline](#platform-helper-environment-offline)
20
- - [platform-helper environment online](#platform-helper-environment-online)
21
- - [platform-helper environment generate](#platform-helper-environment-generate)
22
- - [platform-helper environment generate-terraform](#platform-helper-environment-generate-terraform)
23
- - [platform-helper generate](#platform-helper-generate)
24
- - [platform-helper pipeline](#platform-helper-pipeline)
25
- - [platform-helper pipeline generate](#platform-helper-pipeline-generate)
26
- - [platform-helper secrets](#platform-helper-secrets)
27
- - [platform-helper secrets copy](#platform-helper-secrets-copy)
28
- - [platform-helper secrets list](#platform-helper-secrets-list)
29
- - [platform-helper notify](#platform-helper-notify)
30
- - [platform-helper notify environment-progress](#platform-helper-notify-environment-progress)
31
- - [platform-helper notify add-comment](#platform-helper-notify-add-comment)
32
- - [platform-helper database](#platform-helper-database)
33
- - [platform-helper database dump](#platform-helper-database-dump)
34
- - [platform-helper database load](#platform-helper-database-load)
35
- - [platform-helper database copy](#platform-helper-database-copy)
36
- - [platform-helper version](#platform-helper-version)
37
- - [platform-helper version get-platform-helper-for-project](#platform-helper-version-get-platform-helper-for-project)
4
+ - [platform-helper application](#platform-helper-application)
5
+ - [platform-helper application container-stats](#platform-helper-application-container-stats)
6
+ - [platform-helper application task-stats](#platform-helper-application-task-stats)
7
+ - [platform-helper codebase](#platform-helper-codebase)
8
+ - [platform-helper codebase prepare](#platform-helper-codebase-prepare)
9
+ - [platform-helper codebase list](#platform-helper-codebase-list)
10
+ - [platform-helper codebase build](#platform-helper-codebase-build)
11
+ - [platform-helper codebase deploy](#platform-helper-codebase-deploy)
12
+ - [platform-helper conduit](#platform-helper-conduit)
13
+ - [platform-helper config](#platform-helper-config)
14
+ - [platform-helper config validate](#platform-helper-config-validate)
15
+ - [platform-helper config aws](#platform-helper-config-aws)
16
+ - [platform-helper copilot](#platform-helper-copilot)
17
+ - [platform-helper copilot make-addons](#platform-helper-copilot-make-addons)
18
+ - [platform-helper environment](#platform-helper-environment)
19
+ - [platform-helper environment offline](#platform-helper-environment-offline)
20
+ - [platform-helper environment online](#platform-helper-environment-online)
21
+ - [platform-helper environment generate](#platform-helper-environment-generate)
22
+ - [platform-helper environment generate-terraform](#platform-helper-environment-generate-terraform)
23
+ - [platform-helper generate](#platform-helper-generate)
24
+ - [platform-helper pipeline](#platform-helper-pipeline)
25
+ - [platform-helper pipeline generate](#platform-helper-pipeline-generate)
26
+ - [platform-helper secrets](#platform-helper-secrets)
27
+ - [platform-helper secrets copy](#platform-helper-secrets-copy)
28
+ - [platform-helper secrets list](#platform-helper-secrets-list)
29
+ - [platform-helper notify](#platform-helper-notify)
30
+ - [platform-helper notify environment-progress](#platform-helper-notify-environment-progress)
31
+ - [platform-helper notify add-comment](#platform-helper-notify-add-comment)
32
+ - [platform-helper database](#platform-helper-database)
33
+ - [platform-helper database dump](#platform-helper-database-dump)
34
+ - [platform-helper database load](#platform-helper-database-load)
35
+ - [platform-helper database copy](#platform-helper-database-copy)
36
+ - [platform-helper version](#platform-helper-version)
37
+ - [platform-helper version get-platform-helper-for-project](#platform-helper-version-get-platform-helper-for-project)
38
38
 
39
39
  # platform-helper
40
40
 
@@ -457,6 +457,9 @@ platform-helper environment online --app <application> --env <environment>
457
457
 
458
458
  [↩ Parent](#platform-helper-environment)
459
459
 
460
+ Gathers various IDs and ARNs from AWS and generates the AWS Copilot
461
+ environment manifest at copilot/environments/<environment>/manifest.yml.
462
+
460
463
  ## Usage
461
464
 
462
465
  ```
@@ -467,7 +470,7 @@ platform-helper environment generate --name <name>
467
470
 
468
471
  - `--name
469
472
  -n <text>`
470
-
473
+ - The name of the environment to generate a copilot manifest for.
471
474
  - `--help <boolean>` _Defaults to False._
472
475
  - Show this message and exit.
473
476
 
@@ -2,6 +2,7 @@ import click
2
2
 
3
3
  from dbt_platform_helper.domain.codebase import Codebase
4
4
  from dbt_platform_helper.platform_exception import PlatformException
5
+ from dbt_platform_helper.providers.io import ClickIOProvider
5
6
  from dbt_platform_helper.utils.click import ClickDocOptGroup
6
7
  from dbt_platform_helper.utils.versioning import (
7
8
  check_platform_helper_version_needs_update,
@@ -20,8 +21,7 @@ def prepare():
20
21
  try:
21
22
  Codebase().prepare()
22
23
  except PlatformException as err:
23
- click.secho(str(err), fg="red")
24
- raise click.Abort
24
+ ClickIOProvider().abort_with_error(str(err))
25
25
 
26
26
 
27
27
  @codebase.command()
@@ -37,8 +37,7 @@ def list(app, with_images):
37
37
  try:
38
38
  Codebase().list(app, with_images)
39
39
  except PlatformException as err:
40
- click.secho(str(err), fg="red")
41
- raise click.Abort
40
+ ClickIOProvider().abort_with_error(str(err))
42
41
 
43
42
 
44
43
  @codebase.command()
@@ -54,8 +53,7 @@ def build(app, codebase, commit):
54
53
  try:
55
54
  Codebase().build(app, codebase, commit)
56
55
  except PlatformException as err:
57
- click.secho(str(err), fg="red")
58
- raise click.Abort
56
+ ClickIOProvider().abort_with_error(str(err))
59
57
 
60
58
 
61
59
  @codebase.command()
@@ -71,5 +69,4 @@ def deploy(app, env, codebase, commit):
71
69
  try:
72
70
  Codebase().deploy(app, env, codebase, commit)
73
71
  except PlatformException as err:
74
- click.secho(str(err), fg="red")
75
- raise click.Abort
72
+ ClickIOProvider().abort_with_error(str(err))
@@ -4,6 +4,7 @@ from dbt_platform_helper.domain.conduit import Conduit
4
4
  from dbt_platform_helper.platform_exception import PlatformException
5
5
  from dbt_platform_helper.providers.cloudformation import CloudFormation
6
6
  from dbt_platform_helper.providers.ecs import ECS
7
+ from dbt_platform_helper.providers.io import ClickIOProvider
7
8
  from dbt_platform_helper.providers.secrets import Secrets
8
9
  from dbt_platform_helper.utils.application import load_application
9
10
  from dbt_platform_helper.utils.click import ClickDocOptCommand
@@ -54,5 +55,4 @@ def conduit(addon_name: str, app: str, env: str, access: str):
54
55
  env, addon_name, access
55
56
  )
56
57
  except PlatformException as err:
57
- click.secho(str(err), fg="red")
58
- raise click.Abort
58
+ ClickIOProvider().abort_with_error(str(err))
@@ -98,7 +98,7 @@ def deployment():
98
98
 
99
99
  recommendations = {}
100
100
 
101
- ConfigProvider.config_file_check()
101
+ ConfigProvider().config_file_check()
102
102
 
103
103
  for template_file in addons_templates:
104
104
  generated_with_version = maybe
@@ -1,14 +1,17 @@
1
1
  import click
2
- from schema import SchemaError
3
2
 
4
3
  from dbt_platform_helper.constants import DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION
5
- from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
6
4
  from dbt_platform_helper.domain.config_validator import ConfigValidator
7
5
  from dbt_platform_helper.domain.copilot_environment import CopilotEnvironment
8
6
  from dbt_platform_helper.domain.maintenance_page import MaintenancePage
9
7
  from dbt_platform_helper.domain.terraform_environment import TerraformEnvironment
10
8
  from dbt_platform_helper.platform_exception import PlatformException
9
+ from dbt_platform_helper.providers.cloudformation import CloudFormation
11
10
  from dbt_platform_helper.providers.config import ConfigProvider
11
+ from dbt_platform_helper.providers.io import ClickIOProvider
12
+ from dbt_platform_helper.providers.vpc import VpcProvider
13
+ from dbt_platform_helper.utils.application import load_application
14
+ from dbt_platform_helper.utils.aws import get_aws_session_or_abort
12
15
  from dbt_platform_helper.utils.click import ClickDocOptGroup
13
16
  from dbt_platform_helper.utils.versioning import (
14
17
  check_platform_helper_version_needs_update,
@@ -36,11 +39,12 @@ def environment():
36
39
  @click.option("--vpc", type=str)
37
40
  def offline(app, env, svc, template, vpc):
38
41
  """Take load-balanced web services offline with a maintenance page."""
42
+
39
43
  try:
40
- MaintenancePage().activate(app, env, svc, template, vpc)
44
+ application = load_application(app)
45
+ MaintenancePage(application).activate(env, svc, template, vpc)
41
46
  except PlatformException as err:
42
- click.secho(str(err), fg="red")
43
- raise click.Abort
47
+ ClickIOProvider().abort_with_error(str(err))
44
48
 
45
49
 
46
50
  @environment.command()
@@ -48,26 +52,37 @@ def offline(app, env, svc, template, vpc):
48
52
  @click.option("--env", type=str, required=True)
49
53
  def online(app, env):
50
54
  """Remove a maintenance page from an environment."""
55
+
51
56
  try:
52
- MaintenancePage().deactivate(app, env)
57
+ application = load_application(app)
58
+ MaintenancePage(application).deactivate(env)
53
59
  except PlatformException as err:
54
- click.secho(str(err), fg="red")
55
- raise click.Abort
60
+ ClickIOProvider().abort_with_error(str(err))
56
61
 
57
62
 
58
63
  @environment.command()
59
- @click.option("--name", "-n", required=True)
64
+ @click.option(
65
+ "--name",
66
+ "-n",
67
+ required=True,
68
+ help="The name of the environment to generate a copilot manifest for.",
69
+ )
60
70
  def generate(name):
71
+ """Gathers various IDs and ARNs from AWS and generates the AWS Copilot
72
+ environment manifest at copilot/environments/<environment>/manifest.yml."""
73
+
74
+ click_io = ClickIOProvider()
61
75
  try:
76
+ session = get_aws_session_or_abort()
62
77
  config_provider = ConfigProvider(ConfigValidator())
63
- CopilotEnvironment(config_provider).generate(name)
64
- # TODO this exception will never be caught as the config provider catches schema errors and aborts
65
- except SchemaError as ex:
66
- click.secho(f"Invalid `{PLATFORM_CONFIG_FILE}` file: {str(ex)}", fg="red")
67
- raise click.Abort
78
+ vpc_provider = VpcProvider(session)
79
+ cloudformation_provider = CloudFormation(session.client("cloudformation"))
80
+
81
+ CopilotEnvironment(
82
+ config_provider, vpc_provider, cloudformation_provider, session
83
+ ).generate(name)
68
84
  except PlatformException as err:
69
- click.secho(str(err), fg="red")
70
- raise click.Abort
85
+ click_io.abort_with_error(str(err))
71
86
 
72
87
 
73
88
  @environment.command(help="Generate terraform manifest for the specified environment.")
@@ -84,5 +99,4 @@ def generate_terraform(name, terraform_platform_modules_version):
84
99
  config_provider = ConfigProvider(ConfigValidator())
85
100
  TerraformEnvironment(config_provider).generate(name, terraform_platform_modules_version)
86
101
  except PlatformException as err:
87
- click.secho(str(err), fg="red")
88
- raise click.Abort
102
+ ClickIOProvider().abort_with_error(str(err))
@@ -9,7 +9,6 @@ from dbt_platform_helper.providers.config import ConfigProvider
9
9
  from dbt_platform_helper.utils.aws import get_codestar_connection_arn
10
10
  from dbt_platform_helper.utils.click import ClickDocOptGroup
11
11
  from dbt_platform_helper.utils.git import git_remote
12
- from dbt_platform_helper.utils.messages import abort_with_error
13
12
  from dbt_platform_helper.utils.versioning import (
14
13
  check_platform_helper_version_needs_update,
15
14
  )
@@ -52,8 +51,6 @@ def generate(terraform_platform_modules_version, deploy_branch):
52
51
  """
53
52
  pipelines = Pipelines(
54
53
  ConfigProvider(ConfigValidator()),
55
- click.secho,
56
- abort_with_error,
57
54
  git_remote,
58
55
  get_codestar_connection_arn,
59
56
  )
@@ -4,13 +4,13 @@ import subprocess
4
4
  from collections.abc import Callable
5
5
  from pathlib import Path
6
6
 
7
- import click
8
7
  import requests
9
8
  import yaml
10
9
  from boto3 import Session
11
10
 
12
11
  from dbt_platform_helper.platform_exception import PlatformException
13
12
  from dbt_platform_helper.providers.files import FileProvider
13
+ from dbt_platform_helper.providers.io import ClickIOProvider
14
14
  from dbt_platform_helper.utils.application import Application
15
15
  from dbt_platform_helper.utils.application import ApplicationException
16
16
  from dbt_platform_helper.utils.application import load_application
@@ -27,9 +27,7 @@ from dbt_platform_helper.utils.template import setup_templates
27
27
  class Codebase:
28
28
  def __init__(
29
29
  self,
30
- input: Callable[[str], str] = click.prompt,
31
- echo: Callable[[str], str] = click.secho,
32
- confirm: Callable[[str], bool] = click.confirm,
30
+ io: ClickIOProvider = ClickIOProvider(),
33
31
  load_application: Callable[[str], Application] = load_application,
34
32
  get_aws_session_or_abort: Callable[[str], Session] = get_aws_session_or_abort,
35
33
  check_codebase_exists: Callable[[str], str] = check_codebase_exists,
@@ -40,9 +38,7 @@ class Codebase:
40
38
  check_if_commit_exists: Callable[[str], str] = check_if_commit_exists,
41
39
  run_subprocess: Callable[[str], str] = subprocess.run,
42
40
  ):
43
- self.input = input
44
- self.echo = echo
45
- self.confirm = confirm
41
+ self.io = io
46
42
  self.load_application = load_application
47
43
  self.get_aws_session_or_abort = get_aws_session_or_abort
48
44
  self.check_codebase_exists = check_codebase_exists
@@ -91,7 +87,7 @@ class Codebase:
91
87
  config_contents = templates.get_template(f".copilot/config.yml").render(
92
88
  repository=repository, builder_version=builder_version
93
89
  )
94
- self.echo(
90
+ self.io.info(
95
91
  FileProvider.mkfile(
96
92
  Path("."), ".copilot/image_build_run.sh", image_build_run_contents, overwrite=True
97
93
  )
@@ -100,14 +96,14 @@ class Codebase:
100
96
  image_build_run_file = Path(".copilot/image_build_run.sh")
101
97
  image_build_run_file.chmod(image_build_run_file.stat().st_mode | stat.S_IEXEC)
102
98
 
103
- self.echo(
99
+ self.io.info(
104
100
  FileProvider.mkfile(Path("."), ".copilot/config.yml", config_contents, overwrite=True)
105
101
  )
106
102
 
107
103
  for phase in ["build", "install", "post_build", "pre_build"]:
108
104
  phase_contents = templates.get_template(f".copilot/phases/{phase}.sh").render()
109
105
 
110
- self.echo(
106
+ self.io.info(
111
107
  FileProvider.mkfile(
112
108
  Path("./.copilot"), f"phases/{phase}.sh", phase_contents, overwrite=True
113
109
  )
@@ -122,7 +118,6 @@ class Codebase:
122
118
 
123
119
  codebuild_client = session.client("codebuild")
124
120
  build_url = self.__start_build_with_confirmation(
125
- self.confirm,
126
121
  codebuild_client,
127
122
  self.get_build_url_from_arn,
128
123
  f'You are about to build "{app}" for "{codebase}" with commit "{commit}". Do you want to continue?',
@@ -134,7 +129,7 @@ class Codebase:
134
129
  )
135
130
 
136
131
  if build_url:
137
- return self.echo(
132
+ return self.io.info(
138
133
  f"Your build has been triggered. Check your build progress in the AWS Console: {build_url}"
139
134
  )
140
135
 
@@ -154,7 +149,6 @@ class Codebase:
154
149
 
155
150
  codebuild_client = session.client("codebuild")
156
151
  build_url = self.__start_build_with_confirmation(
157
- self.confirm,
158
152
  codebuild_client,
159
153
  self.get_build_url_from_arn,
160
154
  f'You are about to deploy "{app}" for "{codebase}" with commit "{commit}" to the "{env}" environment. Do you want to continue?',
@@ -170,7 +164,7 @@ class Codebase:
170
164
  )
171
165
 
172
166
  if build_url:
173
- return self.echo(
167
+ return self.io.info(
174
168
  "Your deployment has been triggered. Check your build progress in the AWS Console: "
175
169
  f"{build_url}",
176
170
  )
@@ -185,19 +179,19 @@ class Codebase:
185
179
  ecr_client = session.client("ecr")
186
180
  codebases = self.__get_codebases(application, ssm_client)
187
181
 
188
- self.echo("The following codebases are available:")
182
+ self.io.info("The following codebases are available:")
189
183
 
190
184
  for codebase in codebases:
191
- self.echo(f"- {codebase['name']} (https://github.com/{codebase['repository']})")
185
+ self.io.info(f"- {codebase['name']} (https://github.com/{codebase['repository']})")
192
186
  if with_images:
193
187
  self.list_latest_images(
194
188
  ecr_client,
195
189
  f"{application.name}/{codebase['name']}",
196
190
  codebase["repository"],
197
- self.echo,
191
+ self.io.info,
198
192
  )
199
193
 
200
- self.echo("")
194
+ self.io.info("")
201
195
 
202
196
  def __get_codebases(self, application, ssm_client):
203
197
  parameters = ssm_client.get_parameters_by_path(
@@ -213,13 +207,12 @@ class Codebase:
213
207
 
214
208
  def __start_build_with_confirmation(
215
209
  self,
216
- confirm,
217
210
  codebuild_client,
218
211
  get_build_url_from_arn,
219
212
  confirmation_message,
220
213
  build_options,
221
214
  ):
222
- if confirm(confirmation_message):
215
+ if self.io.confirm(confirmation_message):
223
216
  build_arn = self.start_build_extraction(codebuild_client, build_options)
224
217
  return get_build_url_from_arn(build_arn)
225
218
  return None
@@ -1,12 +1,10 @@
1
1
  import subprocess
2
- from collections.abc import Callable
3
-
4
- import click
5
2
 
6
3
  from dbt_platform_helper.providers.cloudformation import CloudFormation
7
4
  from dbt_platform_helper.providers.copilot import connect_to_addon_client_task
8
5
  from dbt_platform_helper.providers.copilot import create_addon_client_task
9
6
  from dbt_platform_helper.providers.ecs import ECS
7
+ from dbt_platform_helper.providers.io import ClickIOProvider
10
8
  from dbt_platform_helper.providers.secrets import Secrets
11
9
  from dbt_platform_helper.utils.application import Application
12
10
 
@@ -18,7 +16,7 @@ class Conduit:
18
16
  secrets_provider: Secrets,
19
17
  cloudformation_provider: CloudFormation,
20
18
  ecs_provider: ECS,
21
- echo: Callable[[str], str] = click.secho,
19
+ io: ClickIOProvider = ClickIOProvider(),
22
20
  subprocess: subprocess = subprocess,
23
21
  connect_to_addon_client_task=connect_to_addon_client_task,
24
22
  create_addon_client_task=create_addon_client_task,
@@ -29,7 +27,7 @@ class Conduit:
29
27
  self.cloudformation_provider = cloudformation_provider
30
28
  self.ecs_provider = ecs_provider
31
29
  self.subprocess = subprocess
32
- self.echo = echo
30
+ self.io = io
33
31
  self.connect_to_addon_client_task = connect_to_addon_client_task
34
32
  self.create_addon_client_task = create_addon_client_task
35
33
 
@@ -39,10 +37,10 @@ class Conduit:
39
37
  addon_name, access
40
38
  )
41
39
 
42
- self.echo(f"Checking if a conduit task is already running for {addon_type}")
40
+ self.io.info(f"Checking if a conduit task is already running for {addon_type}")
43
41
  task_arns = self.ecs_provider.get_ecs_task_arns(cluster_arn, task_name)
44
42
  if not task_arns:
45
- self.echo("Creating conduit task")
43
+ self.io.info("Creating conduit task")
46
44
  self.create_addon_client_task(
47
45
  clients["iam"],
48
46
  clients["ssm"],
@@ -55,7 +53,7 @@ class Conduit:
55
53
  access,
56
54
  )
57
55
 
58
- self.echo("Updating conduit task")
56
+ self.io.info("Updating conduit task")
59
57
  self._update_stack_resources(
60
58
  self.application.name,
61
59
  env,
@@ -69,13 +67,13 @@ class Conduit:
69
67
  task_arns = self.ecs_provider.get_ecs_task_arns(cluster_arn, task_name)
70
68
 
71
69
  else:
72
- self.echo("Conduit task already running")
70
+ self.io.info("Conduit task already running")
73
71
 
74
- self.echo(f"Checking if exec is available for conduit task...")
72
+ self.io.info(f"Checking if exec is available for conduit task...")
75
73
 
76
74
  self.ecs_provider.ecs_exec_is_available(cluster_arn, task_arns)
77
75
 
78
- self.echo("Connecting to conduit task")
76
+ self.io.info("Connecting to conduit task")
79
77
  self.connect_to_addon_client_task(
80
78
  clients["ecs"], self.subprocess, self.application.name, env, cluster_arn, task_name
81
79
  )
@@ -115,7 +113,7 @@ class Conduit:
115
113
  parameter_name,
116
114
  access,
117
115
  )
118
- self.echo("Waiting for conduit task update to complete...")
116
+ self.io.info("Waiting for conduit task update to complete...")
119
117
  self.cloudformation_provider.wait_for_cloudformation_to_reach_status(
120
118
  "stack_update_complete", stack_name
121
119
  )
@@ -1,11 +1,11 @@
1
1
  from typing import Callable
2
2
 
3
3
  import boto3
4
- import click
5
4
 
6
5
  from dbt_platform_helper.constants import CODEBASE_PIPELINES_KEY
7
6
  from dbt_platform_helper.constants import ENVIRONMENTS_KEY
8
7
  from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
8
+ from dbt_platform_helper.providers.io import ClickIOProvider
9
9
  from dbt_platform_helper.providers.opensearch import OpensearchProvider
10
10
  from dbt_platform_helper.providers.redis import RedisProvider
11
11
  from dbt_platform_helper.utils.messages import abort_with_error
@@ -13,7 +13,9 @@ from dbt_platform_helper.utils.messages import abort_with_error
13
13
 
14
14
  class ConfigValidator:
15
15
 
16
- def __init__(self, validations: Callable[[dict], None] = None):
16
+ def __init__(
17
+ self, validations: Callable[[dict], None] = None, io: ClickIOProvider = ClickIOProvider()
18
+ ):
17
19
  self.validations = validations or [
18
20
  self.validate_supported_redis_versions,
19
21
  self.validate_supported_opensearch_versions,
@@ -21,7 +23,9 @@ class ConfigValidator:
21
23
  self.validate_codebase_pipelines,
22
24
  self.validate_environment_pipelines_triggers,
23
25
  self.validate_database_copy_section,
26
+ self.validate_database_migration_input_sources,
24
27
  ]
28
+ self.io = io
25
29
 
26
30
  def run_validations(self, config: dict):
27
31
  for validation in self.validations:
@@ -48,9 +52,8 @@ class ConfigValidator:
48
52
  environments = extension.get("environments", {})
49
53
 
50
54
  if not isinstance(environments, dict):
51
- click.secho(
52
- f"Error: {extension_type} extension definition is invalid type, expected dictionary",
53
- fg="red",
55
+ self.io.error(
56
+ f"{extension_type} extension definition is invalid type, expected dictionary",
54
57
  )
55
58
  continue
56
59
  for environment, env_config in environments.items():
@@ -64,9 +67,8 @@ class ConfigValidator:
64
67
  )
65
68
 
66
69
  for version_failure in extensions_with_invalid_version:
67
- click.secho(
70
+ self.io.error(
68
71
  f"{extension_type} version for environment {version_failure['environment']} is not in the list of supported {extension_type} versions: {supported_extension_versions}. Provided Version: {version_failure['version']}",
69
- fg="red",
70
72
  )
71
73
 
72
74
  def validate_supported_redis_versions(self, config):
@@ -240,3 +242,34 @@ class ConfigValidator:
240
242
 
241
243
  if errors:
242
244
  abort_with_error("\n".join(errors))
245
+
246
+ def validate_database_migration_input_sources(self, config):
247
+ extensions = config.get("extensions", {})
248
+ if not extensions:
249
+ return
250
+
251
+ s3_extensions = {
252
+ key: ext for key, ext in extensions.items() if ext.get("type", None) == "s3"
253
+ }
254
+
255
+ if not s3_extensions:
256
+ return
257
+
258
+ errors = []
259
+
260
+ for extension_name, extension in s3_extensions.items():
261
+ for env, env_config in extension.get("environments", {}).items():
262
+ if "data_migration" not in env_config:
263
+ continue
264
+ data_migration = env_config.get("data_migration", {})
265
+ if "import" in data_migration and "import_sources" in data_migration:
266
+ errors.append(
267
+ f"Error in '{extension_name}.environments.{env}.data_migration': only the 'import_sources' property is required - 'import' is deprecated."
268
+ )
269
+ if "import" not in data_migration and "import_sources" not in data_migration:
270
+ errors.append(
271
+ f"Error in '{extension_name}.environments.{env}.data_migration': 'import_sources' property is missing."
272
+ )
273
+
274
+ if errors:
275
+ abort_with_error("\n".join(errors))