dbt-platform-helper 13.1.0__py3-none-any.whl → 15.16.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.
- dbt_platform_helper/COMMANDS.md +107 -27
- dbt_platform_helper/commands/application.py +5 -6
- dbt_platform_helper/commands/codebase.py +31 -10
- dbt_platform_helper/commands/conduit.py +3 -5
- dbt_platform_helper/commands/config.py +20 -311
- dbt_platform_helper/commands/copilot.py +18 -391
- dbt_platform_helper/commands/database.py +17 -9
- dbt_platform_helper/commands/environment.py +20 -14
- dbt_platform_helper/commands/generate.py +0 -3
- dbt_platform_helper/commands/internal.py +140 -0
- dbt_platform_helper/commands/notify.py +58 -78
- dbt_platform_helper/commands/pipeline.py +23 -19
- dbt_platform_helper/commands/secrets.py +39 -93
- dbt_platform_helper/commands/version.py +7 -12
- dbt_platform_helper/constants.py +52 -7
- dbt_platform_helper/domain/codebase.py +89 -39
- dbt_platform_helper/domain/conduit.py +335 -76
- dbt_platform_helper/domain/config.py +381 -0
- dbt_platform_helper/domain/copilot.py +398 -0
- dbt_platform_helper/domain/copilot_environment.py +8 -8
- dbt_platform_helper/domain/database_copy.py +2 -2
- dbt_platform_helper/domain/maintenance_page.py +254 -430
- dbt_platform_helper/domain/notify.py +64 -0
- dbt_platform_helper/domain/pipelines.py +43 -35
- dbt_platform_helper/domain/plans.py +41 -0
- dbt_platform_helper/domain/secrets.py +279 -0
- dbt_platform_helper/domain/service.py +570 -0
- dbt_platform_helper/domain/terraform_environment.py +14 -13
- dbt_platform_helper/domain/update_alb_rules.py +412 -0
- dbt_platform_helper/domain/versioning.py +249 -0
- dbt_platform_helper/{providers → entities}/platform_config_schema.py +75 -82
- dbt_platform_helper/entities/semantic_version.py +83 -0
- dbt_platform_helper/entities/service.py +339 -0
- dbt_platform_helper/platform_exception.py +4 -0
- dbt_platform_helper/providers/autoscaling.py +24 -0
- dbt_platform_helper/providers/aws/__init__.py +0 -0
- dbt_platform_helper/providers/aws/exceptions.py +70 -0
- dbt_platform_helper/providers/aws/interfaces.py +13 -0
- dbt_platform_helper/providers/aws/opensearch.py +23 -0
- dbt_platform_helper/providers/aws/redis.py +21 -0
- dbt_platform_helper/providers/aws/sso_auth.py +75 -0
- dbt_platform_helper/providers/cache.py +40 -4
- dbt_platform_helper/providers/cloudformation.py +1 -1
- dbt_platform_helper/providers/config.py +137 -19
- dbt_platform_helper/providers/config_validator.py +112 -51
- dbt_platform_helper/providers/copilot.py +24 -16
- dbt_platform_helper/providers/ecr.py +89 -7
- dbt_platform_helper/providers/ecs.py +228 -36
- dbt_platform_helper/providers/environment_variable.py +24 -0
- dbt_platform_helper/providers/files.py +1 -1
- dbt_platform_helper/providers/io.py +36 -4
- dbt_platform_helper/providers/kms.py +22 -0
- dbt_platform_helper/providers/load_balancers.py +402 -42
- dbt_platform_helper/providers/logs.py +72 -0
- dbt_platform_helper/providers/parameter_store.py +134 -0
- dbt_platform_helper/providers/s3.py +21 -0
- dbt_platform_helper/providers/schema_migrations/__init__.py +0 -0
- dbt_platform_helper/providers/schema_migrations/schema_v0_to_v1_migration.py +43 -0
- dbt_platform_helper/providers/schema_migrator.py +77 -0
- dbt_platform_helper/providers/secrets.py +5 -5
- dbt_platform_helper/providers/slack_channel_notifier.py +62 -0
- dbt_platform_helper/providers/terraform_manifest.py +121 -19
- dbt_platform_helper/providers/version.py +106 -23
- dbt_platform_helper/providers/version_status.py +27 -0
- dbt_platform_helper/providers/vpc.py +36 -5
- dbt_platform_helper/providers/yaml_file.py +58 -2
- dbt_platform_helper/templates/environment-pipelines/main.tf +4 -3
- dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +5 -0
- dbt_platform_helper/utilities/decorators.py +103 -0
- dbt_platform_helper/utils/application.py +119 -22
- dbt_platform_helper/utils/aws.py +39 -150
- dbt_platform_helper/utils/deep_merge.py +10 -0
- dbt_platform_helper/utils/git.py +1 -14
- dbt_platform_helper/utils/validation.py +1 -1
- {dbt_platform_helper-13.1.0.dist-info → dbt_platform_helper-15.16.0.dist-info}/METADATA +11 -20
- dbt_platform_helper-15.16.0.dist-info/RECORD +118 -0
- {dbt_platform_helper-13.1.0.dist-info → dbt_platform_helper-15.16.0.dist-info}/WHEEL +1 -1
- platform_helper.py +3 -1
- terraform/elasticache-redis/plans.yml +85 -0
- terraform/opensearch/plans.yml +71 -0
- terraform/postgres/plans.yml +128 -0
- dbt_platform_helper/addon-plans.yml +0 -224
- dbt_platform_helper/providers/aws.py +0 -37
- dbt_platform_helper/providers/opensearch.py +0 -36
- dbt_platform_helper/providers/redis.py +0 -34
- dbt_platform_helper/providers/semantic_version.py +0 -126
- dbt_platform_helper/templates/svc/manifest-backend.yml +0 -69
- dbt_platform_helper/templates/svc/manifest-public.yml +0 -109
- dbt_platform_helper/utils/cloudfoundry.py +0 -14
- dbt_platform_helper/utils/files.py +0 -53
- dbt_platform_helper/utils/manifests.py +0 -18
- dbt_platform_helper/utils/versioning.py +0 -238
- dbt_platform_helper-13.1.0.dist-info/RECORD +0 -96
- {dbt_platform_helper-13.1.0.dist-info → dbt_platform_helper-15.16.0.dist-info}/entry_points.txt +0 -0
- {dbt_platform_helper-13.1.0.dist-info → dbt_platform_helper-15.16.0.dist-info/licenses}/LICENSE +0 -0
dbt_platform_helper/COMMANDS.md
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
- [platform-helper conduit](#platform-helper-conduit)
|
|
13
13
|
- [platform-helper config](#platform-helper-config)
|
|
14
14
|
- [platform-helper config validate](#platform-helper-config-validate)
|
|
15
|
+
- [platform-helper config migrate](#platform-helper-config-migrate)
|
|
15
16
|
- [platform-helper config aws](#platform-helper-config-aws)
|
|
16
17
|
- [platform-helper copilot](#platform-helper-copilot)
|
|
17
18
|
- [platform-helper copilot make-addons](#platform-helper-copilot-make-addons)
|
|
@@ -24,10 +25,12 @@
|
|
|
24
25
|
- [platform-helper pipeline](#platform-helper-pipeline)
|
|
25
26
|
- [platform-helper pipeline generate](#platform-helper-pipeline-generate)
|
|
26
27
|
- [platform-helper secrets](#platform-helper-secrets)
|
|
28
|
+
- [platform-helper secrets create](#platform-helper-secrets-create)
|
|
27
29
|
- [platform-helper secrets copy](#platform-helper-secrets-copy)
|
|
28
30
|
- [platform-helper secrets list](#platform-helper-secrets-list)
|
|
29
31
|
- [platform-helper notify](#platform-helper-notify)
|
|
30
32
|
- [platform-helper notify environment-progress](#platform-helper-notify-environment-progress)
|
|
33
|
+
- [platform-helper notify post-message](#platform-helper-notify-post-message)
|
|
31
34
|
- [platform-helper notify add-comment](#platform-helper-notify-add-comment)
|
|
32
35
|
- [platform-helper database](#platform-helper-database)
|
|
33
36
|
- [platform-helper database dump](#platform-helper-database-dump)
|
|
@@ -61,6 +64,7 @@ platform-helper <command> [--version]
|
|
|
61
64
|
- [`database` ↪](#platform-helper-database)
|
|
62
65
|
- [`environment` ↪](#platform-helper-environment)
|
|
63
66
|
- [`generate` ↪](#platform-helper-generate)
|
|
67
|
+
- [`internal` ↪](#platform-helper-internal)
|
|
64
68
|
- [`notify` ↪](#platform-helper-notify)
|
|
65
69
|
- [`pipeline` ↪](#platform-helper-pipeline)
|
|
66
70
|
- [`secrets` ↪](#platform-helper-secrets)
|
|
@@ -236,7 +240,8 @@ platform-helper codebase build --app <application> --codebase <codebase>
|
|
|
236
240
|
|
|
237
241
|
```
|
|
238
242
|
platform-helper codebase deploy --app <application> --env <environment> --codebase <codebase>
|
|
239
|
-
--
|
|
243
|
+
[--tag <tag>] [--branch <branch>]
|
|
244
|
+
[--commit <commit>]
|
|
240
245
|
```
|
|
241
246
|
|
|
242
247
|
## Options
|
|
@@ -247,8 +252,12 @@ platform-helper codebase deploy --app <application> --env <environment> --codeba
|
|
|
247
252
|
- AWS Copilot environment
|
|
248
253
|
- `--codebase <text>`
|
|
249
254
|
- The codebase name as specified in the platform-config.yml file. This can be run from any directory.
|
|
255
|
+
- `--tag <text>`
|
|
256
|
+
- Git tag that has been built into an image. Typically a semantic version of the form 1.2.3 or v1.2.3.
|
|
257
|
+
- `--branch <text>`
|
|
258
|
+
- Git branch that has been built into an image.
|
|
250
259
|
- `--commit <text>`
|
|
251
|
-
-
|
|
260
|
+
- Git sha hash that has been built into an image.
|
|
252
261
|
- `--help <boolean>` _Defaults to False._
|
|
253
262
|
- Show this message and exit.
|
|
254
263
|
|
|
@@ -290,7 +299,7 @@ platform-helper conduit <addon_name>
|
|
|
290
299
|
## Usage
|
|
291
300
|
|
|
292
301
|
```
|
|
293
|
-
platform-helper config (validate|aws)
|
|
302
|
+
platform-helper config (validate|migrate|aws)
|
|
294
303
|
```
|
|
295
304
|
|
|
296
305
|
## Options
|
|
@@ -301,6 +310,7 @@ platform-helper config (validate|aws)
|
|
|
301
310
|
## Commands
|
|
302
311
|
|
|
303
312
|
- [`aws` ↪](#platform-helper-config-aws)
|
|
313
|
+
- [`migrate` ↪](#platform-helper-config-migrate)
|
|
304
314
|
- [`validate` ↪](#platform-helper-config-validate)
|
|
305
315
|
|
|
306
316
|
# platform-helper config validate
|
|
@@ -317,6 +327,23 @@ platform-helper config validate
|
|
|
317
327
|
|
|
318
328
|
## Options
|
|
319
329
|
|
|
330
|
+
- `--help <boolean>` _Defaults to False._
|
|
331
|
+
- Show this message and exit.
|
|
332
|
+
|
|
333
|
+
# platform-helper config migrate
|
|
334
|
+
|
|
335
|
+
[↩ Parent](#platform-helper-config)
|
|
336
|
+
|
|
337
|
+
Update configuration to match current schema.
|
|
338
|
+
|
|
339
|
+
## Usage
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
platform-helper config migrate
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
## Options
|
|
346
|
+
|
|
320
347
|
- `--help <boolean>` _Defaults to False._
|
|
321
348
|
- Show this message and exit.
|
|
322
349
|
|
|
@@ -483,7 +510,7 @@ platform-helper environment generate --name <name>
|
|
|
483
510
|
## Usage
|
|
484
511
|
|
|
485
512
|
```
|
|
486
|
-
platform-helper environment generate-terraform --name <name>
|
|
513
|
+
platform-helper environment generate-terraform --name <name>
|
|
487
514
|
```
|
|
488
515
|
|
|
489
516
|
## Options
|
|
@@ -491,8 +518,6 @@ platform-helper environment generate-terraform --name <name> [--terraform-platfo
|
|
|
491
518
|
- `--name
|
|
492
519
|
-n <text>`
|
|
493
520
|
- The name of the environment to generate a manifest for.
|
|
494
|
-
- `--terraform-platform-modules-version <text>`
|
|
495
|
-
- Override the default version of terraform-platform-modules. (Default version is '7').
|
|
496
521
|
- `--help <boolean>` _Defaults to False._
|
|
497
522
|
- Show this message and exit.
|
|
498
523
|
|
|
@@ -545,27 +570,23 @@ platform-helper pipeline generate
|
|
|
545
570
|
deployment pipelines.
|
|
546
571
|
|
|
547
572
|
This command does the following in relation to the environment pipelines:
|
|
548
|
-
- Reads contents of `platform-config.yml/
|
|
573
|
+
- Reads contents of `platform-config.yml/environment_pipelines` configuration.
|
|
549
574
|
The `terraform/environment-pipelines/<aws_account>/main.tf` file is generated using this configuration.
|
|
550
575
|
The `main.tf` file is then used to generate Terraform for creating an environment pipeline resource.
|
|
551
576
|
|
|
552
577
|
This command does the following in relation to the codebase pipelines:
|
|
553
|
-
-
|
|
578
|
+
- Reads contents of `platform-config.yml/codebase_pipelines` configuration.
|
|
579
|
+
The `terraform/codebase-pipelines/main.tf.json` file is generated using this configuration.
|
|
580
|
+
The `main.tf.json` file is then used to generate Terraform for creating a codebase pipeline resource.
|
|
554
581
|
|
|
555
582
|
## Usage
|
|
556
583
|
|
|
557
584
|
```
|
|
558
|
-
platform-helper pipeline generate [--
|
|
559
|
-
[--deploy-branch <deploy_branch>]
|
|
585
|
+
platform-helper pipeline generate [--deploy-branch <deploy_branch>]
|
|
560
586
|
```
|
|
561
587
|
|
|
562
588
|
## Options
|
|
563
589
|
|
|
564
|
-
- `--terraform-platform-modules-version <text>`
|
|
565
|
-
- Override the default version of terraform-platform-modules with a specific version or branch.
|
|
566
|
-
Precedence of version used is version supplied via CLI, then the version found in
|
|
567
|
-
platform-config.yml/default_versions/terraform-platform-modules.
|
|
568
|
-
In absence of these inputs, defaults to version '7'.
|
|
569
590
|
- `--deploy-branch <text>`
|
|
570
591
|
- Specify the branch of <application>-deploy used to configure the source stage in the environment-pipeline resource.
|
|
571
592
|
This is generated from the terraform/environments-pipeline/<aws_account>/main.tf file.
|
|
@@ -581,7 +602,7 @@ This is generated from the terraform/environments-pipeline/<aws_account>/main.tf
|
|
|
581
602
|
## Usage
|
|
582
603
|
|
|
583
604
|
```
|
|
584
|
-
platform-helper secrets (copy|list)
|
|
605
|
+
platform-helper secrets (create|copy|list)
|
|
585
606
|
```
|
|
586
607
|
|
|
587
608
|
## Options
|
|
@@ -592,30 +613,53 @@ platform-helper secrets (copy|list)
|
|
|
592
613
|
## Commands
|
|
593
614
|
|
|
594
615
|
- [`copy` ↪](#platform-helper-secrets-copy)
|
|
616
|
+
- [`create` ↪](#platform-helper-secrets-create)
|
|
595
617
|
- [`list` ↪](#platform-helper-secrets-list)
|
|
596
618
|
|
|
597
|
-
# platform-helper secrets
|
|
619
|
+
# platform-helper secrets create
|
|
598
620
|
|
|
599
621
|
[↩ Parent](#platform-helper-secrets)
|
|
600
622
|
|
|
601
|
-
|
|
623
|
+
Create a Parameter Store secret for all environments of an
|
|
624
|
+
application.
|
|
602
625
|
|
|
603
626
|
## Usage
|
|
604
627
|
|
|
605
628
|
```
|
|
606
|
-
platform-helper secrets
|
|
607
|
-
--project-profile <project_profile>
|
|
629
|
+
platform-helper secrets create --app <application> --name <name> [--overwrite]
|
|
608
630
|
```
|
|
609
631
|
|
|
610
|
-
##
|
|
632
|
+
## Options
|
|
633
|
+
|
|
634
|
+
- `--app <text>`
|
|
635
|
+
- Application name.
|
|
636
|
+
- `--name <text>`
|
|
637
|
+
- Secret name (automatically uppercased).
|
|
638
|
+
- `--overwrite <boolean>` _Defaults to False._
|
|
639
|
+
- Allows overwriting the value of secrets if they already exist.
|
|
640
|
+
- `--help <boolean>` _Defaults to False._
|
|
641
|
+
- Show this message and exit.
|
|
611
642
|
|
|
612
|
-
-
|
|
613
|
-
|
|
643
|
+
# platform-helper secrets copy
|
|
644
|
+
|
|
645
|
+
[↩ Parent](#platform-helper-secrets)
|
|
646
|
+
|
|
647
|
+
Copy secrets from one environment to another.
|
|
648
|
+
|
|
649
|
+
## Usage
|
|
650
|
+
|
|
651
|
+
```
|
|
652
|
+
platform-helper secrets copy --app <application> --source <source> --target <target>
|
|
653
|
+
```
|
|
614
654
|
|
|
615
655
|
## Options
|
|
616
656
|
|
|
617
|
-
- `--
|
|
618
|
-
-
|
|
657
|
+
- `--app <text>`
|
|
658
|
+
- Application name.
|
|
659
|
+
- `--source <text>`
|
|
660
|
+
- Source environment where to copy secrets from.
|
|
661
|
+
- `--target <text>`
|
|
662
|
+
- Destination environment where to copy secrets to.
|
|
619
663
|
- `--help <boolean>` _Defaults to False._
|
|
620
664
|
- Show this message and exit.
|
|
621
665
|
|
|
@@ -623,7 +667,7 @@ platform-helper secrets copy <source_environment> <target_environment>
|
|
|
623
667
|
|
|
624
668
|
[↩ Parent](#platform-helper-secrets)
|
|
625
669
|
|
|
626
|
-
List secret names and values for an environment.
|
|
670
|
+
[DELETED] List secret names and values for an environment.
|
|
627
671
|
|
|
628
672
|
## Usage
|
|
629
673
|
|
|
@@ -650,7 +694,7 @@ platform-helper secrets list <application> <environment>
|
|
|
650
694
|
## Usage
|
|
651
695
|
|
|
652
696
|
```
|
|
653
|
-
platform-helper notify (environment-progress|add-comment)
|
|
697
|
+
platform-helper notify (environment-progress|post-message|add-comment)
|
|
654
698
|
```
|
|
655
699
|
|
|
656
700
|
## Options
|
|
@@ -662,6 +706,7 @@ platform-helper notify (environment-progress|add-comment)
|
|
|
662
706
|
|
|
663
707
|
- [`add-comment` ↪](#platform-helper-notify-add-comment)
|
|
664
708
|
- [`environment-progress` ↪](#platform-helper-notify-environment-progress)
|
|
709
|
+
- [`post-message` ↪](#platform-helper-notify-post-message)
|
|
665
710
|
|
|
666
711
|
# platform-helper notify environment-progress
|
|
667
712
|
|
|
@@ -694,6 +739,41 @@ platform-helper notify environment-progress <slack_channel_id> <slack_token>
|
|
|
694
739
|
|
|
695
740
|
- `--commit-sha <text>`
|
|
696
741
|
|
|
742
|
+
- `--slack-ref <text>`
|
|
743
|
+
- Slack message reference of the message to update
|
|
744
|
+
- `--help <boolean>` _Defaults to False._
|
|
745
|
+
- Show this message and exit.
|
|
746
|
+
|
|
747
|
+
# platform-helper notify post-message
|
|
748
|
+
|
|
749
|
+
[↩ Parent](#platform-helper-notify)
|
|
750
|
+
|
|
751
|
+
Send Slack notifications. This creates (or updates if --slack-ref is provided) the top level message to the channel.
|
|
752
|
+
|
|
753
|
+
## Usage
|
|
754
|
+
|
|
755
|
+
```
|
|
756
|
+
platform-helper notify post-message <slack_channel_id> <slack_token>
|
|
757
|
+
<message>
|
|
758
|
+
[--build-arn <build_arn>] [--repository <repository>]
|
|
759
|
+
[--commit-sha <commit_sha>]
|
|
760
|
+
[--slack-ref <slack_ref>]
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
## Arguments
|
|
764
|
+
|
|
765
|
+
- `slack-channel-id <text>`
|
|
766
|
+
- `slack-token <text>`
|
|
767
|
+
- `message <text>`
|
|
768
|
+
|
|
769
|
+
## Options
|
|
770
|
+
|
|
771
|
+
- `--build-arn <text>`
|
|
772
|
+
|
|
773
|
+
- `--repository <text>`
|
|
774
|
+
|
|
775
|
+
- `--commit-sha <text>`
|
|
776
|
+
|
|
697
777
|
- `--slack-ref <text>`
|
|
698
778
|
- Slack message reference of the message to update
|
|
699
779
|
- `--help <boolean>` _Defaults to False._
|
|
@@ -10,11 +10,9 @@ from datetime import timedelta
|
|
|
10
10
|
import click
|
|
11
11
|
from prettytable import PrettyTable
|
|
12
12
|
|
|
13
|
+
from dbt_platform_helper.domain.versioning import PlatformHelperVersioning
|
|
13
14
|
from dbt_platform_helper.utils.application import load_application
|
|
14
15
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
15
|
-
from dbt_platform_helper.utils.versioning import (
|
|
16
|
-
check_platform_helper_version_needs_update,
|
|
17
|
-
)
|
|
18
16
|
|
|
19
17
|
YELLOW = "\033[93m"
|
|
20
18
|
CYAN = "\033[96m"
|
|
@@ -97,7 +95,7 @@ def get_query_results(env, app, query_string, timeout):
|
|
|
97
95
|
@click.group(chain=True, cls=ClickDocOptGroup, deprecated=True)
|
|
98
96
|
def application():
|
|
99
97
|
"""[DEPRECATED] Application metrics."""
|
|
100
|
-
|
|
98
|
+
PlatformHelperVersioning().check_if_needs_update()
|
|
101
99
|
|
|
102
100
|
|
|
103
101
|
@application.command(deprecated=True)
|
|
@@ -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.
|
|
@@ -283,12 +281,13 @@ def task_stats(env, app, disk, storage, network):
|
|
|
283
281
|
memory,
|
|
284
282
|
dsk,
|
|
285
283
|
) in cpu_response["results"]:
|
|
284
|
+
cpu_value = f"{float(cpu['value']):.1f}" + "%"
|
|
286
285
|
values = [
|
|
287
286
|
f"{YELLOW}{taskdef['value'].split('-')[-1]}",
|
|
288
287
|
f"{YELLOW}{task['value']}",
|
|
289
288
|
f"{YELLOW}{task_def_revision['value']}",
|
|
290
289
|
f"{YELLOW}{status['value']}",
|
|
291
|
-
f"{YELLOW}{
|
|
290
|
+
f"{YELLOW}{cpu_value}",
|
|
292
291
|
f"{YELLOW}{memory['value'] + 'M'}",
|
|
293
292
|
]
|
|
294
293
|
|
|
@@ -1,25 +1,25 @@
|
|
|
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
|
|
7
|
+
from dbt_platform_helper.providers.parameter_store import ParameterStore
|
|
8
|
+
from dbt_platform_helper.utils.aws import get_aws_session_or_abort
|
|
6
9
|
from dbt_platform_helper.utils.click import ClickDocOptGroup
|
|
7
|
-
from dbt_platform_helper.utils.versioning import (
|
|
8
|
-
check_platform_helper_version_needs_update,
|
|
9
|
-
)
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@click.group(chain=True, cls=ClickDocOptGroup)
|
|
13
13
|
def codebase():
|
|
14
14
|
"""Codebase commands."""
|
|
15
|
-
|
|
15
|
+
PlatformHelperVersioning().check_if_needs_update()
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@codebase.command()
|
|
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
|
|
|
@@ -64,9 +66,28 @@ def build(app, codebase, commit):
|
|
|
64
66
|
help="The codebase name as specified in the platform-config.yml file. This can be run from any directory.",
|
|
65
67
|
required=True,
|
|
66
68
|
)
|
|
67
|
-
@click.option(
|
|
68
|
-
|
|
69
|
+
@click.option(
|
|
70
|
+
"--tag",
|
|
71
|
+
help="Git tag that has been built into an image. Typically a semantic version of the form 1.2.3 or v1.2.3.",
|
|
72
|
+
required=False,
|
|
73
|
+
)
|
|
74
|
+
@click.option(
|
|
75
|
+
"--branch",
|
|
76
|
+
help="Git branch that has been built into an image.",
|
|
77
|
+
required=False,
|
|
78
|
+
)
|
|
79
|
+
@click.option(
|
|
80
|
+
"--commit",
|
|
81
|
+
help="Git sha hash that has been built into an image.",
|
|
82
|
+
required=False,
|
|
83
|
+
)
|
|
84
|
+
def deploy(
|
|
85
|
+
app: str, env: str, codebase: str, commit: str = None, tag: str = None, branch: str = None
|
|
86
|
+
):
|
|
87
|
+
|
|
69
88
|
try:
|
|
70
|
-
Codebase().deploy(
|
|
89
|
+
Codebase(ParameterStore(get_aws_session_or_abort().client("ssm"))).deploy(
|
|
90
|
+
app, env, codebase, commit, tag, branch
|
|
91
|
+
)
|
|
71
92
|
except PlatformException as err:
|
|
72
93
|
ClickIOProvider().abort_with_error(str(err))
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
|
@@ -8,9 +9,6 @@ from dbt_platform_helper.providers.io import ClickIOProvider
|
|
|
8
9
|
from dbt_platform_helper.providers.secrets import Secrets
|
|
9
10
|
from dbt_platform_helper.utils.application import load_application
|
|
10
11
|
from dbt_platform_helper.utils.click import ClickDocOptCommand
|
|
11
|
-
from dbt_platform_helper.utils.versioning import (
|
|
12
|
-
check_platform_helper_version_needs_update,
|
|
13
|
-
)
|
|
14
12
|
|
|
15
13
|
CONDUIT_ACCESS_OPTIONS = ["read", "write", "admin"]
|
|
16
14
|
|
|
@@ -28,8 +26,8 @@ CONDUIT_ACCESS_OPTIONS = ["read", "write", "admin"]
|
|
|
28
26
|
def conduit(addon_name: str, app: str, env: str, access: str):
|
|
29
27
|
"""Opens a shell for a given addon_name create a conduit connection to
|
|
30
28
|
interact with postgres, opensearch or redis."""
|
|
31
|
-
|
|
32
|
-
application = load_application(app)
|
|
29
|
+
PlatformHelperVersioning().check_if_needs_update()
|
|
30
|
+
application = load_application(app=app, env=env)
|
|
33
31
|
|
|
34
32
|
try:
|
|
35
33
|
secrets_provider: Secrets = Secrets(
|