qontract-reconcile 0.10.2.dev158__py3-none-any.whl → 0.10.2.dev160__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.dev158
3
+ Version: 0.10.2.dev160
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
@@ -152,7 +152,7 @@ reconcile/aws_account_manager/utils.py,sha256=iYPPOtbZ7FiKkz9v5f1YXRIHw5YFOtSavU
152
152
  reconcile/aws_ami_cleanup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
153
153
  reconcile/aws_ami_cleanup/integration.py,sha256=KG7g9NpbKmoaveDD3oi9SinqUE29NaM-4lGo-6YuHlM,9302
154
154
  reconcile/aws_cloudwatch_log_retention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
- reconcile/aws_cloudwatch_log_retention/integration.py,sha256=qVggTjGwP_6xTCXo2o3brSPtjwArNhZiGPy8YiBrCMM,7779
155
+ reconcile/aws_cloudwatch_log_retention/integration.py,sha256=QY5EtCpcMN0TgOQInIDW65wT1YksMBFkK8aNK5cg-XA,8107
156
156
  reconcile/aws_saml_idp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
157
  reconcile/aws_saml_idp/integration.py,sha256=Z2JtUx2YIbkn0KVrVa2CoAErPB8vTykOOkWD_ZPoB94,6511
158
158
  reconcile/aws_saml_roles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -246,6 +246,8 @@ reconcile/gql_definitions/aws_account_manager/__init__.py,sha256=47DEQpj8HBSa-_T
246
246
  reconcile/gql_definitions/aws_account_manager/aws_accounts.py,sha256=vF51KrY2gwX0J9vESiaRMPQqdAMEtz9f_tBq52bInp0,5148
247
247
  reconcile/gql_definitions/aws_ami_cleanup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
248
248
  reconcile/gql_definitions/aws_ami_cleanup/aws_accounts.py,sha256=jIgOa888MYLLvVsn1ir3nbkhWLG5T6dBg7oDnp1q8BI,4108
249
+ reconcile/gql_definitions/aws_cloudwatch_log_retention/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
+ reconcile/gql_definitions/aws_cloudwatch_log_retention/aws_accounts.py,sha256=Am6y5LZIBncH9u7vwU48WRksnwGljpoS-xbP7MJA8-4,4976
249
251
  reconcile/gql_definitions/aws_saml_idp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
252
  reconcile/gql_definitions/aws_saml_idp/aws_accounts.py,sha256=pR9Qm6P9Roe4OJaDXvfm8AcfkSSAtriQdlwLwW7UdUU,2666
251
253
  reconcile/gql_definitions/aws_saml_roles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -432,7 +434,7 @@ reconcile/gql_definitions/terraform_repo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
432
434
  reconcile/gql_definitions/terraform_repo/terraform_repo.py,sha256=9cDKdP9ziBh9J_mw2Gi6GUOP4mFxMABY_D62qSeMtJI,3881
433
435
  reconcile/gql_definitions/terraform_resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
434
436
  reconcile/gql_definitions/terraform_resources/database_access_manager.py,sha256=yv0_YC-LmhaKD_gyGG3le1w5BtypBjlsO894-Zgdg4U,4813
435
- reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=6Er4NT3hHT66tFCBlyBeyGXDzxO_OYiL36lCe8JM9vQ,44562
437
+ reconcile/gql_definitions/terraform_resources/terraform_resources_namespaces.py,sha256=EKqXL8Bx6NXqsVI4nfyQpKq8B_uHQl0L7QWnerBQTy0,44668
436
438
  reconcile/gql_definitions/terraform_tgw_attachments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
437
439
  reconcile/gql_definitions/terraform_tgw_attachments/aws_accounts.py,sha256=FPyPEikpkZ_kvHfXqnkzSUDNmxMMTiUwhI-eLQtuIHM,2616
438
440
  reconcile/gql_definitions/unleash_feature_toggles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -575,6 +577,7 @@ reconcile/typed_queries/vault.py,sha256=lkRsmobykorof3fcrIPLz-NgvAiSOWSOZc_jXBln
575
577
  reconcile/typed_queries/app_interface_metrics_exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
576
578
  reconcile/typed_queries/app_interface_metrics_exporter/onboarding_status.py,sha256=X-N1WJGOL6OR9940P0_K4-YJzkL5Vg4favhYrBxXD9A,327
577
579
  reconcile/typed_queries/app_interface_metrics_exporter/terraform_repo.py,sha256=r-nJ5CucAOE_cwxnbVp5lmAAfHBG8t1h2tVmhviVYls,290
580
+ reconcile/typed_queries/aws_cloudwatch_log_retention/aws_accounts.py,sha256=WiQ84vEZp-oYvD4CVZaFDYcMBn-pkO3slwsHIQxvHks,296
578
581
  reconcile/typed_queries/cost_report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
579
582
  reconcile/typed_queries/cost_report/app_names.py,sha256=HMEMIqAbMyVQfoQ5YXTXE4xDt7FaXBRz0QIHnsIZC1c,478
580
583
  reconcile/typed_queries/cost_report/cost_namespaces.py,sha256=1GUjWXQj7U2djVHBPYcd8Cy2-enKXf0-GaplLi8JZw4,1178
@@ -797,7 +800,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
797
800
  tools/saas_promotion_state/saas_promotion_state.py,sha256=UfwwRLS5Ya4_Nh1w5n1dvoYtchQvYE9yj1VANt2IKqI,3925
798
801
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
799
802
  tools/sre_checkpoints/util.py,sha256=zEDbGr18ZeHNQwW8pUsr2JRjuXIPz--WAGJxZo9sv_Y,894
800
- qontract_reconcile-0.10.2.dev158.dist-info/METADATA,sha256=1ciBYBdru8TmnRdRAo-CQuWYci-EUZzdVv3aygjMl2s,24627
801
- qontract_reconcile-0.10.2.dev158.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
802
- qontract_reconcile-0.10.2.dev158.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
803
- qontract_reconcile-0.10.2.dev158.dist-info/RECORD,,
803
+ qontract_reconcile-0.10.2.dev160.dist-info/METADATA,sha256=q307B4-jiPGwEIJonpzw-vEkV7sOmCmPOxubWtR60TI,24627
804
+ qontract_reconcile-0.10.2.dev160.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
805
+ qontract_reconcile-0.10.2.dev160.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
806
+ qontract_reconcile-0.10.2.dev160.dist-info/RECORD,,
@@ -5,13 +5,22 @@ from collections import defaultdict
5
5
  from collections.abc import Iterable
6
6
  from datetime import UTC, datetime, timedelta
7
7
  from enum import Enum
8
- from typing import TYPE_CHECKING
8
+ from typing import (
9
+ TYPE_CHECKING,
10
+ )
9
11
 
10
12
  from botocore.exceptions import ClientError
11
13
  from pydantic import BaseModel
12
14
 
13
15
  from reconcile import queries
14
- from reconcile.queries import get_aws_accounts
16
+ from reconcile.gql_definitions.aws_cloudwatch_log_retention.aws_accounts import (
17
+ AWSAccountCleanupOptionCloudWatchV1,
18
+ AWSAccountV1,
19
+ )
20
+ from reconcile.typed_queries.aws_cloudwatch_log_retention.aws_accounts import (
21
+ get_aws_accounts,
22
+ )
23
+ from reconcile.utils import gql
15
24
  from reconcile.utils.aws_api import AWSApi
16
25
 
17
26
  if TYPE_CHECKING:
@@ -39,31 +48,33 @@ DEFAULT_AWS_CLOUDWATCH_CLEANUP_OPTION = AWSCloudwatchCleanupOption(
39
48
 
40
49
 
41
50
  def get_desired_cleanup_options_by_region(
42
- account: dict,
51
+ account: AWSAccountV1,
43
52
  ) -> dict[str, list[AWSCloudwatchCleanupOption]]:
44
- default_region = account["resourcesDefaultRegion"]
53
+ default_region = account.resources_default_region
45
54
  result = defaultdict(list)
46
- if cleanup := account.get("cleanup"):
47
- for cleanup_option in cleanup:
48
- if cleanup_option["provider"] == "cloudwatch":
49
- region = cleanup_option.get("region") or default_region
50
- result[region].append(
51
- AWSCloudwatchCleanupOption(
52
- regex=re.compile(cleanup_option["regex"]),
53
- retention_in_days=cleanup_option["retention_in_days"],
54
- delete_empty_log_group=bool(
55
- cleanup_option["delete_empty_log_group"]
56
- ),
57
- )
55
+ for cleanup_option in account.cleanup or []:
56
+ if isinstance(cleanup_option, AWSAccountCleanupOptionCloudWatchV1):
57
+ region = cleanup_option.region or default_region
58
+ result[region].append(
59
+ AWSCloudwatchCleanupOption(
60
+ regex=re.compile(cleanup_option.regex),
61
+ retention_in_days=cleanup_option.retention_in_days,
62
+ delete_empty_log_group=bool(cleanup_option.delete_empty_log_group),
58
63
  )
64
+ )
59
65
  if not result:
60
66
  result[default_region].append(DEFAULT_AWS_CLOUDWATCH_CLEANUP_OPTION)
61
67
  return result
62
68
 
63
69
 
64
- def create_awsapi_client(accounts: list, thread_pool_size: int) -> AWSApi:
70
+ def create_awsapi_client(accounts: list[AWSAccountV1], thread_pool_size: int) -> AWSApi:
65
71
  settings = queries.get_secret_reader_settings()
66
- return AWSApi(thread_pool_size, accounts, settings=settings, init_users=False)
72
+ return AWSApi(
73
+ thread_pool_size,
74
+ [account.dict(by_alias=True) for account in accounts],
75
+ settings=settings,
76
+ init_users=False,
77
+ )
67
78
 
68
79
 
69
80
  def is_empty(log_group: LogGroupTypeDef) -> bool:
@@ -192,10 +203,10 @@ def _find_desired_cleanup_option(
192
203
 
193
204
  def _reconcile_log_groups(
194
205
  dry_run: bool,
195
- aws_account: dict,
206
+ aws_account: AWSAccountV1,
196
207
  awsapi: AWSApi,
197
208
  ) -> None:
198
- account_name = aws_account["name"]
209
+ account_name = aws_account.name
199
210
  desired_cleanup_options_by_region = get_desired_cleanup_options_by_region(
200
211
  aws_account
201
212
  )
@@ -230,12 +241,15 @@ def _reconcile_log_groups(
230
241
  )
231
242
 
232
243
 
233
- def get_active_aws_accounts() -> list[dict]:
244
+ def get_active_aws_accounts() -> list[AWSAccountV1]:
234
245
  return [
235
- a
236
- for a in get_aws_accounts(cleanup=True)
237
- if "aws-cloudwatch-log-retention"
238
- not in (a.get("disable") or {}).get("integrations", [])
246
+ account
247
+ for account in get_aws_accounts(gql.get_api())
248
+ if not (
249
+ account.disable
250
+ and account.disable.integrations
251
+ and "aws-cloudwatch-log-retention" in account.disable.integrations
252
+ )
239
253
  ]
240
254
 
241
255
 
@@ -0,0 +1,158 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v1. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ Extra,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+
21
+ DEFINITION = """
22
+ query AWSAccountsCloudwatchLogRetentionCleanup {
23
+ accounts: awsaccounts_v1
24
+ {
25
+ path
26
+ name
27
+ uid
28
+ terraformUsername
29
+ consoleUrl
30
+ resourcesDefaultRegion
31
+ supportedDeploymentRegions
32
+ providerVersion
33
+ accountOwners {
34
+ name
35
+ email
36
+ }
37
+ automationToken {
38
+ path
39
+ field
40
+ version
41
+ format
42
+ }
43
+ garbageCollection
44
+ enableDeletion
45
+ deletionApprovals {
46
+ type
47
+ name
48
+ expiration
49
+ }
50
+ disable {
51
+ integrations
52
+ }
53
+ deleteKeys
54
+ premiumSupport
55
+ ecrs {
56
+ region
57
+ }
58
+ partition
59
+ cleanup {
60
+ provider
61
+ ... on AWSAccountCleanupOptionCloudWatch_v1 {
62
+ regex
63
+ retention_in_days
64
+ delete_empty_log_group
65
+ region
66
+ }
67
+ }
68
+ }
69
+ }
70
+ """
71
+
72
+
73
+ class ConfiguredBaseModel(BaseModel):
74
+ class Config:
75
+ smart_union=True
76
+ extra=Extra.forbid
77
+
78
+
79
+ class OwnerV1(ConfiguredBaseModel):
80
+ name: str = Field(..., alias="name")
81
+ email: str = Field(..., alias="email")
82
+
83
+
84
+ class VaultSecretV1(ConfiguredBaseModel):
85
+ path: str = Field(..., alias="path")
86
+ field: str = Field(..., alias="field")
87
+ version: Optional[int] = Field(..., alias="version")
88
+ q_format: Optional[str] = Field(..., alias="format")
89
+
90
+
91
+ class DeletionApprovalV1(ConfiguredBaseModel):
92
+ q_type: str = Field(..., alias="type")
93
+ name: str = Field(..., alias="name")
94
+ expiration: str = Field(..., alias="expiration")
95
+
96
+
97
+ class DisableClusterAutomationsV1(ConfiguredBaseModel):
98
+ integrations: Optional[list[str]] = Field(..., alias="integrations")
99
+
100
+
101
+ class AWSECRV1(ConfiguredBaseModel):
102
+ region: str = Field(..., alias="region")
103
+
104
+
105
+ class AWSAccountCleanupOptionV1(ConfiguredBaseModel):
106
+ provider: str = Field(..., alias="provider")
107
+
108
+
109
+ class AWSAccountCleanupOptionCloudWatchV1(AWSAccountCleanupOptionV1):
110
+ regex: str = Field(..., alias="regex")
111
+ retention_in_days: int = Field(..., alias="retention_in_days")
112
+ delete_empty_log_group: Optional[bool] = Field(..., alias="delete_empty_log_group")
113
+ region: Optional[str] = Field(..., alias="region")
114
+
115
+
116
+ class AWSAccountV1(ConfiguredBaseModel):
117
+ path: str = Field(..., alias="path")
118
+ name: str = Field(..., alias="name")
119
+ uid: str = Field(..., alias="uid")
120
+ terraform_username: Optional[str] = Field(..., alias="terraformUsername")
121
+ console_url: str = Field(..., alias="consoleUrl")
122
+ resources_default_region: str = Field(..., alias="resourcesDefaultRegion")
123
+ supported_deployment_regions: Optional[list[str]] = Field(..., alias="supportedDeploymentRegions")
124
+ provider_version: str = Field(..., alias="providerVersion")
125
+ account_owners: list[OwnerV1] = Field(..., alias="accountOwners")
126
+ automation_token: VaultSecretV1 = Field(..., alias="automationToken")
127
+ garbage_collection: Optional[bool] = Field(..., alias="garbageCollection")
128
+ enable_deletion: Optional[bool] = Field(..., alias="enableDeletion")
129
+ deletion_approvals: Optional[list[DeletionApprovalV1]] = Field(..., alias="deletionApprovals")
130
+ disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
131
+ delete_keys: Optional[list[str]] = Field(..., alias="deleteKeys")
132
+ premium_support: bool = Field(..., alias="premiumSupport")
133
+ ecrs: Optional[list[AWSECRV1]] = Field(..., alias="ecrs")
134
+ partition: Optional[str] = Field(..., alias="partition")
135
+ cleanup: Optional[list[Union[AWSAccountCleanupOptionCloudWatchV1, AWSAccountCleanupOptionV1]]] = Field(..., alias="cleanup")
136
+
137
+
138
+ class AWSAccountsCloudwatchLogRetentionCleanupQueryData(ConfiguredBaseModel):
139
+ accounts: Optional[list[AWSAccountV1]] = Field(..., alias="accounts")
140
+
141
+
142
+ def query(query_func: Callable, **kwargs: Any) -> AWSAccountsCloudwatchLogRetentionCleanupQueryData:
143
+ """
144
+ This is a convenience function which queries and parses the data into
145
+ concrete types. It should be compatible with most GQL clients.
146
+ You do not have to use it to consume the generated data classes.
147
+ Alternatively, you can also mime and alternate the behavior
148
+ of this function in the caller.
149
+
150
+ Parameters:
151
+ query_func (Callable): Function which queries your GQL Server
152
+ kwargs: optional arguments that will be passed to the query function
153
+
154
+ Returns:
155
+ AWSAccountsCloudwatchLogRetentionCleanupQueryData: queried data parsed into generated classes
156
+ """
157
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
158
+ return AWSAccountsCloudwatchLogRetentionCleanupQueryData(**raw_data)
@@ -251,6 +251,7 @@ query TerraformResourcesNamespaces {
251
251
  filter_pattern
252
252
  output_resource_name
253
253
  annotations
254
+ managed_by_erv2
254
255
  }
255
256
  ... on NamespaceTerraformResourceKMS_v1 {
256
257
  region
@@ -761,6 +762,7 @@ class NamespaceTerraformResourceCloudWatchV1(NamespaceTerraformResourceAWSV1):
761
762
  filter_pattern: Optional[str] = Field(..., alias="filter_pattern")
762
763
  output_resource_name: Optional[str] = Field(..., alias="output_resource_name")
763
764
  annotations: Optional[str] = Field(..., alias="annotations")
765
+ managed_by_erv2: Optional[bool] = Field(..., alias="managed_by_erv2")
764
766
 
765
767
 
766
768
  class NamespaceTerraformResourceKMSV1(NamespaceTerraformResourceAWSV1):
@@ -1055,7 +1057,7 @@ class NamespaceTerraformResourceMskV1(NamespaceTerraformResourceAWSV1):
1055
1057
 
1056
1058
 
1057
1059
  class NamespaceTerraformProviderResourceAWSV1(NamespaceExternalResourceV1):
1058
- resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1, NamespaceTerraformResourceKinesisV1, NamespaceTerraformResourceRoute53ZoneV1, NamespaceTerraformResourceSQSV1, NamespaceTerraformResourceDynamoDBV1, NamespaceTerraformResourceECRV1, NamespaceTerraformResourceS3CloudFrontPublicKeyV1, NamespaceTerraformResourceSecretsManagerV1, NamespaceTerraformResourceSecretsManagerServiceAccountV1, NamespaceTerraformResourceAWSV1]] = Field(..., alias="resources")
1060
+ resources: list[Union[NamespaceTerraformResourceRDSV1, NamespaceTerraformResourceALBV1, NamespaceTerraformResourceRosaAuthenticatorV1, NamespaceTerraformResourceRoleV1, NamespaceTerraformResourceS3V1, NamespaceTerraformResourceASGV1, NamespaceTerraformResourceElastiCacheV1, NamespaceTerraformResourceSNSTopicV1, NamespaceTerraformResourceCloudWatchV1, NamespaceTerraformResourceServiceAccountV1, NamespaceTerraformResourceS3SQSV1, NamespaceTerraformResourceKMSV1, NamespaceTerraformResourceRosaAuthenticatorVPCEV1, NamespaceTerraformResourceMskV1, NamespaceTerraformResourceS3CloudFrontV1, NamespaceTerraformResourceElasticSearchV1, NamespaceTerraformResourceACMV1, NamespaceTerraformResourceKinesisV1, NamespaceTerraformResourceRoute53ZoneV1, NamespaceTerraformResourceSQSV1, NamespaceTerraformResourceDynamoDBV1, NamespaceTerraformResourceECRV1, NamespaceTerraformResourceS3CloudFrontPublicKeyV1, NamespaceTerraformResourceSecretsManagerV1, NamespaceTerraformResourceSecretsManagerServiceAccountV1, NamespaceTerraformResourceAWSV1]] = Field(..., alias="resources")
1059
1061
 
1060
1062
 
1061
1063
  class EnvironmentV1(ConfiguredBaseModel):
@@ -0,0 +1,12 @@
1
+ from reconcile.gql_definitions.aws_cloudwatch_log_retention.aws_accounts import (
2
+ AWSAccountV1,
3
+ query,
4
+ )
5
+ from reconcile.utils.gql import GqlApi
6
+
7
+
8
+ def get_aws_accounts(
9
+ gql_api: GqlApi,
10
+ ) -> list[AWSAccountV1]:
11
+ data = query(query_func=gql_api.query)
12
+ return data.accounts or []