qontract-reconcile 0.10.1rc1059__py3-none-any.whl → 0.10.1rc1061__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qontract-reconcile
3
- Version: 0.10.1rc1059
3
+ Version: 0.10.1rc1061
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Home-page: https://github.com/app-sre/qontract-reconcile
6
6
  Author: Red Hat App-SRE Team
@@ -104,7 +104,7 @@ reconcile/sendgrid_teammates.py,sha256=oO8QbLb4s1o8A6CGiCagN9CmS05BSS_WLztuY0Ym9
104
104
  reconcile/service_dependencies.py,sha256=PMKP9vc6oL-78rzyF_RE8DzLSQMSqN8vCqt9sWpBLAM,4470
105
105
  reconcile/signalfx_endpoint_monitoring.py,sha256=Nqgsg1cflSd2nNnm89y_e8c--7xLUqTrKOHkDs-qADE,2868
106
106
  reconcile/slack_base.py,sha256=8FqwMJ5SkoRyDJ9iPfZogWkC9QRoTouMCnGUevV_GME,3447
107
- reconcile/slack_usergroups.py,sha256=tZIpxbCmS8M4A15tYdtgCMEJ1Q6hcrkF9j_5-CZ6Yjs,29691
107
+ reconcile/slack_usergroups.py,sha256=ebCMtgpap6i_IUFFTuXU52MdkAXxSRG1bAcDPj64OIg,30083
108
108
  reconcile/sql_query.py,sha256=pH-EHkXiDknn8ZNXVqRZeqFc3sKhu2nhsaykgSytbS8,25895
109
109
  reconcile/status.py,sha256=cY4IJFXemhxptRJqR4qaaOWqei9e4jgLXuVSGajMsjg,544
110
110
  reconcile/status_board.py,sha256=YeoE7kLf1YKpOdN32u3vqhuSI46ep5N_qcVWC1CBCf8,8635
@@ -114,7 +114,7 @@ reconcile/terraform_cloudflare_resources.py,sha256=41Mj1WkuS75slCDpmhG2GGf1nh3Bw
114
114
  reconcile/terraform_cloudflare_users.py,sha256=iyTG5sj20Jg4J4qWJ144KVptfIHGOSfH8wQKxu0imq0,13942
115
115
  reconcile/terraform_repo.py,sha256=TKqlodhQGoAtQ6nDm04TNlpx4wpgJ_n4atoUK5Rfd7o,16444
116
116
  reconcile/terraform_resources.py,sha256=-sgMMHDtNvnQyNR05-MKebI_pSiyxSWAg8LmeA2_Ntk,19326
117
- reconcile/terraform_tgw_attachments.py,sha256=09svJG9pAiwWp4aY0xRoQRV90T4ZNwHG3r8flI-ZS_s,18810
117
+ reconcile/terraform_tgw_attachments.py,sha256=EucuF4p3RWKTS4GTPd8oZmR79GpIW_grQl2PAeeNQeI,18665
118
118
  reconcile/terraform_users.py,sha256=HqSm3ev3b8dZ9J6F_phDZB-FQsnlsdeKp9RPoY1cU94,10188
119
119
  reconcile/terraform_vpc_peerings.py,sha256=VLSfuO7FvHN5McopRiKoKJDHCmIhYtlJEHv_hxV5kcM,27669
120
120
  reconcile/vault_replication.py,sha256=isfmNaqxl4AC90n8sVJffUt685sPBfhNSvjks6DoQXg,17339
@@ -255,7 +255,7 @@ reconcile/gql_definitions/common/aws_vpcs.py,sha256=Dss9dQ3xagnz3Ltg1e9mtG2PAmQG
255
255
  reconcile/gql_definitions/common/clusters.py,sha256=Dr5AsSsTuqjAxkI9fU0fdiaP6u5qkmRpkkCcYDnU584,21868
256
256
  reconcile/gql_definitions/common/clusters_minimal.py,sha256=JYrJV_aStmryiiGKyiXhj47qpF_8KilCqy-d9CofBCo,4635
257
257
  reconcile/gql_definitions/common/clusters_with_dms.py,sha256=GJ53P8tgMLh1NfVkaV9_AmaqF9pNUqJZcDkcKzKzUy0,2242
258
- reconcile/gql_definitions/common/clusters_with_peering.py,sha256=B1Hi3u6rZZsl4bDDPMLIcSRI5lNFuh29lPVVTOrRRpQ,11929
258
+ reconcile/gql_definitions/common/clusters_with_peering.py,sha256=9NGjhJW_QWA5XSGGjULdIJdDVObdRqiX2OwEl9zTu4U,11838
259
259
  reconcile/gql_definitions/common/github_orgs.py,sha256=rZ0pDAA2_9hF9N-ykRZIxPtEmczTSjuA_k3nkp0k1W0,2039
260
260
  reconcile/gql_definitions/common/jira_settings.py,sha256=Fmjxhlhr69kc4jkG_0k17fuYlQVucbNex0jXYu83wbY,1990
261
261
  reconcile/gql_definitions/common/jiralert_settings.py,sha256=H96nMg_r2YcOvioj3aIkwqtFrALGSLt7uhbx9jGSUTo,1984
@@ -557,7 +557,7 @@ reconcile/test/test_saasherder.py,sha256=-WGgAsrTm_SJ0OQDLXd4JwEu1Mc6i4AePJqjZQT
557
557
  reconcile/test/test_saasherder_allowed_secret_paths.py,sha256=5NHQwNJO66at6HiyMZ5sVRTQDwxdvlOQo0KmkBWCw5Q,4853
558
558
  reconcile/test/test_secret_reader.py,sha256=kz7nzcPjvA08cytnvcA_PMA98AEyqJWsESkYeRn5xCk,4994
559
559
  reconcile/test/test_slack_base.py,sha256=pTUGvJ2S2wF3PhJyGWmiNXG52QtXKy2cbu-G8Ymrv6I,5019
560
- reconcile/test/test_slack_usergroups.py,sha256=YU7O7WseOGKWGZXLqlqZgXn99iVagWePDBH7cYVF3tg,24977
560
+ reconcile/test/test_slack_usergroups.py,sha256=OkD2sgTwUp6kahzL0oQM37Q7YNZHsS04hD2yV9skXhQ,25642
561
561
  reconcile/test/test_sql_query.py,sha256=4EfcLH0y3B4d11IEoue5dgA-h6f9pP5xiMCIdILSJaE,11022
562
562
  reconcile/test/test_status_board.py,sha256=o4jTZLtBFJN9FBmaHHkVGGPFSONLoB-P1xCX8giIBLw,7852
563
563
  reconcile/test/test_terraform_aws_route53.py,sha256=xHggb8K1P76OyCfFcogbkmyKle-NlUylcbDnuv3IqvY,771
@@ -566,7 +566,7 @@ reconcile/test/test_terraform_cloudflare_resources.py,sha256=1mdSZS-38mtTSg7teJg
566
566
  reconcile/test/test_terraform_cloudflare_users.py,sha256=2VGBtMUhckLPtUnQlHIzpGsCnyVJZPNLFf-ABELkxbQ,27456
567
567
  reconcile/test/test_terraform_repo.py,sha256=INfl-VlUtpV87J0neQt4wliptnX7PKvxLPF-ZgweTFA,12960
568
568
  reconcile/test/test_terraform_resources.py,sha256=8C97yXIEihaQ3DZrtjxLNt4y4G12IOhD01ydm7JjliY,15359
569
- reconcile/test/test_terraform_tgw_attachments.py,sha256=pJFmQzUwAn-wKpF6oSkImpdF7WXvcky8iaJiXbjGGgU,41104
569
+ reconcile/test/test_terraform_tgw_attachments.py,sha256=SM6QwogMZNLh0BkUyaxzFafuOLp23-hBtYTu_F53C4I,40922
570
570
  reconcile/test/test_terraform_users.py,sha256=XOAfGvITCJPI1LTlISmHbA4ONMQMkxYUMTsny7pQCFw,4319
571
571
  reconcile/test/test_terraform_vpc_peerings.py,sha256=bpjCjhmic07cw3XKSHf-2JvmLuWlyQG8laXlC-H7qtI,20796
572
572
  reconcile/test/test_terraform_vpc_peerings_build_desired_state.py,sha256=cHmr1_yhRgfdqlFX6TMw-aiKXebaRv0szl16M9YRJic,49988
@@ -724,8 +724,8 @@ reconcile/utils/sqs_gateway.py,sha256=XNIf3PY4UCPNufP2Ul0UJj3fKlt5larBba-VTT-41F
724
724
  reconcile/utils/state.py,sha256=W0_awkLAPX18hNOF_60o73tkPxDUylqbzYNHfl_sDsk,16386
725
725
  reconcile/utils/structs.py,sha256=LcbLEg8WxfRqM6nW7NhcWN0YeqF7SQzxOgntmLs1SgY,352
726
726
  reconcile/utils/template.py,sha256=wTvRU4AnAV_o042tD4Mwls2dwWMuk7MKnde3MaCjaYg,331
727
- reconcile/utils/terraform_client.py,sha256=rGyia1FuW-NtZhydreh5K2fAumvM9MJhxBaa6xUdH54,35905
728
- reconcile/utils/terrascript_aws_client.py,sha256=SMsJaOmpn_9QQHhKIN_5ps1zOa9zEcBSsxGOyvF8voU,280492
727
+ reconcile/utils/terraform_client.py,sha256=gyTqNyDn0uQISxnfXOWv8HpXSM1-yqvwDiVGIW0jpRk,35215
728
+ reconcile/utils/terrascript_aws_client.py,sha256=ctNT-TQSMxNicVIjR1gM2OZWzNc_BG820COSXb_E-CE,278933
729
729
  reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2voKr6KVI34zZE,4833
730
730
  reconcile/utils/throughput.py,sha256=iP4UWAe2LVhDo69mPPmgo9nQ7RxHD6_GS8MZe-aSiuM,344
731
731
  reconcile/utils/vault.py,sha256=9GSNHku8tw5KM2LKpZ1myWYDLtLGUJgpSnD0DxbzeO0,14956
@@ -867,8 +867,8 @@ tools/test/test_qontract_cli.py,sha256=_D61RFGAN5x44CY1tYbouhlGXXABwYfxKSWSQx3Jr
867
867
  tools/test/test_saas_promotion_state.py,sha256=dy4kkSSAQ7bC0Xp2CociETGN-2aABEfL6FU5D9Jl00Y,6056
868
868
  tools/test/test_sd_app_sre_alert_report.py,sha256=v363r9zM7__0kR5K6mvJoGFcM9BvE33fWAayrqkpojA,2116
869
869
  tools/test/test_sre_checkpoints.py,sha256=SKqPPTl9ua0RFdSSofnoQX-JZE6dFLO3LRhfQzqtfh8,2607
870
- qontract_reconcile-0.10.1rc1059.dist-info/METADATA,sha256=YQ--_Q2We5-jBRDfo1Q4mpT0E9dwxpholocK39LiTCU,2213
871
- qontract_reconcile-0.10.1rc1059.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
872
- qontract_reconcile-0.10.1rc1059.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
873
- qontract_reconcile-0.10.1rc1059.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
874
- qontract_reconcile-0.10.1rc1059.dist-info/RECORD,,
870
+ qontract_reconcile-0.10.1rc1061.dist-info/METADATA,sha256=h9WxXliU1mlCQK_rTCcdKt6xDFcUTN2z9AdiP-QeRzU,2213
871
+ qontract_reconcile-0.10.1rc1061.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
872
+ qontract_reconcile-0.10.1rc1061.dist-info/entry_points.txt,sha256=GKQqCl2j2X1BJQ69een6rHcR26PmnxnONLNOQB-nRjY,491
873
+ qontract_reconcile-0.10.1rc1061.dist-info/top_level.txt,sha256=l5ISPoXzt0SdR4jVdkfa7RPSKNc8zAHYWAnR-Dw8Ey8,24
874
+ qontract_reconcile-0.10.1rc1061.dist-info/RECORD,,
@@ -147,7 +147,6 @@ query ClustersWithPeering {
147
147
  }
148
148
  tags
149
149
  cidrBlock
150
- cidrBlocks
151
150
  manageSecurityGroups
152
151
  manageRoute53Associations
153
152
  allowPrivateHcpApiAccess
@@ -269,7 +268,6 @@ class ClusterPeeringConnectionAccountTGWV1(ClusterPeeringConnectionV1):
269
268
  account: ClusterPeeringConnectionAccountTGWV1_AWSAccountV1 = Field(..., alias="account")
270
269
  tags: Optional[Json] = Field(..., alias="tags")
271
270
  cidr_block: Optional[str] = Field(..., alias="cidrBlock")
272
- cidr_blocks: Optional[list[str]] = Field(..., alias="cidrBlocks")
273
271
  manage_security_groups: Optional[bool] = Field(..., alias="manageSecurityGroups")
274
272
  manage_route53_associations: Optional[bool] = Field(..., alias="manageRoute53Associations")
275
273
  allow_private_hcp_api_access: Optional[bool] = Field(..., alias="allowPrivateHcpApiAccess")
@@ -420,28 +420,13 @@ def get_desired_state(
420
420
  not in managed usergroups {p.workspace.managed_usergroups}"
421
421
  )
422
422
 
423
- all_user_names = [get_slack_username(u) for r in p.roles or [] for u in r.users]
424
- slack_usernames_pagerduty = get_usernames_from_pagerduty(
425
- pagerduties=p.pagerduty or [],
426
- users=users,
427
- usergroup=usergroup,
428
- pagerduty_map=pagerduty_map,
429
- )
430
- all_user_names.extend(slack_usernames_pagerduty)
431
-
432
- if p.owners_from_repos:
433
- slack_usernames_repo = get_slack_usernames_from_owners(
434
- p.owners_from_repos, users, usergroup
435
- )
436
- all_user_names.extend(slack_usernames_repo)
437
-
438
- if p.schedule:
439
- slack_usernames_schedule = get_slack_usernames_from_schedule(
440
- p.schedule.schedule
423
+ try:
424
+ user_names = _get_user_names(p, pagerduty_map, usergroup, users)
425
+ except Exception:
426
+ logging.exception(
427
+ f"Error getting user names for {p.workspace.name} #{usergroup}, skipping"
441
428
  )
442
- all_user_names.extend(slack_usernames_schedule)
443
-
444
- user_names = set(all_user_names)
429
+ continue
445
430
 
446
431
  try:
447
432
  desired_state[p.workspace.name][usergroup].user_names.update(user_names)
@@ -456,6 +441,35 @@ def get_desired_state(
456
441
  return desired_state
457
442
 
458
443
 
444
+ def _get_user_names(
445
+ permission: PermissionSlackUsergroupV1,
446
+ pagerduty_map: PagerDutyMap,
447
+ usergroup: str,
448
+ users: Iterable[User],
449
+ ) -> set[str]:
450
+ user_names = {
451
+ get_slack_username(u) for r in permission.roles or [] for u in r.users
452
+ }
453
+ slack_usernames_pagerduty = get_usernames_from_pagerduty(
454
+ pagerduties=permission.pagerduty or [],
455
+ users=users,
456
+ usergroup=usergroup,
457
+ pagerduty_map=pagerduty_map,
458
+ )
459
+ user_names.update(slack_usernames_pagerduty)
460
+ if permission.owners_from_repos:
461
+ slack_usernames_repo = get_slack_usernames_from_owners(
462
+ permission.owners_from_repos, users, usergroup
463
+ )
464
+ user_names.update(slack_usernames_repo)
465
+ if permission.schedule:
466
+ slack_usernames_schedule = get_slack_usernames_from_schedule(
467
+ permission.schedule.schedule
468
+ )
469
+ user_names.update(slack_usernames_schedule)
470
+ return user_names
471
+
472
+
459
473
  def get_desired_state_cluster_usergroups(
460
474
  slack_map: SlackMap,
461
475
  clusters: Iterable[ClusterV1],
@@ -64,14 +64,11 @@ class ValidationError(Exception):
64
64
  pass
65
65
 
66
66
 
67
- class TGWAccountProviderInfo(BaseModel):
67
+ class AccountProviderInfo(BaseModel):
68
68
  name: str
69
69
  uid: str
70
70
  assume_role: str | None
71
71
  assume_region: str
72
-
73
-
74
- class ClusterAccountProviderInfo(TGWAccountProviderInfo):
75
72
  assume_cidr: str
76
73
 
77
74
 
@@ -82,9 +79,8 @@ class Requester(BaseModel):
82
79
  routes: list[dict] | None
83
80
  rules: list[dict] | None
84
81
  hostedzones: list[str] | None
85
- cidr_block: str | None
86
- cidr_blocks: list[str]
87
- account: TGWAccountProviderInfo
82
+ cidr_block: str
83
+ account: AccountProviderInfo
88
84
 
89
85
 
90
86
  class Accepter(BaseModel):
@@ -93,7 +89,7 @@ class Accepter(BaseModel):
93
89
  vpc_id: str | None
94
90
  route_table_ids: list[str] | None
95
91
  subnets_id_az: list[dict] | None
96
- account: ClusterAccountProviderInfo
92
+ account: AccountProviderInfo
97
93
  api_security_group_id: str | None
98
94
 
99
95
 
@@ -229,7 +225,7 @@ def _build_account_with_assume_role(
229
225
  region: str,
230
226
  cidr_block: str,
231
227
  ocm: OCM | None,
232
- ) -> ClusterAccountProviderInfo:
228
+ ) -> AccountProviderInfo:
233
229
  account = peer_connection.account
234
230
  # assume_role is the role to assume to provision the
235
231
  # peering connection request, through the accepter AWS account.
@@ -239,7 +235,7 @@ def _build_account_with_assume_role(
239
235
  # there is no OCM at all.
240
236
  if not assume_role:
241
237
  if isinstance(cluster.spec, ClusterSpecROSAV1) and cluster.spec.account:
242
- return ClusterAccountProviderInfo(
238
+ return AccountProviderInfo(
243
239
  name=cluster.spec.account.name,
244
240
  uid=cluster.spec.account.uid,
245
241
  assume_role=assume_role,
@@ -251,7 +247,7 @@ def _build_account_with_assume_role(
251
247
  assume_role = ocm.get_aws_infrastructure_access_terraform_assume_role(
252
248
  cluster.name, account.uid, account.terraform_username
253
249
  )
254
- return ClusterAccountProviderInfo(
250
+ return AccountProviderInfo(
255
251
  name=account.name,
256
252
  uid=account.uid,
257
253
  assume_role=assume_role,
@@ -262,7 +258,7 @@ def _build_account_with_assume_role(
262
258
 
263
259
  def _build_accepter(
264
260
  peer_connection: ClusterPeeringConnectionAccountTGWV1,
265
- account: ClusterAccountProviderInfo,
261
+ account: AccountProviderInfo,
266
262
  region: str,
267
263
  cidr_block: str,
268
264
  awsapi: AWSApi,
@@ -294,10 +290,11 @@ def _build_requester(
294
290
  peer_connection: ClusterPeeringConnectionAccountTGWV1,
295
291
  tgw: Mapping,
296
292
  ) -> Requester:
297
- tgw_account = TGWAccountProviderInfo(
293
+ tgw_account = AccountProviderInfo(
298
294
  name=peer_connection.account.name,
299
295
  uid=peer_connection.account.uid,
300
296
  assume_region=tgw["region"],
297
+ assume_cidr=peer_connection.cidr_block,
301
298
  )
302
299
  return Requester(
303
300
  tgw_id=tgw["tgw_id"],
@@ -307,7 +304,6 @@ def _build_requester(
307
304
  rules=tgw.get("rules"),
308
305
  hostedzones=tgw.get("hostedzones"),
309
306
  cidr_block=peer_connection.cidr_block,
310
- cidr_blocks=peer_connection.cidr_blocks or [],
311
307
  account=tgw_account,
312
308
  )
313
309
 
@@ -435,6 +435,29 @@ def test_get_desired_state(
435
435
  }
436
436
 
437
437
 
438
+ def test_get_desired_state_with_error(
439
+ mocker: MockerFixture,
440
+ permissions: Sequence[PermissionSlackUsergroupV1],
441
+ user: UserV1,
442
+ ) -> None:
443
+ mocker.patch(
444
+ "reconcile.slack_usergroups.get_usernames_from_pagerduty"
445
+ ).return_value = ["user1"]
446
+ mocker.patch(
447
+ "reconcile.slack_usergroups.get_slack_usernames_from_owners"
448
+ ).side_effect = Exception("some error")
449
+ mock_pagerduty_map = create_autospec(PagerDutyMap)
450
+ result = integ.get_desired_state(
451
+ mock_pagerduty_map,
452
+ permissions[1:],
453
+ [user],
454
+ desired_workspace_name=None,
455
+ desired_usergroup_name=None,
456
+ )
457
+
458
+ assert result == {}
459
+
460
+
438
461
  def test_get_desired_state_cluster_usergroups(
439
462
  mocker: MockerFixture, slack_map: SlackMap, user: UserV1
440
463
  ) -> None:
@@ -161,7 +161,6 @@ def peering_connection_builder(
161
161
  account: ClusterPeeringConnectionAccountTGWV1_AWSAccountV1 | None = None,
162
162
  assume_role: str | None = None,
163
163
  cidr_block: str | None = None,
164
- cidr_blocks: list[str] | None = None,
165
164
  delete: bool | None = None,
166
165
  ) -> ClusterPeeringConnectionAccountTGWV1:
167
166
  return gql_class_factory(
@@ -173,7 +172,6 @@ def peering_connection_builder(
173
172
  "account": account.dict(by_alias=True) if account is not None else None,
174
173
  "assumeRole": assume_role,
175
174
  "cidrBlock": cidr_block,
176
- "cidrBlocks": cidr_blocks,
177
175
  "delete": delete,
178
176
  },
179
177
  )
@@ -193,7 +191,6 @@ def account_tgw_connection(
193
191
  account=tgw_connection_account,
194
192
  assume_role=None,
195
193
  cidr_block="172.16.0.0/16",
196
- cidr_blocks=["10.240.0.0/12"],
197
194
  delete=False,
198
195
  )
199
196
 
@@ -484,7 +481,6 @@ def build_expected_desired_state_item(
484
481
  rules=tgw["rules"],
485
482
  hostedzones=tgw["hostedzones"],
486
483
  cidr_block=connection.cidr_block,
487
- cidr_blocks=connection.cidr_blocks or [],
488
484
  account=expected_tgw_account,
489
485
  ),
490
486
  accepter=Accepter(
@@ -331,27 +331,12 @@ class TerraformClient: # pylint: disable=too-many-public-methods
331
331
  for resource_change in resource_changes:
332
332
  resource_type = resource_change["type"]
333
333
  resource_name = resource_change["name"]
334
- resource_previous_address = resource_change.get("previous_address")
335
334
  resource_change = resource_change["change"]
336
335
  actions = resource_change["actions"]
337
336
  for action in actions:
338
- if resource_previous_address:
339
- # the resource is being moved/renamed in the TF state
340
- with self._log_lock:
341
- logging.info([
342
- "move/rename",
343
- name,
344
- resource_previous_address,
345
- resource_change["address"],
346
- ])
347
-
348
337
  if action == "no-op":
349
338
  logging.debug([action, name, resource_type, resource_name])
350
- if resource_previous_address:
351
- # apply resource renaming with no-op
352
- self.increment_apply_count()
353
- else:
354
- continue
339
+ continue
355
340
  if action == "update" and resource_type == "aws_db_instance":
356
341
  self.validate_db_upgrade(name, resource_name, resource_change)
357
342
  # Ignore RDS modifications that are going to occur during the next
@@ -35,7 +35,6 @@ from sretoolbox.utils import threaded
35
35
  # temporary to create aws_ecrpublic_repository
36
36
  from terrascript import (
37
37
  Backend,
38
- Block,
39
38
  Data,
40
39
  Module,
41
40
  Output,
@@ -300,13 +299,6 @@ class UnapprovedSecretPathError(Exception):
300
299
  pass
301
300
 
302
301
 
303
- class Moved(Block):
304
- """Terraform `moved` block, available since Terraform 1.1"""
305
-
306
- def __init__(self, fro: str, to: str):
307
- super().__init__(fro=fro, to=to)
308
-
309
-
310
302
  class aws_ecrpublic_repository(Resource):
311
303
  pass
312
304
 
@@ -1400,32 +1392,17 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
1400
1392
  # add routes to existing route tables
1401
1393
  route_table_ids = accepter.route_table_ids
1402
1394
  req_cidr_block = requester.cidr_block
1403
- req_cidr_blocks = requester.cidr_blocks or []
1404
- if req_cidr_block:
1405
- req_cidr_blocks.append(req_cidr_block)
1406
- if route_table_ids and (req_cidr_block or req_cidr_blocks):
1395
+ if route_table_ids and req_cidr_block:
1407
1396
  for route_table_id in route_table_ids:
1408
- for cidr_block in req_cidr_blocks:
1409
- values = {
1410
- "provider": "aws." + acc_alias,
1411
- "route_table_id": route_table_id,
1412
- "destination_cidr_block": cidr_block,
1413
- "transit_gateway_id": requester.tgw_id,
1414
- }
1415
- # use the cidr block in the resource name to allow re-ordering
1416
- cidr_id = cidr_block.replace(".", "-").replace("/", "_")
1417
- route_identifier = (
1418
- f"{identifier}-{route_table_id}-dest-{cidr_id}"
1419
- )
1420
- tf_resource = aws_route(route_identifier, **values)
1421
- self.add_resource(infra_account_name, tf_resource)
1422
- if req_cidr_block:
1423
- req_cidr_id = req_cidr_block.replace(".", "-").replace("/", "_")
1424
- moved = Moved(
1425
- fro=f"aws_route.{identifier}-{route_table_id}",
1426
- to=f"aws_route.{identifier}-{route_table_id}-dest-{req_cidr_id}",
1427
- )
1428
- self.add_moved(infra_account_name, moved)
1397
+ values = {
1398
+ "provider": "aws." + acc_alias,
1399
+ "route_table_id": route_table_id,
1400
+ "destination_cidr_block": req_cidr_block,
1401
+ "transit_gateway_id": requester.tgw_id,
1402
+ }
1403
+ route_identifier = f"{identifier}-{route_table_id}"
1404
+ tf_resource = aws_route(route_identifier, **values)
1405
+ self.add_resource(infra_account_name, tf_resource)
1429
1406
 
1430
1407
  # add routes to peered transit gateways in the requester's
1431
1408
  # account to achieve global routing from all regions
@@ -4107,19 +4084,6 @@ class TerrascriptClient: # pylint: disable=too-many-public-methods
4107
4084
  with self.locks[account]:
4108
4085
  self.tss[account].add(tf_resource)
4109
4086
 
4110
- def add_moved(self, account: str, moved: Moved):
4111
- if account not in self.locks:
4112
- logging.debug(
4113
- f"integration {self.integration} is disabled for account {account}. "
4114
- "can not add resource"
4115
- )
4116
- return
4117
- with self.locks[account]:
4118
- self.tss[account].setdefault("moved", []).append({
4119
- "from": moved.fro,
4120
- "to": moved.to,
4121
- })
4122
-
4123
4087
  def dump(
4124
4088
  self,
4125
4089
  print_to_file: str | None = None,