dbt-platform-helper 15.5.0__tar.gz → 15.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-15.5.0 → dbt_platform_helper-15.6.0}/PKG-INFO +1 -1
  2. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/vpc.py +36 -5
  3. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/aws.py +11 -1
  4. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/pyproject.toml +1 -1
  5. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/LICENSE +0 -0
  6. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/COMMANDS.md +0 -0
  7. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/README.md +0 -0
  8. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/__init__.py +0 -0
  9. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/__init__.py +0 -0
  10. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/application.py +0 -0
  11. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/codebase.py +0 -0
  12. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/conduit.py +0 -0
  13. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/config.py +0 -0
  14. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/copilot.py +0 -0
  15. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/database.py +0 -0
  16. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/environment.py +0 -0
  17. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/generate.py +0 -0
  18. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/notify.py +0 -0
  19. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/pipeline.py +0 -0
  20. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/secrets.py +0 -0
  21. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/commands/version.py +0 -0
  22. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/constants.py +0 -0
  23. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/default-extensions.yml +0 -0
  24. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/__init__.py +0 -0
  25. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/codebase.py +0 -0
  26. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/conduit.py +0 -0
  27. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/config.py +0 -0
  28. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/copilot.py +0 -0
  29. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/copilot_environment.py +0 -0
  30. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/database_copy.py +0 -0
  31. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/maintenance_page.py +0 -0
  32. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/notify.py +0 -0
  33. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/pipelines.py +0 -0
  34. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/plans.py +0 -0
  35. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/terraform_environment.py +0 -0
  36. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/domain/versioning.py +0 -0
  37. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/entities/platform_config_schema.py +0 -0
  38. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/entities/semantic_version.py +0 -0
  39. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/jinja2_tags.py +0 -0
  40. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/platform_exception.py +0 -0
  41. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/__init__.py +0 -0
  42. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/__init__.py +0 -0
  43. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/exceptions.py +0 -0
  44. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/interfaces.py +0 -0
  45. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/opensearch.py +0 -0
  46. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/redis.py +0 -0
  47. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/aws/sso_auth.py +0 -0
  48. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/cache.py +0 -0
  49. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/cloudformation.py +0 -0
  50. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/config.py +0 -0
  51. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/config_validator.py +0 -0
  52. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/copilot.py +0 -0
  53. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/ecr.py +0 -0
  54. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/ecs.py +0 -0
  55. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/environment_variable.py +0 -0
  56. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/files.py +0 -0
  57. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/io.py +0 -0
  58. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/kms.py +0 -0
  59. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/load_balancers.py +0 -0
  60. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/parameter_store.py +0 -0
  61. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/schema_migrations/__init__.py +0 -0
  62. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/schema_migrations/schema_v0_to_v1_migration.py +0 -0
  63. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/schema_migrator.py +0 -0
  64. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/secrets.py +0 -0
  65. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/slack_channel_notifier.py +0 -0
  66. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/terraform_manifest.py +0 -0
  67. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/validation.py +0 -0
  68. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/version.py +0 -0
  69. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/version_status.py +0 -0
  70. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/providers/yaml_file.py +0 -0
  71. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/config.yml +0 -0
  72. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/image_build_run.sh +0 -0
  73. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/phases/build.sh +0 -0
  74. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/phases/install.sh +0 -0
  75. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/phases/post_build.sh +0 -0
  76. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/.copilot/phases/pre_build.sh +0 -0
  77. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/COMMANDS.md.jinja +0 -0
  78. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addon-instructions.txt +0 -0
  79. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/README.md +0 -0
  80. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/svc/appconfig-ipfilter.yml +0 -0
  81. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/svc/prometheus-policy.yml +0 -0
  82. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/svc/s3-cross-account-policy.yml +0 -0
  83. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/svc/s3-policy.yml +0 -0
  84. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/addons/svc/subscription-filter.yml +0 -0
  85. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/ci-codebuild-role-policy.json +0 -0
  86. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/create-codebuild-role.json +0 -0
  87. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/custom-codebuild-role-policy.json +0 -0
  88. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/env/manifest.yml +0 -0
  89. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/env/terraform-overrides/cfn.patches.yml +0 -0
  90. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/environment-pipelines/main.tf +0 -0
  91. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/default.html +0 -0
  92. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/dmas-migration.html +0 -0
  93. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/svc/maintenance_pages/migration.html +0 -0
  94. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/templates/svc/overrides/cfn.patches.yml +0 -0
  95. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utilities/decorators.py +0 -0
  96. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/__init__.py +0 -0
  97. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/application.py +0 -0
  98. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/arn_parser.py +0 -0
  99. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/click.py +0 -0
  100. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/git.py +0 -0
  101. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/messages.py +0 -0
  102. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/template.py +0 -0
  103. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/dbt_platform_helper/utils/validation.py +0 -0
  104. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/platform_helper.py +0 -0
  105. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/terraform/elasticache-redis/plans.yml +0 -0
  106. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/terraform/opensearch/plans.yml +0 -0
  107. {dbt_platform_helper-15.5.0 → dbt_platform_helper-15.6.0}/terraform/postgres/plans.yml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-platform-helper
3
- Version: 15.5.0
3
+ Version: 15.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
@@ -78,11 +78,42 @@ class VpcProvider:
78
78
 
79
79
  def _get_security_groups(self, app: str, env: str, vpc_id: str) -> list:
80
80
  vpc_filter = {"Name": "vpc-id", "Values": [vpc_id]}
81
- # TODO Handle terraformed environment SG https://uktrade.atlassian.net/browse/DBTP-2074
82
- tag_filter = {"Name": f"tag:Name", "Values": [f"copilot-{app}-{env}-env"]}
83
- response = self.ec2_client.describe_security_groups(Filters=[vpc_filter, tag_filter])
84
-
85
- return [sg.get("GroupId") for sg in response.get("SecurityGroups")]
81
+ platform_sg_name = f"platform-{app}-{env}-env-sg"
82
+ copilot_sg_name = f"copilot-{app}-{env}-env"
83
+ tag_filter = {"Name": f"tag:Name", "Values": [copilot_sg_name, platform_sg_name]}
84
+
85
+ filtered_security_groups = self.ec2_client.describe_security_groups(
86
+ Filters=[vpc_filter, tag_filter]
87
+ )
88
+
89
+ platform_security_groups = self._get_matching_security_groups(
90
+ filtered_security_groups, platform_sg_name
91
+ )
92
+
93
+ if platform_security_groups:
94
+ print(
95
+ f"using {platform_security_groups}"
96
+ ) # TODO remove this once decopilotiing has been completed
97
+ return platform_security_groups
98
+
99
+ copilot_security_groups = self._get_matching_security_groups(
100
+ filtered_security_groups, copilot_sg_name
101
+ )
102
+
103
+ print(
104
+ f"using {copilot_security_groups}"
105
+ ) # TODO remove this once decopilotiing has been completed
106
+ return copilot_security_groups
107
+
108
+ def _get_matching_security_groups(
109
+ self, filtered_security_groups: list[dict], security_group_name: str
110
+ ):
111
+ matching_sec_groups = filtered_security_groups.get("SecurityGroups")
112
+ return [
113
+ sg.get("GroupId")
114
+ for sg in matching_sec_groups
115
+ if {"Key": "Name", "Value": security_group_name} in sg.get("Tags", [])
116
+ ]
86
117
 
87
118
  def get_vpc(self, app: str, env: str, vpc_name: str) -> Vpc:
88
119
 
@@ -158,7 +158,17 @@ def get_ssm_secrets(app, env, session=None, path=None):
158
158
  secrets = []
159
159
 
160
160
  while True:
161
- response = client.get_parameters_by_path(**params)
161
+ try:
162
+ response = client.get_parameters_by_path(**params)
163
+ except ClientError as e:
164
+ if e.response["Error"]["Code"] == "AccessDeniedException":
165
+ click.secho(
166
+ "Access denied on SSM, due to missing permissions. Please update your environment infrastructure.",
167
+ fg="magenta",
168
+ )
169
+ break
170
+ else:
171
+ raise e
162
172
 
163
173
  for secret in response["Parameters"]:
164
174
  secrets.append((secret["Name"], secret["Value"]))
@@ -3,7 +3,7 @@ line-length = 100
3
3
 
4
4
  [tool.poetry]
5
5
  name = "dbt-platform-helper"
6
- version = "15.5.0"
6
+ version = "15.6.0"
7
7
  description = "Set of tools to help transfer applications/services from GOV.UK PaaS to DBT PaaS augmenting AWS Copilot."
8
8
  authors = ["Department for Business and Trade Platform Team <sre-team@digital.trade.gov.uk>"]
9
9
  license = "MIT"