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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# t-shirt sizes for Postgres
|
|
2
|
+
# Aligned with the instance types from https://aws.amazon.com/rds/instance-types/
|
|
3
|
+
|
|
4
|
+
# 2v CPU, 1GB RAM, 100GB Storage
|
|
5
|
+
tiny:
|
|
6
|
+
volume_size: 100
|
|
7
|
+
multi_az: false
|
|
8
|
+
instance: db.t3.micro
|
|
9
|
+
|
|
10
|
+
# 2v CPU, 2GB RAM, 100GB Storage
|
|
11
|
+
small:
|
|
12
|
+
volume_size: 100
|
|
13
|
+
multi_az: false
|
|
14
|
+
instance: db.t3.small
|
|
15
|
+
|
|
16
|
+
# 2v CPU, 2GB RAM, 100GB Storage, multi AZ
|
|
17
|
+
small-ha:
|
|
18
|
+
volume_size: 100
|
|
19
|
+
multi_az: true
|
|
20
|
+
instance: db.t3.small
|
|
21
|
+
|
|
22
|
+
# 2v CPU, 2GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
23
|
+
small-high-io:
|
|
24
|
+
volume_size: 100
|
|
25
|
+
multi_az: true
|
|
26
|
+
instance: db.t3.small
|
|
27
|
+
storage_type: io2
|
|
28
|
+
iops: 40000
|
|
29
|
+
|
|
30
|
+
# # 2v CPU, 4GB RAM, 100GB Storage
|
|
31
|
+
medium:
|
|
32
|
+
volume_size: 100
|
|
33
|
+
multi_az: false
|
|
34
|
+
instance: db.t3.medium
|
|
35
|
+
|
|
36
|
+
# # 2v CPU, 4GB RAM, 100GB Storage, multi AZ
|
|
37
|
+
medium-ha:
|
|
38
|
+
volume_size: 100
|
|
39
|
+
multi_az: true
|
|
40
|
+
instance: db.t3.medium
|
|
41
|
+
|
|
42
|
+
# 2v CPU, 4GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
43
|
+
medium-high-io:
|
|
44
|
+
volume_size: 100
|
|
45
|
+
multi_az: true
|
|
46
|
+
instance: db.t3.medium
|
|
47
|
+
storage_type: io2
|
|
48
|
+
iops: 40000
|
|
49
|
+
|
|
50
|
+
# 2v CPU, 8GB RAM, 100GB Storage
|
|
51
|
+
large:
|
|
52
|
+
volume_size: 100
|
|
53
|
+
multi_az: false
|
|
54
|
+
instance: db.m5.large
|
|
55
|
+
|
|
56
|
+
# 2v CPU, 8GB RAM, 100GB Storage, multi AZ
|
|
57
|
+
large-ha:
|
|
58
|
+
volume_size: 100
|
|
59
|
+
multi_az: true
|
|
60
|
+
instance: db.m5.large
|
|
61
|
+
|
|
62
|
+
# 2v CPU, 8GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
63
|
+
large-high-io:
|
|
64
|
+
volume_size: 100
|
|
65
|
+
multi_az: true
|
|
66
|
+
instance: db.m5.large
|
|
67
|
+
storage_type: io2
|
|
68
|
+
iops: 40000
|
|
69
|
+
|
|
70
|
+
# 4v CPU, 16GB RAM, 100GB Storage
|
|
71
|
+
x-large:
|
|
72
|
+
volume_size: 100
|
|
73
|
+
multi_az: false
|
|
74
|
+
instance: db.m5.xlarge
|
|
75
|
+
|
|
76
|
+
# 4v CPU, 16GB RAM, 100GB Storage, multi AZ
|
|
77
|
+
x-large-ha:
|
|
78
|
+
volume_size: 100
|
|
79
|
+
multi_az: true
|
|
80
|
+
instance: db.m5.xlarge
|
|
81
|
+
|
|
82
|
+
# 4v CPU, 16GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
83
|
+
x-large-high-io:
|
|
84
|
+
volume_size: 100
|
|
85
|
+
multi_az: true
|
|
86
|
+
instance: db.m5.xlarge
|
|
87
|
+
storage_type: io2
|
|
88
|
+
iops: 40000
|
|
89
|
+
|
|
90
|
+
# 8v CPU, 32GB RAM, 100GB Storage
|
|
91
|
+
2x-large:
|
|
92
|
+
volume_size: 100
|
|
93
|
+
multi_az: false
|
|
94
|
+
instance: db.m5.2xlarge
|
|
95
|
+
|
|
96
|
+
# 8v CPU, 32GB RAM, 100GB Storage, multi AZ
|
|
97
|
+
2x-large-ha:
|
|
98
|
+
volume_size: 100
|
|
99
|
+
multi_az: true
|
|
100
|
+
instance: db.m5.2xlarge
|
|
101
|
+
|
|
102
|
+
# 8v CPU, 32GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
103
|
+
2x-large-high-io:
|
|
104
|
+
volume_size: 100
|
|
105
|
+
multi_az: true
|
|
106
|
+
instance: db.m5.2xlarge
|
|
107
|
+
storage_type: io2
|
|
108
|
+
iops: 40000
|
|
109
|
+
|
|
110
|
+
# 16v CPU, 64GB RAM, 100GB Storage
|
|
111
|
+
4x-large:
|
|
112
|
+
volume_size: 100
|
|
113
|
+
multi_az: false
|
|
114
|
+
instance: db.m5.4xlarge
|
|
115
|
+
|
|
116
|
+
# 16v CPU, 64GB RAM, 100GB Storage, multi AZ
|
|
117
|
+
4x-large-ha:
|
|
118
|
+
volume_size: 100
|
|
119
|
+
multi_az: true
|
|
120
|
+
instance: db.m5.4xlarge
|
|
121
|
+
|
|
122
|
+
# 16v CPU, 64GB RAM, 100GB Storage, multi AZ, high IOPS
|
|
123
|
+
4x-large-high-io:
|
|
124
|
+
volume_size: 100
|
|
125
|
+
multi_az: true
|
|
126
|
+
instance: db.m5.4xlarge
|
|
127
|
+
storage_type: io2
|
|
128
|
+
iops: 40000
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
# t-shirt sizes for addons that support configurable storage/cpu etc. such as RDS, Opensearch and Elasticache Redis
|
|
2
|
-
|
|
3
|
-
redis:
|
|
4
|
-
# 0.5GB RAM, single node, no failover.
|
|
5
|
-
micro:
|
|
6
|
-
replicas: 0
|
|
7
|
-
instance: cache.t4g.micro
|
|
8
|
-
|
|
9
|
-
# 0.5GB RAM, highly-available.
|
|
10
|
-
micro-ha:
|
|
11
|
-
replicas: 2
|
|
12
|
-
instance: cache.t4g.micro
|
|
13
|
-
|
|
14
|
-
# 1.37GB RAM, single node, no failover.
|
|
15
|
-
tiny:
|
|
16
|
-
replicas: 0
|
|
17
|
-
instance: cache.t4g.small
|
|
18
|
-
|
|
19
|
-
# 1.37GB RAM, highly-available
|
|
20
|
-
tiny-ha:
|
|
21
|
-
replicas: 2
|
|
22
|
-
instance: cache.t4g.small
|
|
23
|
-
|
|
24
|
-
# 3.09GB RAM, single node, no failover.
|
|
25
|
-
small:
|
|
26
|
-
replicas: 0
|
|
27
|
-
instance: cache.t4g.medium
|
|
28
|
-
|
|
29
|
-
# 3.09GB RAM, highly-available
|
|
30
|
-
small-ha:
|
|
31
|
-
replicas: 2
|
|
32
|
-
instance: cache.t4g.medium
|
|
33
|
-
|
|
34
|
-
# 6.38GB RAM, single node, no failover.
|
|
35
|
-
medium:
|
|
36
|
-
replicas: 0
|
|
37
|
-
instance: cache.m6g.large
|
|
38
|
-
|
|
39
|
-
# 6.38GB RAM, highly-available
|
|
40
|
-
medium-ha:
|
|
41
|
-
replicas: 2
|
|
42
|
-
instance: 'cache.m6g.large'
|
|
43
|
-
|
|
44
|
-
# 12.93GB RAM, single node, no failover.
|
|
45
|
-
large:
|
|
46
|
-
replicas: 0
|
|
47
|
-
instance: cache.m6g.xlarge
|
|
48
|
-
|
|
49
|
-
# 12.93GB RAM, highly-available
|
|
50
|
-
large-ha:
|
|
51
|
-
replicas: 2
|
|
52
|
-
instance: cache.m6g.xlarge
|
|
53
|
-
|
|
54
|
-
# 26.04GB RAM, single node, no failover.
|
|
55
|
-
x-large:
|
|
56
|
-
replicas: 0
|
|
57
|
-
instance: cache.m6g.2xlarge
|
|
58
|
-
|
|
59
|
-
# 26.04GB RAM, highly-available
|
|
60
|
-
x-large-ha:
|
|
61
|
-
replicas: 2
|
|
62
|
-
instance: cache.m6g.2xlarge
|
|
63
|
-
|
|
64
|
-
opensearch:
|
|
65
|
-
# 2 vCPU, 2GB RAM, volume size range 10-100GB
|
|
66
|
-
tiny:
|
|
67
|
-
volume_size: 80
|
|
68
|
-
instances: 1
|
|
69
|
-
master: false
|
|
70
|
-
instance: t3.small.search
|
|
71
|
-
|
|
72
|
-
# 2 vCPU, 4GB RAM, volume size range 10-200GB
|
|
73
|
-
small:
|
|
74
|
-
volume_size: 200
|
|
75
|
-
instances: 1
|
|
76
|
-
master: false
|
|
77
|
-
instance: t3.medium.search
|
|
78
|
-
|
|
79
|
-
# 2 nodes with 2 vCPU, 4GB RAM, volume size range 10-200GB
|
|
80
|
-
small-ha:
|
|
81
|
-
volume_size: 200
|
|
82
|
-
instances: 2
|
|
83
|
-
master: false
|
|
84
|
-
instance: t3.medium.search
|
|
85
|
-
|
|
86
|
-
# 2 vCPU, 8GB RAM, volume size range 10-512GB
|
|
87
|
-
medium:
|
|
88
|
-
volume_size: 512
|
|
89
|
-
instances: 1
|
|
90
|
-
master: false
|
|
91
|
-
instance: m6g.large.search
|
|
92
|
-
|
|
93
|
-
# 2 nodes with 2 vCPU, 8GB RAM, volume size range 10-512GB
|
|
94
|
-
medium-ha:
|
|
95
|
-
volume_size: 512
|
|
96
|
-
instances: 2
|
|
97
|
-
master: false
|
|
98
|
-
instance: m6g.large.search
|
|
99
|
-
|
|
100
|
-
# 4 vCPU, 16GB RAM, volume size range 10-1000GB
|
|
101
|
-
large:
|
|
102
|
-
volume_size: 1000
|
|
103
|
-
instances: 1
|
|
104
|
-
master: false
|
|
105
|
-
instance: m6g.xlarge.search
|
|
106
|
-
|
|
107
|
-
# 2 nodes with 4 vCPU, 16GB RAM, volume size range 10-1000GB
|
|
108
|
-
large-ha:
|
|
109
|
-
volume_size: 1000
|
|
110
|
-
instances: 2
|
|
111
|
-
master: false
|
|
112
|
-
instance: m6g.xlarge.search
|
|
113
|
-
|
|
114
|
-
# 8 vCPU, 32GB RAM, volume size range 10-1500GB
|
|
115
|
-
x-large:
|
|
116
|
-
volume_size: 1500
|
|
117
|
-
instances: 1
|
|
118
|
-
master: false
|
|
119
|
-
instance: m6g.2xlarge.search
|
|
120
|
-
|
|
121
|
-
# 2 nodes with 8 vCPU, 32GB RAM, volume size range 10-1500GB
|
|
122
|
-
x-large-ha:
|
|
123
|
-
volume_size: 1500
|
|
124
|
-
instances: 2
|
|
125
|
-
master: false
|
|
126
|
-
instance: m6g.2xlarge.search
|
|
127
|
-
|
|
128
|
-
# RDS/Postgres Instances
|
|
129
|
-
postgres:
|
|
130
|
-
# 2v CPU, 1GB RAM, 20GB Storage
|
|
131
|
-
tiny:
|
|
132
|
-
volume_size: 20
|
|
133
|
-
multi_az: false
|
|
134
|
-
instance: db.t3.micro
|
|
135
|
-
|
|
136
|
-
# 2v CPU, 2GB RAM, 100GB Storage
|
|
137
|
-
small:
|
|
138
|
-
volume_size: 100
|
|
139
|
-
multi_az: false
|
|
140
|
-
instance: db.t3.small
|
|
141
|
-
|
|
142
|
-
# 2v CPU, 2GB RAM, 100GB Storage, multi AZ
|
|
143
|
-
small-ha:
|
|
144
|
-
volume_size: 100
|
|
145
|
-
multi_az: true
|
|
146
|
-
instance: db.t3.small
|
|
147
|
-
|
|
148
|
-
# 2v CPU, 2GB RAM, 100GB Storage, multi AZ
|
|
149
|
-
small-high-io:
|
|
150
|
-
volume_size: 100
|
|
151
|
-
multi_az: true
|
|
152
|
-
instance: db.t3.small
|
|
153
|
-
storage_type: io1
|
|
154
|
-
iops: 40000
|
|
155
|
-
|
|
156
|
-
# 2v CPU, 8GB RAM, 100GB Storage
|
|
157
|
-
medium:
|
|
158
|
-
volume_size: 100
|
|
159
|
-
multi_az: false
|
|
160
|
-
instance: db.m5.large
|
|
161
|
-
|
|
162
|
-
# 2v CPU, 8GB RAM, 100GB Storage, multi AZ
|
|
163
|
-
medium-ha:
|
|
164
|
-
volume_size: 100
|
|
165
|
-
multi_az: true
|
|
166
|
-
instance: db.m5.large
|
|
167
|
-
|
|
168
|
-
# 2v CPU, 8GB RAM, 100GB Storage, multi AZ
|
|
169
|
-
medium-high-io:
|
|
170
|
-
volume_size: 100
|
|
171
|
-
multi_az: true
|
|
172
|
-
instance: db.m5.large
|
|
173
|
-
storage_type: io1
|
|
174
|
-
iops: 40000
|
|
175
|
-
|
|
176
|
-
# 8v CPU, 32GB RAM, 564GB Storage
|
|
177
|
-
large:
|
|
178
|
-
volume_size: 564
|
|
179
|
-
multi_az: false
|
|
180
|
-
instance: db.m5.2xlarge
|
|
181
|
-
|
|
182
|
-
# 8v CPU, 32GB RAM, 564GB Storage, multi AZ
|
|
183
|
-
large-ha:
|
|
184
|
-
volume_size: 564
|
|
185
|
-
multi_az: true
|
|
186
|
-
instance: db.m5.2xlarge
|
|
187
|
-
|
|
188
|
-
# 8v CPU, 32GB RAM, 564GB Storage, multi AZ
|
|
189
|
-
large-high-io:
|
|
190
|
-
volume_size: 564
|
|
191
|
-
multi_az: true
|
|
192
|
-
instance: db.m5.2xlarge
|
|
193
|
-
storage_type: io1
|
|
194
|
-
iops: 40000
|
|
195
|
-
|
|
196
|
-
# 16v CPU, 64GB RAM, 2000GB Storage
|
|
197
|
-
x-large:
|
|
198
|
-
volume_size: 2000
|
|
199
|
-
multi_az: false
|
|
200
|
-
instance: db.m5.4xlarge
|
|
201
|
-
|
|
202
|
-
# 16v CPU, 64GB RAM, 2000GB Storage, multi AZ
|
|
203
|
-
x-large-ha:
|
|
204
|
-
volume_size: 2000
|
|
205
|
-
multi_az: true
|
|
206
|
-
instance: db.m5.4xlarge
|
|
207
|
-
|
|
208
|
-
# 16v CPU, 64GB RAM, 2000GB Storage, multi AZ
|
|
209
|
-
x-large-high-io:
|
|
210
|
-
volume_size: 2000
|
|
211
|
-
multi_az: true
|
|
212
|
-
instance: db.m5.4xlarge
|
|
213
|
-
storage_type: io1
|
|
214
|
-
iops: 40000
|
|
215
|
-
|
|
216
|
-
s3: {}
|
|
217
|
-
|
|
218
|
-
s3-policy: {}
|
|
219
|
-
|
|
220
|
-
monitoring: {}
|
|
221
|
-
|
|
222
|
-
alb: {}
|
|
223
|
-
|
|
224
|
-
prometheus-policy: {}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from dbt_platform_helper.platform_exception import PlatformException
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class AWSException(PlatformException):
|
|
5
|
-
pass
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CreateTaskTimeoutException(AWSException):
|
|
9
|
-
def __init__(self, addon_name: str, application_name: str, environment: str):
|
|
10
|
-
super().__init__(
|
|
11
|
-
f"""Client ({addon_name}) ECS task has failed to start for "{application_name}" in "{environment}" environment."""
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ImageNotFoundException(AWSException):
|
|
16
|
-
def __init__(self, commit: str):
|
|
17
|
-
super().__init__(
|
|
18
|
-
f"""The commit hash "{commit}" has not been built into an image, try the `platform-helper codebase build` command first."""
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class RepositoryNotFoundException(AWSException):
|
|
23
|
-
def __init__(self, repository: str):
|
|
24
|
-
super().__init__(f"""The ECR repository "{repository}" could not be found.""")
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class LogGroupNotFoundException(AWSException):
|
|
28
|
-
def __init__(self, log_group_name: str):
|
|
29
|
-
super().__init__(f"""No log group called "{log_group_name}".""")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# Todo: This should probably be in the AWS Copilot provider, but was causing circular import when we tried it pre refactoring the utils/aws.py
|
|
33
|
-
class CopilotCodebaseNotFoundException(PlatformException):
|
|
34
|
-
def __init__(self, codebase: str):
|
|
35
|
-
super().__init__(
|
|
36
|
-
f"""The codebase "{codebase}" either does not exist or has not been deployed."""
|
|
37
|
-
)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
from dbt_platform_helper.providers.cache import CacheProvider
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class OpensearchProvider:
|
|
5
|
-
|
|
6
|
-
def __init__(self, opensearch_client):
|
|
7
|
-
self.opensearch_client = opensearch_client
|
|
8
|
-
|
|
9
|
-
def get_supported_opensearch_versions(self) -> list[str]:
|
|
10
|
-
|
|
11
|
-
cache_provider = self.__get_cache_provider()
|
|
12
|
-
|
|
13
|
-
if cache_provider.cache_refresh_required("opensearch"):
|
|
14
|
-
|
|
15
|
-
response = self.opensearch_client.list_versions()
|
|
16
|
-
all_versions = response["Versions"]
|
|
17
|
-
|
|
18
|
-
opensearch_versions = [
|
|
19
|
-
version for version in all_versions if not version.startswith("Elasticsearch_")
|
|
20
|
-
]
|
|
21
|
-
supported_versions = [
|
|
22
|
-
version.removeprefix("OpenSearch_") for version in opensearch_versions
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
cache_provider.update_cache("opensearch", supported_versions)
|
|
26
|
-
|
|
27
|
-
return supported_versions
|
|
28
|
-
|
|
29
|
-
else:
|
|
30
|
-
return cache_provider.read_supported_versions_from_cache("opensearch")
|
|
31
|
-
|
|
32
|
-
# TODO - cache provider instantiated here rather than via dependancy injection since it will likely only be used in the get_supported_opensearch_versions method.
|
|
33
|
-
# If another method is added which needs a CacheProvider, it should be injected into the constructor instead.
|
|
34
|
-
@staticmethod
|
|
35
|
-
def __get_cache_provider():
|
|
36
|
-
return CacheProvider()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
from dbt_platform_helper.providers.cache import CacheProvider
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class RedisProvider:
|
|
5
|
-
def __init__(self, elasticache_client):
|
|
6
|
-
self.elasticache_client = elasticache_client
|
|
7
|
-
|
|
8
|
-
def get_supported_redis_versions(self):
|
|
9
|
-
|
|
10
|
-
cache_provider = self.__get_cache_provider()
|
|
11
|
-
|
|
12
|
-
if cache_provider.cache_refresh_required("redis"):
|
|
13
|
-
|
|
14
|
-
supported_versions_response = self.elasticache_client.describe_cache_engine_versions(
|
|
15
|
-
Engine="redis"
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
supported_versions = [
|
|
19
|
-
version["EngineVersion"]
|
|
20
|
-
for version in supported_versions_response["CacheEngineVersions"]
|
|
21
|
-
]
|
|
22
|
-
|
|
23
|
-
cache_provider.update_cache("redis", supported_versions)
|
|
24
|
-
|
|
25
|
-
return supported_versions
|
|
26
|
-
|
|
27
|
-
else:
|
|
28
|
-
return cache_provider.read_supported_versions_from_cache("redis")
|
|
29
|
-
|
|
30
|
-
# TODO - cache provider instantiated here rather than via dependancy injection since it will likely only be used in the get_supported_redis_versions method.
|
|
31
|
-
# If another method is added which needs a CacheProvider, it should be injected into the constructor instead.
|
|
32
|
-
@staticmethod
|
|
33
|
-
def __get_cache_provider():
|
|
34
|
-
return CacheProvider()
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import re
|
|
2
|
-
from dataclasses import dataclass
|
|
3
|
-
from dataclasses import field
|
|
4
|
-
from typing import Dict
|
|
5
|
-
from typing import Optional
|
|
6
|
-
from typing import Union
|
|
7
|
-
|
|
8
|
-
from dbt_platform_helper.constants import PLATFORM_CONFIG_FILE
|
|
9
|
-
from dbt_platform_helper.constants import PLATFORM_HELPER_VERSION_FILE
|
|
10
|
-
from dbt_platform_helper.providers.validation import ValidationException
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class IncompatibleMajorVersionException(ValidationException):
|
|
14
|
-
def __init__(self, app_version: str, check_version: str):
|
|
15
|
-
super().__init__()
|
|
16
|
-
self.app_version = app_version
|
|
17
|
-
self.check_version = check_version
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class IncompatibleMinorVersionException(ValidationException):
|
|
21
|
-
def __init__(self, app_version: str, check_version: str):
|
|
22
|
-
super().__init__()
|
|
23
|
-
self.app_version = app_version
|
|
24
|
-
self.check_version = check_version
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class SemanticVersion:
|
|
28
|
-
def __init__(self, major, minor, patch):
|
|
29
|
-
self.major = major
|
|
30
|
-
self.minor = minor
|
|
31
|
-
self.patch = patch
|
|
32
|
-
|
|
33
|
-
def __str__(self) -> str:
|
|
34
|
-
if self.major is None:
|
|
35
|
-
return "unknown"
|
|
36
|
-
return ".".join([str(s) for s in [self.major, self.minor, self.patch]])
|
|
37
|
-
|
|
38
|
-
def __lt__(self, other) -> bool:
|
|
39
|
-
return (self.major, self.minor, self.patch) < (other.major, other.minor, other.patch)
|
|
40
|
-
|
|
41
|
-
def __eq__(self, other) -> bool:
|
|
42
|
-
return (self.major, self.minor, self.patch) == (other.major, other.minor, other.patch)
|
|
43
|
-
|
|
44
|
-
def validate_compatibility_with(self, other):
|
|
45
|
-
if (self.major == 0 and other.major == 0) and (
|
|
46
|
-
self.minor != other.minor or self.patch != other.patch
|
|
47
|
-
):
|
|
48
|
-
raise IncompatibleMajorVersionException(str(self), str(other))
|
|
49
|
-
|
|
50
|
-
if self.major != other.major:
|
|
51
|
-
raise IncompatibleMajorVersionException(str(self), str(other))
|
|
52
|
-
|
|
53
|
-
if self.minor != other.minor:
|
|
54
|
-
raise IncompatibleMinorVersionException(str(self), str(other))
|
|
55
|
-
|
|
56
|
-
@staticmethod
|
|
57
|
-
def from_string(version_string: Union[str, None]):
|
|
58
|
-
if version_string is None:
|
|
59
|
-
return None
|
|
60
|
-
|
|
61
|
-
version_plain = version_string.replace("v", "")
|
|
62
|
-
version_segments = re.split(r"[.\-]", version_plain)
|
|
63
|
-
|
|
64
|
-
if len(version_segments) != 3:
|
|
65
|
-
return None
|
|
66
|
-
|
|
67
|
-
output_version = [0, 0, 0]
|
|
68
|
-
for index, segment in enumerate(version_segments):
|
|
69
|
-
try:
|
|
70
|
-
output_version[index] = int(segment)
|
|
71
|
-
except ValueError:
|
|
72
|
-
output_version[index] = -1
|
|
73
|
-
|
|
74
|
-
return SemanticVersion(output_version[0], output_version[1], output_version[2])
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class VersionStatus:
|
|
78
|
-
def __init__(
|
|
79
|
-
self, local_version: SemanticVersion = None, latest_release: SemanticVersion = None
|
|
80
|
-
):
|
|
81
|
-
self.local = local_version
|
|
82
|
-
self.latest = latest_release
|
|
83
|
-
|
|
84
|
-
def is_outdated(self):
|
|
85
|
-
return self.local != self.latest
|
|
86
|
-
|
|
87
|
-
def warn(self):
|
|
88
|
-
pass
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@dataclass
|
|
92
|
-
class PlatformHelperVersionStatus(VersionStatus):
|
|
93
|
-
local: Optional[SemanticVersion] = None
|
|
94
|
-
latest: Optional[SemanticVersion] = None
|
|
95
|
-
deprecated_version_file: Optional[SemanticVersion] = None
|
|
96
|
-
platform_config_default: Optional[SemanticVersion] = None
|
|
97
|
-
pipeline_overrides: Optional[Dict[str, str]] = field(default_factory=dict)
|
|
98
|
-
|
|
99
|
-
def warn(self) -> dict:
|
|
100
|
-
if self.platform_config_default and not self.deprecated_version_file:
|
|
101
|
-
return {}
|
|
102
|
-
|
|
103
|
-
warnings = []
|
|
104
|
-
errors = []
|
|
105
|
-
|
|
106
|
-
missing_default_version_message = f"Create a section in the root of '{PLATFORM_CONFIG_FILE}':\n\ndefault_versions:\n platform-helper: "
|
|
107
|
-
deprecation_message = (
|
|
108
|
-
f"Please delete '{PLATFORM_HELPER_VERSION_FILE}' as it is now deprecated."
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
if self.platform_config_default and self.deprecated_version_file:
|
|
112
|
-
warnings.append(deprecation_message)
|
|
113
|
-
|
|
114
|
-
if not self.platform_config_default and self.deprecated_version_file:
|
|
115
|
-
warnings.append(deprecation_message)
|
|
116
|
-
warnings.append(f"{missing_default_version_message}{self.deprecated_version_file}\n")
|
|
117
|
-
|
|
118
|
-
if not self.platform_config_default and not self.deprecated_version_file:
|
|
119
|
-
message = f"Cannot get dbt-platform-helper version from '{PLATFORM_CONFIG_FILE}'.\n"
|
|
120
|
-
message += f"{missing_default_version_message}{self.local}\n"
|
|
121
|
-
errors.append(message)
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
"warnings": warnings,
|
|
125
|
-
"errors": errors,
|
|
126
|
-
}
|
|
@@ -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 %}
|