qontract-reconcile 0.10.2.dev308__py3-none-any.whl → 0.10.2.dev310__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.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev308
3
+ Version: 0.10.2.dev310
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
6
6
  Project-URL: repository, https://github.com/app-sre/qontract-reconcile
@@ -109,9 +109,9 @@ reconcile/terraform_cloudflare_resources.py,sha256=tK-BxQeNdZjf59deKd51Roz868e7U
109
109
  reconcile/terraform_cloudflare_users.py,sha256=mlSYNktRetBvw8mi2TUSdKSZw0aQ821VeU6OQ1WcV3U,13516
110
110
  reconcile/terraform_repo.py,sha256=vVJfaCV9775FGMMTHfoobaPetSlJMiQ4arNudL2pvh8,15607
111
111
  reconcile/terraform_resources.py,sha256=AXO3_Ehcg3I6ao7qiKzXC4Mk6BqwMoNooXU50c2zSTA,19555
112
- reconcile/terraform_tgw_attachments.py,sha256=uls0GlTVeSMTZtUGXpqDW8ovKqXV-6036AhmxYOmFbM,18923
113
- reconcile/terraform_users.py,sha256=F-OgRfVV6_MoSvL0oZBtbFtNVS4V48baOWN157IoGEE,10321
114
- reconcile/terraform_vpc_peerings.py,sha256=v1GPiluuPLwpQWrp1j5xT9_QuQw07F_Lj2uL3RX9PZE,27788
112
+ reconcile/terraform_tgw_attachments.py,sha256=4cUuM0cfTY6Hy2NnLgzavo7URnblOtgsgV9pSpNOadQ,18936
113
+ reconcile/terraform_users.py,sha256=qcgI2VF6Gak_IwncOUSzqLvajSu4Q4ltKnuFIfttjhQ,10373
114
+ reconcile/terraform_vpc_peerings.py,sha256=rMotDHy3Fd5QTxrOGjCJ3f2vICk3fmxrKYVCIU8p_y4,27787
115
115
  reconcile/vault_replication.py,sha256=trtbB-jDwca822J5I_s0zlwFtlyaiAtqgbPeqp7Cggc,17714
116
116
  reconcile/vpc_peerings_validator.py,sha256=_77eu6DSy6VjTE5mhV-sOIVOGIiBvDEEDCdwwRdrgVQ,7101
117
117
  reconcile/aus/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -213,7 +213,7 @@ reconcile/glitchtip_project_alerts/integration.py,sha256=d3PMy-mQSbSZdIGAVaZCA2U
213
213
  reconcile/glitchtip_project_dsn/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
214
  reconcile/glitchtip_project_dsn/integration.py,sha256=3GgcqUM6hWhLpo9Yx5Xr9vrdexF-WNevVCNL9bJ0Upc,8162
215
215
  reconcile/gql_definitions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
- reconcile/gql_definitions/introspection.json,sha256=jJN4kUVnrBkb39pHZ0lwt_0ZuIyrhjyzsL17pQuGwXo,2358826
216
+ reconcile/gql_definitions/introspection.json,sha256=iXV6SKgNQpvwFvnRTqJsXVPN70Pv4pFTrbNQ-nADp6Y,2359857
217
217
  reconcile/gql_definitions/acs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
218
218
  reconcile/gql_definitions/acs/acs_instances.py,sha256=L91WW9LbhJbBSrECqShQpFtjoBOsmNIYLRpMbx1io5o,2181
219
219
  reconcile/gql_definitions/acs/acs_policies.py,sha256=Ygpfl2-VkYLSlJvHgp_dJBfb66K_Rwfdfpsa18w1v1s,4338
@@ -258,7 +258,7 @@ reconcile/gql_definitions/common/app_interface_state_settings.py,sha256=VXIK0Hmy
258
258
  reconcile/gql_definitions/common/app_interface_vault_settings.py,sha256=w8quvdG0cSq71ZyJokPPp7MyMpoDb6-HLQ3o9JHVGRQ,1771
259
259
  reconcile/gql_definitions/common/app_quay_repos_escalation_policies.py,sha256=ckdoGse7O5uAWdZdNinkWicA2EflUb5pe8jWEBtflE8,3236
260
260
  reconcile/gql_definitions/common/apps.py,sha256=lC7uZjyHAvJXhCDPJJ-dQJInBJkUCNZoe129XMa67wo,1868
261
- reconcile/gql_definitions/common/aws_vpc_requests.py,sha256=2lpyy-QSfHPSTvV_zbnqzqUoFzVNl-CJDmoqd_zVSX4,2366
261
+ reconcile/gql_definitions/common/aws_vpc_requests.py,sha256=_KhmxOfUhSWdUMGxFzrwlIq5mZHzNqvDBZv5Hgku8mU,2423
262
262
  reconcile/gql_definitions/common/aws_vpcs.py,sha256=Dss9dQ3xagnz3Ltg1e9mtG2PAmQGBbUzKCmmzvuN28s,1892
263
263
  reconcile/gql_definitions/common/clusters.py,sha256=j646LA-vlHbA131OrCF13g8rPPrBPWL3PLrvqWLZs58,21979
264
264
  reconcile/gql_definitions/common/clusters_minimal.py,sha256=JYrJV_aStmryiiGKyiXhj47qpF_8KilCqy-d9CofBCo,4635
@@ -318,7 +318,7 @@ reconcile/gql_definitions/fragments/aws_account_managed.py,sha256=V_9pH0wVza2sPy
318
318
  reconcile/gql_definitions/fragments/aws_account_sso.py,sha256=ITR3PLz4Iq1SiWAoYGWPDuHJnAmTyZ0QQqs2Zsi8pxA,979
319
319
  reconcile/gql_definitions/fragments/aws_infra_management_account.py,sha256=uAmALVRF2gBM3p_Dmez_ew6KVAtetamwOPkRIPZAlGc,1254
320
320
  reconcile/gql_definitions/fragments/aws_vpc.py,sha256=T2egTwi2Rb0IRBBmsyag8xKpu_m6GbIAy80fhZNZwk8,1434
321
- reconcile/gql_definitions/fragments/aws_vpc_request.py,sha256=o0qUsPrFXs8GAbtgMXQmIJxc1mw5skSIzCcidE857g8,2460
321
+ reconcile/gql_definitions/fragments/aws_vpc_request.py,sha256=RJRNicxHzwrIqPUSjDvtIt9JGu9lov4n3xOVRx8AlVY,2682
322
322
  reconcile/gql_definitions/fragments/aws_vpc_request_subnet.py,sha256=qaTFT8cGzEslw51nUeb45Nfnv6kFxUm4CWrRR3xfBvA,760
323
323
  reconcile/gql_definitions/fragments/container_image_mirror.py,sha256=qyfQlnKUCzFEPgUJ9VGmDYFmiGHR7VZ_YJNd4KeoolM,968
324
324
  reconcile/gql_definitions/fragments/deploy_resources.py,sha256=0u3xYqL5NpMf149BJLfPhHqAOWu06aLULdNk_2Mulxg,1089
@@ -518,7 +518,7 @@ reconcile/terraform_init/integration.py,sha256=pPi4YAjbEE8vDaaRizGf-d-PewqqSJmjc
518
518
  reconcile/terraform_init/merge_request.py,sha256=3CYtgSd7Q9zjKg4wsDz437EPCRfGeZZ8fZ0Y-ChKXJY,1475
519
519
  reconcile/terraform_init/merge_request_manager.py,sha256=TQmtHq4DH-xgyYvuRyGu7VEgjPU2Yjj-uexIy-L7i88,3098
520
520
  reconcile/terraform_vpc_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
521
- reconcile/terraform_vpc_resources/integration.py,sha256=8pmcr0YTrW2QynenMCfaaXT4SV8SbH_eXx1OCyh0anA,8181
521
+ reconcile/terraform_vpc_resources/integration.py,sha256=Gn98Gt1YqghnkxX2Bs6Q4GAT2H8KhRJsLFf-NnALs8o,8995
522
522
  reconcile/terraform_vpc_resources/merge_request.py,sha256=loRymUigCIvaaT0s_NzktZchh-DGRQnCICdBSCAcFPY,1503
523
523
  reconcile/terraform_vpc_resources/merge_request_manager.py,sha256=6jfwgbqXEFQlgLM6zmModpOkQX8wqddpoE0pZJL1Acc,3256
524
524
  reconcile/typed_queries/__init__.py,sha256=rRk4CyslLsBr4vAh1pIPgt6s3P4R1M9NSEPLnyQgBpk,61
@@ -657,8 +657,8 @@ reconcile/utils/smtp_client.py,sha256=0xefB4I9E5eBB-FlxFJYjvz3Kvuqi_K3Ma_Wk0NAQK
657
657
  reconcile/utils/sqs_gateway.py,sha256=XNIf3PY4UCPNufP2Ul0UJj3fKlt5larBba-VTT-41Fg,2265
658
658
  reconcile/utils/state.py,sha256=vCHYIfrWLfPyIWEHSaADWlc4OqhwcOiqM3Egqvw-lfo,16372
659
659
  reconcile/utils/structs.py,sha256=P57POzpEntu8ZoZDnsOdni9qUuBDWknmw0iinznxXoY,386
660
- reconcile/utils/terraform_client.py,sha256=GoLbfs4d4YItNCeV3NZnrth4sD8ziNYgY2IszruRDpg,37303
661
- reconcile/utils/terrascript_aws_client.py,sha256=o5-K61gEbQN48IRfdHVDfgt0sW-sYN9WYho4ZZ7j7io,295917
660
+ reconcile/utils/terraform_client.py,sha256=VP5Bd9Eto-To45TV08SmhhXTB3j-i2Ld3Nnvh2tkcjw,37393
661
+ reconcile/utils/terrascript_aws_client.py,sha256=lFyGsQvK7myl5hRnTSlEtnF5oi3ABgZZ3ABCpnOcQRw,302092
662
662
  reconcile/utils/three_way_diff_strategy.py,sha256=oQcHXd9LVhirJfoaOBoHUYuZVGfyL2voKr6KVI34zZE,4833
663
663
  reconcile/utils/throughput.py,sha256=KNDCVsCLSp89V4pO3sEUd7bJUuh6gNfsxsc_18rEv_Y,357
664
664
  reconcile/utils/vault.py,sha256=6V15LByFghp-U3k0N4lum6V7qt2EAlRfcAxjy5e-FAU,15146
@@ -796,7 +796,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
796
796
  tools/saas_promotion_state/saas_promotion_state.py,sha256=uQv2QJAmUXP1g2GPIH30WTlvL9soY6m9lefpZEVDM5w,3965
797
797
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
798
798
  tools/sre_checkpoints/util.py,sha256=KcYVfa3UmJHVP_ocgrKe8NkrO5IDB9aWEDydSokPcRk,975
799
- qontract_reconcile-0.10.2.dev308.dist-info/METADATA,sha256=ZD-9CrY2y9ZCq1K7sCAHPwzqk9JVqsB5i9-yrbi3ud8,24916
800
- qontract_reconcile-0.10.2.dev308.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
801
- qontract_reconcile-0.10.2.dev308.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
802
- qontract_reconcile-0.10.2.dev308.dist-info/RECORD,,
799
+ qontract_reconcile-0.10.2.dev310.dist-info/METADATA,sha256=MeRf1hSIsgsZS5rKrs9D4gZ5PXHd-XM1CREWYwfnnDc,24916
800
+ qontract_reconcile-0.10.2.dev310.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
801
+ qontract_reconcile-0.10.2.dev310.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
802
+ qontract_reconcile-0.10.2.dev310.dist-info/RECORD,,
@@ -58,10 +58,13 @@ fragment VPCRequest on VPCRequest_v1 {
58
58
  cidr_block {
59
59
  networkAddress
60
60
  }
61
+ vpc_tags
61
62
  subnets {
62
- private
63
+ private
63
64
  public
64
65
  availability_zones
66
+ private_subnet_tags
67
+ public_subnet_tags
65
68
  }
66
69
  }
67
70
 
@@ -54,6 +54,8 @@ class VPCRequestSubnetsListsV1(ConfiguredBaseModel):
54
54
  private: Optional[list[str]] = Field(..., alias="private")
55
55
  public: Optional[list[str]] = Field(..., alias="public")
56
56
  availability_zones: Optional[list[str]] = Field(..., alias="availability_zones")
57
+ private_subnet_tags: Optional[Json] = Field(..., alias="private_subnet_tags")
58
+ public_subnet_tags: Optional[Json] = Field(..., alias="public_subnet_tags")
57
59
 
58
60
 
59
61
  class VPCRequest(ConfiguredBaseModel):
@@ -62,4 +64,5 @@ class VPCRequest(ConfiguredBaseModel):
62
64
  account: AWSAccountV1 = Field(..., alias="account")
63
65
  region: str = Field(..., alias="region")
64
66
  cidr_block: NetworkV1 = Field(..., alias="cidr_block")
67
+ vpc_tags: Optional[Json] = Field(..., alias="vpc_tags")
65
68
  subnets: Optional[VPCRequestSubnetsListsV1] = Field(..., alias="subnets")
@@ -10948,18 +10948,6 @@
10948
10948
  "isDeprecated": false,
10949
10949
  "deprecationReason": null
10950
10950
  },
10951
- {
10952
- "name": "slack_username",
10953
- "description": null,
10954
- "args": [],
10955
- "type": {
10956
- "kind": "SCALAR",
10957
- "name": "String",
10958
- "ofType": null
10959
- },
10960
- "isDeprecated": false,
10961
- "deprecationReason": null
10962
- },
10963
10951
  {
10964
10952
  "name": "pagerduty_username",
10965
10953
  "description": null,
@@ -27860,6 +27848,18 @@
27860
27848
  },
27861
27849
  "isDeprecated": false,
27862
27850
  "deprecationReason": null
27851
+ },
27852
+ {
27853
+ "name": "vpc_tags",
27854
+ "description": null,
27855
+ "args": [],
27856
+ "type": {
27857
+ "kind": "SCALAR",
27858
+ "name": "JSON",
27859
+ "ofType": null
27860
+ },
27861
+ "isDeprecated": false,
27862
+ "deprecationReason": null
27863
27863
  }
27864
27864
  ],
27865
27865
  "inputFields": null,
@@ -28089,6 +28089,30 @@
28089
28089
  },
28090
28090
  "isDeprecated": false,
28091
28091
  "deprecationReason": null
28092
+ },
28093
+ {
28094
+ "name": "private_subnet_tags",
28095
+ "description": null,
28096
+ "args": [],
28097
+ "type": {
28098
+ "kind": "SCALAR",
28099
+ "name": "JSON",
28100
+ "ofType": null
28101
+ },
28102
+ "isDeprecated": false,
28103
+ "deprecationReason": null
28104
+ },
28105
+ {
28106
+ "name": "public_subnet_tags",
28107
+ "description": null,
28108
+ "args": [],
28109
+ "type": {
28110
+ "kind": "SCALAR",
28111
+ "name": "JSON",
28112
+ "ofType": null
28113
+ },
28114
+ "isDeprecated": false,
28115
+ "deprecationReason": null
28092
28116
  }
28093
28117
  ],
28094
28118
  "inputFields": null,
@@ -93,7 +93,7 @@ class Accepter(BaseModel):
93
93
  region: str
94
94
  vpc_id: str | None
95
95
  route_table_ids: list[str] | None
96
- subnets_id_az: list[dict] | None
96
+ subnets_id_az: list[dict[str, str]] | None
97
97
  account: ClusterAccountProviderInfo
98
98
  api_security_group_id: str | None
99
99
 
@@ -342,7 +342,7 @@ def _populate_tgw_attachments_working_dirs(
342
342
  ts: Terrascript,
343
343
  desired_state: Iterable[DesiredStateItem],
344
344
  print_to_file: str | None,
345
- ) -> dict[str, str]:
345
+ ) -> Mapping[str, str]:
346
346
  accounts_by_infra_account_name: dict[str, list[dict[str, Any]]] = {}
347
347
  for item in desired_state:
348
348
  accounts_by_infra_account_name.setdefault(item.infra_acount_name, []).append(
@@ -1,4 +1,5 @@
1
1
  import sys
2
+ from collections.abc import Mapping
2
3
  from textwrap import indent
3
4
  from typing import (
4
5
  Any,
@@ -81,8 +82,10 @@ QONTRACT_INTEGRATION = "terraform_users"
81
82
  QONTRACT_INTEGRATION_VERSION = make_semver(0, 4, 2)
82
83
  QONTRACT_TF_PREFIX = "qrtf"
83
84
 
85
+ Role = dict[str, Any]
84
86
 
85
- def get_tf_roles() -> list[dict[str, Any]]:
87
+
88
+ def get_tf_roles() -> list[Role]:
86
89
  gqlapi = gql.get_api()
87
90
  roles: list[dict] = expiration.filter(gqlapi.query(TF_QUERY)["roles"])
88
91
  return [
@@ -114,7 +117,7 @@ def setup(
114
117
  skip_reencrypt_accounts: list[str],
115
118
  appsre_pgp_key: str | None = None,
116
119
  account_name: str | None = None,
117
- ) -> tuple[list[dict[str, Any]], dict[str, str], bool, AWSApi]:
120
+ ) -> tuple[list[dict[str, Any]], Mapping[str, str], bool, AWSApi]:
118
121
  accounts = [
119
122
  a
120
123
  for a in queries.get_aws_accounts(terraform_state=True)
@@ -565,7 +565,7 @@ def build_desired_state_vpc(
565
565
  @defer
566
566
  def run(
567
567
  dry_run: bool,
568
- print_to_file: bool | None = None,
568
+ print_to_file: str | None = None,
569
569
  enable_deletion: bool = False,
570
570
  thread_pool_size: int = DEFAULT_THREAD_POOL_SIZE,
571
571
  account_name: str | None = None,
@@ -31,7 +31,11 @@ from reconcile.utils.runtime.integration import (
31
31
  from reconcile.utils.secret_reader import create_secret_reader
32
32
  from reconcile.utils.semver_helper import make_semver
33
33
  from reconcile.utils.terraform_client import TerraformClient
34
- from reconcile.utils.terrascript_aws_client import TerrascriptClient
34
+ from reconcile.utils.terrascript_aws_client import (
35
+ VPC_REQUEST_DEFAULT_PRIVATE_SUBNET_TAGS,
36
+ VPC_REQUEST_DEFAULT_PUBLIC_SUBNET_TAGS,
37
+ TerrascriptClient,
38
+ )
35
39
  from reconcile.utils.vcs import VCS
36
40
 
37
41
  QONTRACT_INTEGRATION = "terraform_vpc_resources"
@@ -90,14 +94,28 @@ class TerraformVpcResources(QontractReconcileIntegration[TerraformVpcResourcesPa
90
94
  f"{request.identifier}-public_subnets", {}
91
95
  ).get("value", [])
92
96
 
97
+ if request.subnets:
98
+ private_subnet_tags = VPC_REQUEST_DEFAULT_PRIVATE_SUBNET_TAGS | (
99
+ request.subnets.private_subnet_tags or {}
100
+ )
101
+ public_subnet_tags = VPC_REQUEST_DEFAULT_PUBLIC_SUBNET_TAGS | (
102
+ request.subnets.public_subnet_tags or {}
103
+ )
104
+ else:
105
+ private_subnet_tags = VPC_REQUEST_DEFAULT_PRIVATE_SUBNET_TAGS
106
+ public_subnet_tags = VPC_REQUEST_DEFAULT_PUBLIC_SUBNET_TAGS
107
+
93
108
  values = {
94
109
  "static": {
95
110
  "vpc_id": outputs_per_account.get(
96
111
  f"{request.identifier}-vpc_id", {}
97
112
  ).get("value"),
113
+ "vpc_tags": request.vpc_tags or {},
98
114
  "subnets": {
99
115
  "private": private_subnets,
100
116
  "public": public_subnets,
117
+ "private_subnet_tags": private_subnet_tags,
118
+ "public_subnet_tags": public_subnet_tags,
101
119
  },
102
120
  "account_name": request.account.name,
103
121
  "region": request.region,
@@ -194,17 +194,17 @@ class TerraformClient:
194
194
  return spec.name, json.loads(stdout)
195
195
 
196
196
  # terraform plan
197
- def plan(self, enable_deletion):
197
+ def plan(self, enable_deletion: bool) -> tuple[bool, bool]:
198
198
  errors = False
199
199
  disabled_deletions_detected = False
200
- results = threaded.run(
200
+ results: list[tuple[bool, list[AccountUser], bool]] = threaded.run(
201
201
  self.terraform_plan,
202
202
  self.specs,
203
203
  self.thread_pool_size,
204
204
  enable_deletion=enable_deletion,
205
205
  )
206
206
 
207
- self.created_users = []
207
+ self.created_users: list[AccountUser] = []
208
208
  for disabled_deletion_detected, created_users, error in results:
209
209
  if error:
210
210
  errors = True