dbt-platform-helper 11.4.0__py3-none-any.whl → 12.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dbt-platform-helper might be problematic. Click here for more details.

Files changed (32) hide show
  1. dbt_platform_helper/COMMANDS.md +3 -252
  2. dbt_platform_helper/addons-template-map.yml +7 -33
  3. dbt_platform_helper/commands/application.py +8 -7
  4. dbt_platform_helper/commands/conduit.py +1 -4
  5. dbt_platform_helper/commands/copilot.py +14 -110
  6. dbt_platform_helper/commands/environment.py +0 -5
  7. dbt_platform_helper/commands/pipeline.py +1 -13
  8. dbt_platform_helper/domain/database_copy.py +2 -2
  9. dbt_platform_helper/domain/maintenance_page.py +9 -4
  10. dbt_platform_helper/templates/addon-instructions.txt +1 -1
  11. dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -8
  12. dbt_platform_helper/utils/platform_config.py +2 -7
  13. dbt_platform_helper/utils/validation.py +3 -78
  14. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/METADATA +1 -1
  15. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/RECORD +19 -32
  16. platform_helper.py +0 -8
  17. dbt_platform_helper/commands/check_cloudformation.py +0 -87
  18. dbt_platform_helper/commands/dns.py +0 -952
  19. dbt_platform_helper/custom_resources/__init__.py +0 -0
  20. dbt_platform_helper/custom_resources/s3_object.py +0 -85
  21. dbt_platform_helper/templates/addons/env/addons.parameters.yml +0 -19
  22. dbt_platform_helper/templates/addons/env/aurora-postgres.yml +0 -604
  23. dbt_platform_helper/templates/addons/env/monitoring.yml +0 -121
  24. dbt_platform_helper/templates/addons/env/opensearch.yml +0 -257
  25. dbt_platform_helper/templates/addons/env/rds-postgres.yml +0 -603
  26. dbt_platform_helper/templates/addons/env/redis-cluster.yml +0 -171
  27. dbt_platform_helper/templates/addons/env/s3.yml +0 -219
  28. dbt_platform_helper/templates/addons/env/vpc.yml +0 -120
  29. dbt_platform_helper/utils/cloudformation.py +0 -34
  30. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/LICENSE +0 -0
  31. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/WHEEL +0 -0
  32. {dbt_platform_helper-11.4.0.dist-info → dbt_platform_helper-12.0.1.dist-info}/entry_points.txt +0 -0
@@ -4,13 +4,6 @@
4
4
  - [platform-helper application](#platform-helper-application)
5
5
  - [platform-helper application container-stats](#platform-helper-application-container-stats)
6
6
  - [platform-helper application task-stats](#platform-helper-application-task-stats)
7
- - [platform-helper cdn](#platform-helper-cdn)
8
- - [platform-helper cdn assign](#platform-helper-cdn-assign)
9
- - [platform-helper cdn delete](#platform-helper-cdn-delete)
10
- - [platform-helper cdn list](#platform-helper-cdn-list)
11
- - [platform-helper check-cloudformation](#platform-helper-check-cloudformation)
12
- - [platform-helper check-cloudformation lint](#platform-helper-check-cloudformation-lint)
13
- - [platform-helper check-cloudformation check-security](#platform-helper-check-cloudformation-check-security)
14
7
  - [platform-helper codebase](#platform-helper-codebase)
15
8
  - [platform-helper codebase prepare](#platform-helper-codebase-prepare)
16
9
  - [platform-helper codebase list](#platform-helper-codebase-list)
@@ -22,9 +15,6 @@
22
15
  - [platform-helper config aws](#platform-helper-config-aws)
23
16
  - [platform-helper copilot](#platform-helper-copilot)
24
17
  - [platform-helper copilot make-addons](#platform-helper-copilot-make-addons)
25
- - [platform-helper domain](#platform-helper-domain)
26
- - [platform-helper domain configure](#platform-helper-domain-configure)
27
- - [platform-helper domain assign](#platform-helper-domain-assign)
28
18
  - [platform-helper environment](#platform-helper-environment)
29
19
  - [platform-helper environment offline](#platform-helper-environment-offline)
30
20
  - [platform-helper environment online](#platform-helper-environment-online)
@@ -64,14 +54,11 @@ platform-helper <command> [--version]
64
54
  ## Commands
65
55
 
66
56
  - [`application` ↪](#platform-helper-application)
67
- - [`cdn` ↪](#platform-helper-cdn)
68
- - [`check-cloudformation` ↪](#platform-helper-check-cloudformation)
69
57
  - [`codebase` ↪](#platform-helper-codebase)
70
58
  - [`conduit` ↪](#platform-helper-conduit)
71
59
  - [`config` ↪](#platform-helper-config)
72
60
  - [`copilot` ↪](#platform-helper-copilot)
73
61
  - [`database` ↪](#platform-helper-database)
74
- - [`domain` ↪](#platform-helper-domain)
75
62
  - [`environment` ↪](#platform-helper-environment)
76
63
  - [`generate` ↪](#platform-helper-generate)
77
64
  - [`notify` ↪](#platform-helper-notify)
@@ -83,7 +70,7 @@ platform-helper <command> [--version]
83
70
 
84
71
  [↩ Parent](#platform-helper)
85
72
 
86
- Application metrics.
73
+ [DEPRECATED] Application metrics.
87
74
 
88
75
  ## Usage
89
76
 
@@ -105,7 +92,7 @@ platform-helper application (container-stats|task-stats)
105
92
 
106
93
  [↩ Parent](#platform-helper-application)
107
94
 
108
- Command to get application container level metrics.
95
+ [DEPRECATED] Command to get application container level metrics.
109
96
 
110
97
  ## Usage
111
98
 
@@ -131,7 +118,7 @@ platform-helper application container-stats --env <environment> --app <applicati
131
118
 
132
119
  [↩ Parent](#platform-helper-application)
133
120
 
134
- Command to get application task level metrics.
121
+ [DEPRECATED] Command to get application task level metrics.
135
122
 
136
123
  ## Usage
137
124
 
@@ -152,171 +139,6 @@ platform-helper application task-stats --env <environment> --app <application> [
152
139
 
153
140
  - `--network <boolean>` _Defaults to False._
154
141
 
155
- - `--help <boolean>` _Defaults to False._
156
- - Show this message and exit.
157
-
158
- # platform-helper cdn
159
-
160
- [↩ Parent](#platform-helper)
161
-
162
- ## Usage
163
-
164
- ```
165
- platform-helper cdn (assign|delete|list)
166
- ```
167
-
168
- ## Options
169
-
170
- - `--help <boolean>` _Defaults to False._
171
- - Show this message and exit.
172
-
173
- ## Commands
174
-
175
- - [`assign` ↪](#platform-helper-cdn-assign)
176
- - [`delete` ↪](#platform-helper-cdn-delete)
177
- - [`list` ↪](#platform-helper-cdn-list)
178
-
179
- # platform-helper cdn assign
180
-
181
- [↩ Parent](#platform-helper-cdn)
182
-
183
- Assigns a CDN domain name to application loadbalancer.
184
-
185
- ## Usage
186
-
187
- ```
188
- platform-helper cdn assign --project-profile <project_profile> --env <environment>
189
- --app <application> --svc <service>
190
- ```
191
-
192
- ## Options
193
-
194
- - `--project-profile <text>`
195
- - AWS account profile name for certificates account
196
- - `--env <text>`
197
- - AWS Copilot environment name
198
- - `--app <text>`
199
- - Application Name
200
- - `--svc <text>`
201
- - Service Name
202
- - `--help <boolean>` _Defaults to False._
203
- - Show this message and exit.
204
-
205
- # platform-helper cdn delete
206
-
207
- [↩ Parent](#platform-helper-cdn)
208
-
209
- Assigns a CDN domain name to application loadbalancer.
210
-
211
- ## Usage
212
-
213
- ```
214
- platform-helper cdn delete --project-profile <project_profile> --env <environment>
215
- --app <application> --svc <service>
216
- ```
217
-
218
- ## Options
219
-
220
- - `--project-profile <text>`
221
- - AWS account profile name for certificates account
222
- - `--env <text>`
223
- - AWS Copilot environment name
224
- - `--app <text>`
225
- - Application Name
226
- - `--svc <text>`
227
- - Service Name
228
- - `--help <boolean>` _Defaults to False._
229
- - Show this message and exit.
230
-
231
- # platform-helper cdn list
232
-
233
- [↩ Parent](#platform-helper-cdn)
234
-
235
- List CDN domain name attached to application loadbalancer.
236
-
237
- ## Usage
238
-
239
- ```
240
- platform-helper cdn list --project-profile <project_profile> --env <environment>
241
- --app <application> --svc <service>
242
- ```
243
-
244
- ## Options
245
-
246
- - `--project-profile <text>`
247
- - AWS account profile name for certificates account
248
- - `--env <text>`
249
- - AWS Copilot environment name
250
- - `--app <text>`
251
- - Application Name
252
- - `--svc <text>`
253
- - Service Name
254
- - `--help <boolean>` _Defaults to False._
255
- - Show this message and exit.
256
-
257
- # platform-helper check-cloudformation
258
-
259
- [↩ Parent](#platform-helper)
260
-
261
- Runs the checks passed in the command arguments.
262
-
263
- If no argument is passed, it will run all the checks.
264
-
265
- ## Usage
266
-
267
- ```
268
- platform-helper check-cloudformation (lint|check-security)
269
- [-d <directory>]
270
- ```
271
-
272
- ## Options
273
-
274
- - `-d
275
- --directory <text>` _Defaults to copilot._
276
-
277
- - `--help <boolean>` _Defaults to False._
278
- - Show this message and exit.
279
-
280
- ## Commands
281
-
282
- - [`check-security` ↪](#platform-helper-check-cloudformation-check-security)
283
- - [`lint` ↪](#platform-helper-check-cloudformation-lint)
284
-
285
- # platform-helper check-cloudformation lint
286
-
287
- [↩ Parent](#platform-helper-check-cloudformation)
288
-
289
- Runs cfn-lint against the generated CloudFormation templates.
290
-
291
- ## Usage
292
-
293
- ```
294
- platform-helper check-cloudformation lint [-d <directory>]
295
- ```
296
-
297
- ## Options
298
-
299
- - `-d
300
- --directory <text>` _Defaults to copilot._
301
-
302
- - `--help <boolean>` _Defaults to False._
303
- - Show this message and exit.
304
-
305
- # platform-helper check-cloudformation check-security
306
-
307
- [↩ Parent](#platform-helper-check-cloudformation)
308
-
309
- ## Usage
310
-
311
- ```
312
- platform-helper check-cloudformation check-security [-d <directory>]
313
- ```
314
-
315
- ## Options
316
-
317
- - `-d
318
- --directory <text>` _Defaults to copilot._
319
-
320
142
  - `--help <boolean>` _Defaults to False._
321
143
  - Show this message and exit.
322
144
 
@@ -558,77 +380,6 @@ platform-helper copilot make-addons
558
380
  - `--help <boolean>` _Defaults to False._
559
381
  - Show this message and exit.
560
382
 
561
- # platform-helper domain
562
-
563
- [↩ Parent](#platform-helper)
564
-
565
- ## Usage
566
-
567
- ```
568
- platform-helper domain (configure|assign)
569
- ```
570
-
571
- ## Options
572
-
573
- - `--help <boolean>` _Defaults to False._
574
- - Show this message and exit.
575
-
576
- ## Commands
577
-
578
- - [`assign` ↪](#platform-helper-domain-assign)
579
- - [`configure` ↪](#platform-helper-domain-configure)
580
-
581
- # platform-helper domain configure
582
-
583
- [↩ Parent](#platform-helper-domain)
584
-
585
- Creates subdomains if they do not exist and then creates certificates for
586
- them.
587
-
588
- ## Usage
589
-
590
- ```
591
- platform-helper domain configure --project-profile <project_profile>
592
- --env <environment>
593
- ```
594
-
595
- ## Options
596
-
597
- - `--project-profile <text>`
598
- - AWS account profile name for certificates account
599
- - `--env <text>`
600
- - AWS Copilot environment name
601
- - `--help <boolean>` _Defaults to False._
602
- - Show this message and exit.
603
-
604
- # platform-helper domain assign
605
-
606
- [↩ Parent](#platform-helper-domain)
607
-
608
- Assigns the load balancer for a service to its domain name.
609
-
610
- ## Usage
611
-
612
- ```
613
- platform-helper domain assign --app <application> --env <environment> --svc <service>
614
- --domain-profile (dev|live) --project-profile <project_profile>
615
- ```
616
-
617
- ## Options
618
-
619
- - `--app <text>`
620
- - Application Name
621
- - `--env <text>`
622
- - Environment
623
- - `--svc <text>`
624
- - Service Name
625
- - `--domain-profile <choice>`
626
- - AWS account profile name for Route53 domains account
627
- - `--project-profile <text>`
628
- - AWS account profile name for application account
629
- - `--help <boolean>` _Defaults to False._
630
- - Show this message and exit.
631
-
632
383
  # platform-helper environment
633
384
 
634
385
  [↩ Parent](#platform-helper)
@@ -1,33 +1,15 @@
1
- # This file maps addon types to env and svc level templates
1
+ # This file maps addon types to svc level templates
2
2
 
3
3
  # explanation:
4
4
 
5
5
  # {addons-type}:
6
- # requires_addons_parameters: true|false - optional, boolean, defaults to false, if true addons.parameters.yml will be created
7
- # env:
8
- # - template: path/to/template.yml
9
- # filename: some-fixed-name.yml - optional, the file name will be the name of the addon item by default
10
6
  # svc:
11
7
  # - template: path/to/template.yml
12
8
 
13
- redis:
14
- requires_addons_parameters: true
15
- env:
16
- - template: addons/env/redis-cluster.yml
17
- aurora-postgres:
18
- env:
19
- - template: addons/env/aurora-postgres.yml
20
- postgres:
21
- requires_addons_parameters: true
22
- env:
23
- - template: addons/env/rds-postgres.yml
24
- opensearch:
25
- requires_addons_parameters: true
26
- env:
27
- - template: addons/env/opensearch.yml
9
+ redis: {}
10
+ postgres: {}
11
+ opensearch: {}
28
12
  s3:
29
- env:
30
- - template: addons/env/s3.yml
31
13
  svc:
32
14
  - template: addons/svc/s3-policy.yml
33
15
  s3-policy:
@@ -39,17 +21,9 @@ appconfig-ipfilter:
39
21
  subscription-filter:
40
22
  svc:
41
23
  - template: addons/svc/subscription-filter.yml
42
- monitoring:
43
- requires_addons_parameters: true
44
- env:
45
- - template: addons/env/monitoring.yml
46
- vpc:
47
- requires_addons_parameters: true
48
- env:
49
- - template: addons/env/vpc.yml
50
- alb:
51
- requires_addons_parameters: false
24
+ monitoring: {}
25
+ vpc: {}
26
+ alb: {}
52
27
  prometheus-policy:
53
- requires_addons_parameters: false
54
28
  svc:
55
29
  - template: addons/svc/prometheus-policy.yml
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
 
3
+ # application commands are deprecated, do not spend time refactoring them
4
+
3
5
  import time
4
6
  from datetime import datetime
5
7
  from datetime import timedelta
@@ -45,7 +47,6 @@ def get_query_results(env, app, query_string, timeout):
45
47
 
46
48
  # Container stats are 5 mins behind realtime.
47
49
  date_time = datetime.now()
48
- end_time = int(date_time.timestamp())
49
50
  start_time = int((date_time - timedelta(minutes=5)).timestamp())
50
51
  end_time = int((date_time - timedelta(minutes=4)).timestamp())
51
52
 
@@ -92,19 +93,19 @@ def get_query_results(env, app, query_string, timeout):
92
93
  return cpu_response
93
94
 
94
95
 
95
- @click.group(chain=True, cls=ClickDocOptGroup)
96
+ @click.group(chain=True, cls=ClickDocOptGroup, deprecated=True)
96
97
  def application():
97
- """Application metrics."""
98
+ """[DEPRECATED] Application metrics."""
98
99
  check_platform_helper_version_needs_update()
99
100
 
100
101
 
101
- @application.command()
102
+ @application.command(deprecated=True)
102
103
  @click.option("--env", type=str, required=True)
103
104
  @click.option("--app", type=str, required=True)
104
105
  @click.option("--storage", is_flag=True)
105
106
  @click.option("--network", is_flag=True)
106
107
  def container_stats(env, app, storage, network):
107
- """Command to get application container level metrics."""
108
+ """[DEPRECATED] Command to get application container level metrics."""
108
109
 
109
110
  # Query string to get the required container stats
110
111
  query_string = "stats max(CpuUtilized), max(MemoryUtilized) by TaskId, ContainerName, TaskDefinitionFamily, TaskDefinitionRevision, Image, StorageReadBytes, StorageWriteBytes, NetworkRxPackets, NetworkTxBytes | filter Type='Container' | sort TaskId, ContainerName desc"
@@ -218,14 +219,14 @@ def container_stats(env, app, storage, network):
218
219
  index = index + 1
219
220
 
220
221
 
221
- @application.command()
222
+ @application.command(deprecated=True)
222
223
  @click.option("--env", type=str, required=True)
223
224
  @click.option("--app", type=str, required=True)
224
225
  @click.option("--disk", is_flag=True)
225
226
  @click.option("--storage", is_flag=True)
226
227
  @click.option("--network", is_flag=True)
227
228
  def task_stats(env, app, disk, storage, network):
228
- """Command to get application task level metrics."""
229
+ """[DEPRECATED] Command to get application task level metrics."""
229
230
 
230
231
  # Query string to get the required container stats
231
232
  query_string = "stats max(CpuUtilized), max(MemoryUtilized), max(EphemeralStorageUtilized) by TaskId, TaskDefinitionFamily, TaskDefinitionRevision, StorageReadBytes, StorageWriteBytes, NetworkRxPackets, NetworkTxBytes, KnownStatus | filter Type='Task' | sort TaskId desc"
@@ -16,7 +16,6 @@ from dbt_platform_helper.utils.aws import (
16
16
  )
17
17
  from dbt_platform_helper.utils.click import ClickDocOptCommand
18
18
  from dbt_platform_helper.utils.messages import abort_with_error
19
- from dbt_platform_helper.utils.platform_config import is_terraform_project
20
19
  from dbt_platform_helper.utils.versioning import (
21
20
  check_platform_helper_version_needs_update,
22
21
  )
@@ -54,8 +53,6 @@ class AddonNotFoundConduitError(ConduitError):
54
53
  CONDUIT_DOCKER_IMAGE_LOCATION = "public.ecr.aws/uktrade/tunnel"
55
54
  CONDUIT_ADDON_TYPES = [
56
55
  "opensearch",
57
- "rds-postgres",
58
- "aurora-postgres",
59
56
  "postgres",
60
57
  "redis",
61
58
  ]
@@ -205,7 +202,7 @@ def create_addon_client_task(
205
202
  secret_name += "_READ_ONLY_USER"
206
203
  elif access == "write":
207
204
  secret_name += "_APPLICATION_USER"
208
- elif access == "admin" and is_terraform_project():
205
+ elif access == "admin":
209
206
  create_postgres_admin_task(app, env, secret_name, task_name, addon_type, addon_name)
210
207
  return
211
208
  elif addon_type == "redis" or addon_type == "opensearch":
@@ -2,8 +2,6 @@
2
2
 
3
3
  import copy
4
4
  import json
5
- from os import listdir
6
- from os.path import isfile
7
5
  from pathlib import Path
8
6
  from pathlib import PosixPath
9
7
 
@@ -17,7 +15,6 @@ from dbt_platform_helper.utils.aws import get_aws_session_or_abort
17
15
  from dbt_platform_helper.utils.click import ClickDocOptGroup
18
16
  from dbt_platform_helper.utils.files import generate_override_files
19
17
  from dbt_platform_helper.utils.files import mkfile
20
- from dbt_platform_helper.utils.platform_config import is_terraform_project
21
18
  from dbt_platform_helper.utils.template import camel_case
22
19
  from dbt_platform_helper.utils.template import setup_templates
23
20
  from dbt_platform_helper.utils.validation import config_file_check
@@ -244,7 +241,6 @@ def make_addons():
244
241
  """Generate addons CloudFormation for each environment."""
245
242
  output_dir = Path(".").absolute()
246
243
  config_file_check()
247
- is_terraform = is_terraform_project()
248
244
 
249
245
  templates = setup_templates()
250
246
  config = _get_config()
@@ -255,20 +251,14 @@ def make_addons():
255
251
  with open(PACKAGE_DIR / "addons-template-map.yml") as fd:
256
252
  addon_template_map = yaml.safe_load(fd)
257
253
 
258
- if is_terraform:
259
- click.echo("\n>>> Generating Terraform compatible addons CloudFormation\n")
260
- else:
261
- click.echo("\n>>> Generating addons CloudFormation\n")
254
+ click.echo("\n>>> Generating Terraform compatible addons CloudFormation\n")
262
255
 
263
256
  env_path = Path(f"copilot/environments/")
264
257
  env_addons_path = env_path / "addons"
265
258
  env_overrides_path = env_path / "overrides"
266
259
 
267
- (output_dir / env_addons_path).mkdir(parents=True, exist_ok=True)
268
-
269
260
  _cleanup_old_files(config, output_dir, env_addons_path, env_overrides_path)
270
- _generate_env_overrides(output_dir, is_terraform)
271
- custom_resources = _get_custom_resources()
261
+ _generate_env_overrides(output_dir)
272
262
 
273
263
  svc_names = list_copilot_local_services()
274
264
  base_path = Path(".")
@@ -276,26 +266,17 @@ def make_addons():
276
266
  _generate_svc_overrides(base_path, templates, svc_name)
277
267
 
278
268
  services = []
279
- has_addons_parameters = False
280
- has_postgres_addon = False
281
269
  for addon_name, addon_config in config.items():
282
270
  print(f">>>>>>>>> {addon_name}")
283
271
  addon_type = addon_config.pop("type")
284
272
  environments = addon_config.pop("environments")
285
273
  if addon_template_map[addon_type].get("requires_addons_parameters", False):
286
- has_addons_parameters = True
287
- if addon_type in ["aurora-postgres", "postgres"]:
288
- has_postgres_addon = True
289
-
290
- for environment_name, environment_config in environments.items():
291
- if not environment_config.get("deletion_policy"):
292
- environments[environment_name]["deletion_policy"] = addon_config.get(
293
- "deletion_policy", "Delete"
294
- )
274
+ pass
275
+ if addon_type in ["postgres"]:
276
+ pass
295
277
 
296
278
  environment_addon_config = {
297
279
  "addon_type": addon_type,
298
- "custom_resources": custom_resources,
299
280
  "environments": environments,
300
281
  "name": addon_config.get("name", None) or addon_name,
301
282
  "prefix": camel_case(addon_name),
@@ -318,28 +299,13 @@ def make_addons():
318
299
  if addon_type in ["s3", "s3-policy"]:
319
300
  if config[addon_name].get("serve_static_content"):
320
301
  continue
321
- if is_terraform:
322
- s3_kms_arns = _get_s3_kms_alias_arns(session, application_name, environments)
323
- for environment_name in environments:
324
- environments[environment_name]["kms_key_arn"] = s3_kms_arns.get(
325
- environment_name, "kms-key-not-found"
326
- )
327
- else:
328
- service_addon_config["kms_key_reference"] = service_addon_config["prefix"].rsplit(
329
- "BucketAccess", 1
330
- )[0]
331
-
332
- if not is_terraform:
333
- _generate_env_addons(
334
- addon_name,
335
- addon_template_map,
336
- config.items(),
337
- env_addons_path,
338
- environment_addon_config,
339
- output_dir,
340
- templates,
341
- log_destination_arns,
342
- )
302
+
303
+ s3_kms_arns = _get_s3_kms_alias_arns(session, application_name, environments)
304
+ for environment_name in environments:
305
+ environments[environment_name]["kms_key_arn"] = s3_kms_arns.get(
306
+ environment_name, "kms-key-not-found"
307
+ )
308
+
343
309
  _generate_service_addons(
344
310
  addon_config,
345
311
  addon_name,
@@ -349,20 +315,6 @@ def make_addons():
349
315
  service_addon_config,
350
316
  templates,
351
317
  log_destination_arns,
352
- is_terraform=is_terraform,
353
- )
354
-
355
- if addon_type in ["aurora-postgres", "postgres"] and not is_terraform:
356
- click.secho(
357
- "\nNote: The key DATABASE_CREDENTIALS may need to be changed to match your Django settings configuration.",
358
- fg="yellow",
359
- )
360
-
361
- if has_addons_parameters and not is_terraform:
362
- template = templates.get_template("addons/env/addons.parameters.yml")
363
- contents = template.render({"has_postgres_addon": has_postgres_addon})
364
- click.echo(
365
- mkfile(output_dir, env_addons_path / "addons.parameters.yml", contents, overwrite=True)
366
318
  )
367
319
 
368
320
  click.echo(templates.get_template("addon-instructions.txt").render(services=services))
@@ -375,8 +327,8 @@ def _get_config():
375
327
  return config
376
328
 
377
329
 
378
- def _generate_env_overrides(output_dir, is_terraform):
379
- path = "templates/env/terraform-overrides" if is_terraform else "templates/env/overrides"
330
+ def _generate_env_overrides(output_dir):
331
+ path = "templates/env/terraform-overrides"
380
332
  click.echo("\n>>> Generating Environment overrides\n")
381
333
  overrides_path = output_dir.joinpath(f"copilot/environments/overrides")
382
334
  overrides_path.mkdir(parents=True, exist_ok=True)
@@ -384,33 +336,6 @@ def _generate_env_overrides(output_dir, is_terraform):
384
336
  generate_override_files(Path("."), template_overrides_path, overrides_path)
385
337
 
386
338
 
387
- def _generate_env_addons(
388
- addon_name,
389
- addon_template_map,
390
- addons,
391
- env_addons_path,
392
- environment_addon_config,
393
- output_dir,
394
- templates,
395
- log_destination_arns,
396
- ):
397
- # generate env addons
398
- addon_type = environment_addon_config["addon_type"]
399
- for addon in addon_template_map[addon_type].get("env", []):
400
- template = templates.get_template(addon["template"])
401
- contents = template.render(
402
- {
403
- "addon_config": environment_addon_config,
404
- "addons": addons,
405
- "log_destination": log_destination_arns,
406
- }
407
- )
408
-
409
- filename = addon.get("filename", f"{addon_name}.yml")
410
-
411
- click.echo(mkfile(output_dir, env_addons_path / filename, contents, overwrite=True))
412
-
413
-
414
339
  def _generate_service_addons(
415
340
  addon_config,
416
341
  addon_name,
@@ -420,7 +345,6 @@ def _generate_service_addons(
420
345
  service_addon_config,
421
346
  templates,
422
347
  log_destination_arns,
423
- is_terraform,
424
348
  ):
425
349
  # generate svc addons
426
350
  for addon in addon_template_map[addon_type].get("svc", []):
@@ -433,7 +357,6 @@ def _generate_service_addons(
433
357
  {
434
358
  "addon_config": service_addon_config,
435
359
  "log_destination": log_destination_arns,
436
- "is_terraform": is_terraform,
437
360
  }
438
361
  )
439
362
 
@@ -443,25 +366,6 @@ def _generate_service_addons(
443
366
  click.echo(mkfile(output_dir, service_path / filename, contents, overwrite=True))
444
367
 
445
368
 
446
- def _get_custom_resources():
447
- custom_resources = {}
448
- custom_resource_path = (Path(__file__).parent / "../custom_resources/").resolve()
449
- for file in listdir(custom_resource_path):
450
- file_path = custom_resource_path / file
451
- if isfile(file_path) and file_path.name.endswith(".py") and file_path.name != "__init__.py":
452
- custom_resource_contents = file_path.read_text()
453
-
454
- def file_with_formatting_options(padding=0):
455
- lines = [
456
- (" " * padding) + line if line.strip() else line.strip()
457
- for line in custom_resource_contents.splitlines(True)
458
- ]
459
- return "".join(lines)
460
-
461
- custom_resources[file_path.name.rstrip(".py")] = file_with_formatting_options
462
- return custom_resources
463
-
464
-
465
369
  def _cleanup_old_files(config, output_dir, env_addons_path, env_overrides_path):
466
370
  def _rmdir(path):
467
371
  if not path.exists():
@@ -10,7 +10,6 @@ from dbt_platform_helper.utils.aws import get_aws_session_or_abort
10
10
  from dbt_platform_helper.utils.click import ClickDocOptGroup
11
11
  from dbt_platform_helper.utils.files import apply_environment_defaults
12
12
  from dbt_platform_helper.utils.files import mkfile
13
- from dbt_platform_helper.utils.platform_config import is_terraform_project
14
13
  from dbt_platform_helper.utils.template import setup_templates
15
14
  from dbt_platform_helper.utils.validation import load_and_validate_platform_config
16
15
  from dbt_platform_helper.utils.versioning import (
@@ -135,10 +134,6 @@ def generate(name, vpc_name):
135
134
  help=f"Override the default version of terraform-platform-modules. (Default version is '{DEFAULT_TERRAFORM_PLATFORM_MODULES_VERSION}').",
136
135
  )
137
136
  def generate_terraform(name, terraform_platform_modules_version):
138
- if not is_terraform_project():
139
- click.secho("This is not a terraform project. Exiting.", fg="red")
140
- exit(1)
141
-
142
137
  conf = load_and_validate_platform_config()
143
138
 
144
139
  env_config = apply_environment_defaults(conf)["environments"][name]