dbt-platform-helper 13.4.0__py3-none-any.whl → 13.4.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.

@@ -229,44 +229,48 @@ class MaintenancePage:
229
229
  f"\nUse a browser plugin to add `Bypass-Key` header with value {bypass_value} to your requests. For more detail, visit https://platform.readme.trade.gov.uk/next-steps/put-a-service-under-maintenance/",
230
230
  )
231
231
 
232
- self.load_balancer.create_rule(
233
- listener_arn=listener_arn,
234
- priority=next(rule_priority),
235
- conditions=[
232
+ unique_sorted_host_headers = sorted(
233
+ list(
236
234
  {
237
- "Field": "path-pattern",
238
- "PathPatternConfig": {"Values": ["/*"]},
239
- },
240
- {
241
- "Field": "host-header",
242
- "HostHeaderConfig": {
243
- "Values": sorted(
244
- list(
245
- {
246
- value
247
- for condition in maintenance_page_host_header_conditions
248
- for value in condition["HostHeaderConfig"]["Values"]
249
- }
250
- )
251
- )
252
- },
253
- },
254
- ],
255
- actions=[
256
- {
257
- "Type": "fixed-response",
258
- "FixedResponseConfig": {
259
- "StatusCode": "503",
260
- "ContentType": "text/html",
261
- "MessageBody": maintenance_page_content,
262
- },
235
+ value
236
+ for condition in maintenance_page_host_header_conditions
237
+ for value in condition["HostHeaderConfig"]["Values"]
263
238
  }
264
- ],
265
- tags=[
266
- {"Key": "name", "Value": "MaintenancePage"},
267
- {"Key": "type", "Value": template},
268
- ],
239
+ )
269
240
  )
241
+
242
+ # Can only set 4 host headers per rule as listener rules have a max conditions of 5
243
+ for i in range(0, len(unique_sorted_host_headers), 4):
244
+ self.load_balancer.create_rule(
245
+ listener_arn=listener_arn,
246
+ priority=next(rule_priority),
247
+ conditions=[
248
+ {
249
+ "Field": "path-pattern",
250
+ "PathPatternConfig": {"Values": ["/*"]},
251
+ },
252
+ {
253
+ "Field": "host-header",
254
+ "HostHeaderConfig": {
255
+ "Values": unique_sorted_host_headers[i : i + 4],
256
+ },
257
+ },
258
+ ],
259
+ actions=[
260
+ {
261
+ "Type": "fixed-response",
262
+ "FixedResponseConfig": {
263
+ "StatusCode": "503",
264
+ "ContentType": "text/html",
265
+ "MessageBody": maintenance_page_content,
266
+ },
267
+ }
268
+ ],
269
+ tags=[
270
+ {"Key": "name", "Value": "MaintenancePage"},
271
+ {"Key": "type", "Value": template},
272
+ ],
273
+ )
270
274
  except Exception as e:
271
275
  self.__clean_up_maintenance_page_rules(listener_arn)
272
276
  raise FailedToActivateMaintenancePageException(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-platform-helper
3
- Version: 13.4.0
3
+ Version: 13.4.1
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
@@ -24,7 +24,7 @@ dbt_platform_helper/domain/config.py,sha256=au45EnEAjv0RZUEDJ_0IQnsRV7wM0hHi-ZJ6
24
24
  dbt_platform_helper/domain/copilot.py,sha256=9L4h-WFwgRU8AMjf14PlDqwLqOpIRinkuPvhe-8Uk3c,15034
25
25
  dbt_platform_helper/domain/copilot_environment.py,sha256=yPt6ZarOvFPo06XwY1sU5MOQsoV7TEsKSQHyM-G8aGc,9058
26
26
  dbt_platform_helper/domain/database_copy.py,sha256=CKvI9LsHyowg0bPT9jImk07w4TyQLPoInQoU2TUDiJQ,9485
27
- dbt_platform_helper/domain/maintenance_page.py,sha256=h7uYlUi4rlaDV9DvdElb2yD4H6Nz7dHMx3RIQfjHFZw,14258
27
+ dbt_platform_helper/domain/maintenance_page.py,sha256=CfSJJYXOaBC0S4tKsMl0Pz-_6r0DR5J8BUkBQUTx2nM,14494
28
28
  dbt_platform_helper/domain/pipelines.py,sha256=mUvGaNMtBAUemsb-fHDcpWV-9LfqGoSogI2LwDnvt0I,6503
29
29
  dbt_platform_helper/domain/terraform_environment.py,sha256=7ZKLZ8Zk6-V_IPaCDUP8eYTRudqDjHxvFnbG6LIlLO4,1759
30
30
  dbt_platform_helper/domain/versioning.py,sha256=9AdQ_pW20RUwdvdSgY_OzqlDkFaevLNAeh5WZ-w0Xww,7865
@@ -93,8 +93,8 @@ dbt_platform_helper/utils/template.py,sha256=g-Db-0I6a6diOHkgK1nYA0IxJSO4TRrjqOv
93
93
  dbt_platform_helper/utils/tool_versioning.py,sha256=UXrICUnnWCSpOdIIJaVnZcN2U3pgCUbpjvL4exevDbw,510
94
94
  dbt_platform_helper/utils/validation.py,sha256=coN7WsKW_nPGW9EU23AInBkAuvUl1NfQvc2bjVtgs14,1188
95
95
  platform_helper.py,sha256=_YNNGtMkH5BcpC_mQQYJrmlf2mt7lkxTYeH7ZgflPoA,1925
96
- dbt_platform_helper-13.4.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
97
- dbt_platform_helper-13.4.0.dist-info/METADATA,sha256=OwV6km_FcnolH0L_2ktA7iEpRYueMceoPw0cKm4gHJU,3243
98
- dbt_platform_helper-13.4.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
99
- dbt_platform_helper-13.4.0.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
100
- dbt_platform_helper-13.4.0.dist-info/RECORD,,
96
+ dbt_platform_helper-13.4.1.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
97
+ dbt_platform_helper-13.4.1.dist-info/METADATA,sha256=oR-YiD_AFk8sL-CZ6CnbMziVA9mZG1SpXOnpTy3hTJw,3243
98
+ dbt_platform_helper-13.4.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
99
+ dbt_platform_helper-13.4.1.dist-info/entry_points.txt,sha256=QhbY8F434A-onsg0-FsdMd2U6HKh6Q7yCFFZrGUh5-M,67
100
+ dbt_platform_helper-13.4.1.dist-info/RECORD,,