Skip to content

Commit 12878a1

Browse files
authored
[aws][fix] Add missing resource docs (#2227)
1 parent 73218b4 commit 12878a1

File tree

7 files changed

+59
-70
lines changed

7 files changed

+59
-70
lines changed

plugins/aws/fix_plugin_aws/collector.py

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
from collections import defaultdict
33
from concurrent.futures import Future, ThreadPoolExecutor
44
from datetime import datetime, timedelta, timezone
5-
from typing import Any, Dict, List, Type, Optional, ClassVar, Union, cast, Dict, Any
6-
7-
from attrs import define
5+
from typing import List, Type, Optional, Union, cast, Any
86

97
from fix_plugin_aws.access_edges import AccessEdgeCreator
108
from fix_plugin_aws.aws_client import AwsClient
@@ -51,8 +49,16 @@
5149
backup,
5250
bedrock,
5351
)
54-
from fix_plugin_aws.resource.base import AwsAccount, AwsApiSpec, AwsRegion, AwsResource, GraphBuilder
55-
from fixlib.baseresources import Cloud, EdgeType, BaseOrganizationalRoot, BaseOrganizationalUnit
52+
from fix_plugin_aws.resource.base import (
53+
AwsAccount,
54+
AwsApiSpec,
55+
AwsRegion,
56+
AwsResource,
57+
GraphBuilder,
58+
AwsOrganizationalRoot,
59+
AwsOrganizationalUnit,
60+
)
61+
from fixlib.baseresources import Cloud, EdgeType
5662
from fixlib.core.actions import CoreFeedback, ErrorAccumulator
5763
from fixlib.core.progress import ProgressDone, ProgressTree
5864
from fixlib.graph import Graph, BySearchCriteria, ByNodeId
@@ -463,23 +469,3 @@ def add_accounts(parent: Union[AwsOrganizationalRoot, AwsOrganizationalUnit]) ->
463469
create_org_graph()
464470
except Exception as e:
465471
log.exception(f"Error creating organization graph: {e}")
466-
467-
468-
@define(eq=False, slots=False)
469-
class AwsOrganizationalRoot(BaseOrganizationalRoot, AwsResource):
470-
kind: ClassVar[str] = "aws_organizational_root"
471-
_kind_display: ClassVar[str] = "AWS Organizational Root"
472-
_kind_description: ClassVar[str] = "AWS Organizational Root is the top-level entity in AWS Organizations. It serves as the starting point for creating and managing multiple AWS accounts within an organization. The root provides centralized control over billing, access management, and resource allocation across all member accounts, ensuring consistent policies and governance throughout the organizational structure." # fmt: skip
473-
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_root.html"
474-
_kind_service = "organizations"
475-
_metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "management"}
476-
477-
478-
@define(eq=False, slots=False)
479-
class AwsOrganizationalUnit(BaseOrganizationalUnit, AwsResource):
480-
kind: ClassVar[str] = "aws_organizational_unit"
481-
_kind_display: ClassVar[str] = "AWS Organizational Unit"
482-
_kind_description: ClassVar[str] = "An AWS Organizational Unit is a container for AWS Accounts."
483-
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html"
484-
_kind_service = "organizations"
485-
_metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "management"}

plugins/aws/fix_plugin_aws/resource/amazonq.py

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ def service_name(cls) -> str:
4848
class AwsQBusinessApplication(AmazonQTaggable, AwsResource):
4949
kind: ClassVar[str] = "aws_q_business_application"
5050
_kind_display: ClassVar[str] = "AWS Q Business Application"
51-
_kind_description: ClassVar[str] = (
52-
"Represents a Q Business application within the AWS Q Business service. Applications"
53-
" define a set of tasks and configuration for processing data within the Q Business ecosystem."
54-
)
51+
_kind_description: ClassVar[str] = "An AWS Q Business Application is a specialized AI assistant tailored for specific business functions or roles. It integrates with an organization's data sources and systems to provide contextual responses and perform tasks within a particular domain. Q Business Applications support users in accessing information, solving problems, and completing work activities relevant to their operational area." # fmt: skip
52+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-app.html"
5553
_kind_service: ClassVar[Optional[str]] = service_name
5654
_metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "ai"}
5755
_aws_metadata: ClassVar[Dict[str, Any]] = {
@@ -314,10 +312,8 @@ def collect_index_resources(
314312
class AwsQBusinessConversation(AwsResource):
315313
kind: ClassVar[str] = "aws_q_business_conversation"
316314
_kind_display: ClassVar[str] = "AWS Q Business Conversation"
317-
_kind_description: ClassVar[str] = (
318-
"Represents a conversation within the AWS Q Business service. Conversations are"
319-
" interactions that involve a series of messages or data exchanges."
320-
)
315+
_kind_description: ClassVar[str] = "An AWS Q Business Conversation is an interaction between a user and an AWS Q Business Application. It involves a series of exchanges where the user asks questions, requests information, or issues commands, and the AI assistant responds with relevant answers, performs tasks, or provides guidance. These conversations are context-aware and draw upon the organization's connected data sources and systems." # fmt: skip
316+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/amazonq/latest/api-reference/API_Conversation.html"
321317
_kind_service: ClassVar[Optional[str]] = service_name
322318
_metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"}
323319
# Collected via AwsQBusinessApplication()
@@ -348,10 +344,8 @@ def service_name(cls) -> str:
348344
class AwsQBusinessDataSource(AmazonQTaggable, AwsResource):
349345
kind: ClassVar[str] = "aws_q_business_data_source"
350346
_kind_display: ClassVar[str] = "AWS Q Business Data Source"
351-
_kind_description: ClassVar[str] = (
352-
"Represents a data source in the AWS Q Business service. Data sources are the origins"
353-
" from which data is ingested for processing or analysis within the Q Business framework."
354-
)
347+
_kind_description: ClassVar[str] = "An AWS Q Business Data Source is a repository of information connected to AWS Q Business Applications. It includes various types of business data, such as documents, databases, or APIs, that the AI assistant accesses to provide accurate and contextual responses. These data sources form the knowledge base that Q Business Applications use to answer queries and perform tasks within specific business domains." # fmt: skip
348+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/data-sources.html"
355349
_kind_service: ClassVar[Optional[str]] = service_name
356350
_metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "ai"}
357351
# Collected via AwsQBusinessApplication()
@@ -438,9 +432,9 @@ class AwsQBusinessDataSourceSyncJobMetrics:
438432
class AwsQBusinessDataSourceSyncJob(AwsResource):
439433
kind: ClassVar[str] = "aws_q_business_data_source_sync_job"
440434
_kind_display: ClassVar[str] = "AWS Q Business Data Source Sync Job"
441-
_kind_description: ClassVar[str] = (
442-
"Represents a data source synchronization job in the AWS Q Business service. Sync jobs"
443-
" ensure that data from data sources is up-to-date and correctly integrated into the system."
435+
_kind_description: ClassVar[str] = "An AWS Q Business Data Source Sync Job is a process that updates and synchronizes data between external sources and AWS Q Business Applications. It retrieves new or modified information from connected data repositories, processes it, and integrates it into the AI assistant's knowledge base. This job ensures that Q Business Applications have access to the most current and relevant data for responding to user queries." # fmt: skip
436+
_docs_url: ClassVar[str] = (
437+
"https://docs.aws.amazon.com/amazonq/latest/api-reference/API_StartDataSourceSyncJob.html"
444438
)
445439
_kind_service: ClassVar[Optional[str]] = service_name
446440
_metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "ai"}
@@ -518,10 +512,7 @@ def service_name(cls) -> str:
518512
class AwsQBusinessIndice(AmazonQTaggable, AwsResource):
519513
kind: ClassVar[str] = "aws_q_business_indice"
520514
_kind_display: ClassVar[str] = "AWS Q Business Indice"
521-
_kind_description: ClassVar[str] = (
522-
"Represents an index in the AWS Q Business service. Indices are used to organize and"
523-
" facilitate efficient searching and retrieval of data within the Q Business framework."
524-
)
515+
_kind_description: ClassVar[str] = "An AWS Q Business Indice is a structured collection of data used by AWS Q Business Applications. It organizes and indexes information from various data sources, optimizing it for quick retrieval and analysis. This indice supports efficient searching, filtering, and querying of business data, enhancing the AI assistant's ability to provide accurate and timely responses to user inquiries within specific business contexts." # fmt: skip
525516
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/qs/latest/userguide/business-indices-qs.html"
526517
_kind_service: ClassVar[Optional[str]] = service_name
527518
_metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "ai"}
@@ -806,7 +797,7 @@ def delete_resource(self, client: AwsClient, graph: Graph) -> bool:
806797
class AwsQBusinessRetriever(AmazonQTaggable, AwsResource):
807798
kind: ClassVar[str] = "aws_q_business_retriever"
808799
_kind_display: ClassVar[str] = "AWS Q Business Retriever"
809-
_kind_description: ClassVar[str] = "" # fmt: skip
800+
_kind_description: ClassVar[str] = "AWS Q Business Retriever is a machine learning model for information retrieval in enterprise settings. It processes and indexes business data from various sources, then responds to user queries with relevant information and documents. The model understands context and intent, providing accurate search results and summaries to help users find and utilize business information efficiently." # fmt: skip
810801
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/bedrock/latest/userguide/retriever.html"
811802
_kind_service: ClassVar[Optional[str]] = service_name
812803
_metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "ai"}
@@ -927,10 +918,8 @@ class AwsQAppsCategory:
927918
class AwsQAppsLibraryItem(AwsResource):
928919
kind: ClassVar[str] = "aws_q_apps_library_item"
929920
_kind_display: ClassVar[str] = "AWS QApps Library Item"
930-
_kind_description: ClassVar[str] = (
931-
"Represents a library item in the AWS QApps service. Library items include resources"
932-
" such as scripts, templates, or other components that can be used in QApps applications."
933-
)
921+
_kind_description: ClassVar[str] = "An AWS Q Apps Library Item is a component within the AWS Q Apps ecosystem that represents a specific resource or functionality. It can be a pre-built template, module, or configuration element used to construct or enhance Q Apps. These items are stored in a centralized library, facilitating reuse and standardization across different Q Apps within an organization." # fmt: skip
922+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/amazonq/latest/api-reference/API_qapps_GetLibraryItem.html"
934923
_kind_service: ClassVar[Optional[str]] = service_name
935924
_metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "ai"}
936925
# Collected via AwsQBusinessApplication()
@@ -1008,10 +997,8 @@ def service_name(cls) -> str:
1008997
class AwsQApps(AwsResource):
1009998
kind: ClassVar[str] = "aws_q_apps"
1010999
_kind_display: ClassVar[str] = "AWS QApps"
1011-
_kind_description: ClassVar[str] = (
1012-
"Represents an application within the AWS QApps service. QApps applications include"
1013-
" various components and configurations for developing and deploying apps within the AWS environment."
1014-
)
1000+
_kind_description: ClassVar[str] = "AWS Q Apps are purpose-built AI assistants tailored for specific business functions or roles. They integrate with an organization's data and systems to provide contextual responses and perform tasks. Q Apps offer personalized support for various domains such as IT, finance, and sales, helping users access information, solve problems, and complete work-related activities within their operational context." # fmt: skip
1001+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/amazonq/"
10151002
_kind_service: ClassVar[Optional[str]] = service_name
10161003
_metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "ai"}
10171004
# Collected via AwsQBusinessApplication()

plugins/aws/fix_plugin_aws/resource/base.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
EdgeType,
3030
ModelReference,
3131
PhantomBaseResource,
32+
BaseOrganizationalRoot,
33+
BaseOrganizationalUnit,
3234
)
3335
from fixlib.config import Config, current_config
3436
from fixlib.core.actions import CoreFeedback, SuppressWithFeedback
@@ -119,7 +121,9 @@ class AwsResource(BaseResource, ABC):
119121
# The display name of the kind.
120122
_kind_display: ClassVar[str] = "AWS Resource"
121123
# The description of the kind.
122-
_kind_description: ClassVar[str] = "AWS Resource is a generic term used to refer to any type of resource available in Amazon Web Services cloud." # fmt: skip
124+
_kind_description: ClassVar[str] = "An AWS Resource is a component within Amazon Web Services (AWS) that represents a specific entity or service in the cloud. It can be an instance, database, storage bucket, network interface, or other element. AWS Resources are created, managed, and monitored through the AWS Management Console, APIs, or command-line tools." # fmt: skip
125+
# The URL to the documentation of this kind.
126+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/"
123127
# AWS specific metadata that hold template strings for ARN and provider link.
124128
_aws_metadata: ClassVar[Dict[str, Any]] = {}
125129
# The mapping to transform the incoming API json into the internal representation.
@@ -315,11 +319,7 @@ class AwsAccount(BaseAccount, AwsResource, BaseIamPrincipal):
315319
class AwsRegion(BaseRegion, AwsResource):
316320
kind: ClassVar[str] = "aws_region"
317321
_kind_display: ClassVar[str] = "AWS Region"
318-
_kind_description: ClassVar[str] = (
319-
"An AWS Region is a physical location where AWS has multiple data centers,"
320-
" allowing users to choose the geographic area in which their resources are"
321-
" located."
322-
)
322+
_kind_description: ClassVar[str] = "An AWS Region is a geographic area containing multiple data centers called Availability Zones. It provides a distinct set of AWS services and infrastructure. Regions are isolated from each other, enhancing fault tolerance and stability. Users can deploy resources in different Regions to reduce latency and meet data residency requirements." # fmt: skip
323323
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/general/latest/gr/rande.html"
324324
_reference_kinds: ClassVar[ModelReference] = {
325325
"successors": {
@@ -417,6 +417,26 @@ class AwsEc2VolumeType(AwsResource, BaseVolumeType):
417417
_aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip
418418

419419

420+
@define(eq=False, slots=False)
421+
class AwsOrganizationalRoot(BaseOrganizationalRoot, AwsResource):
422+
kind: ClassVar[str] = "aws_organizational_root"
423+
_kind_display: ClassVar[str] = "AWS Organizational Root"
424+
_kind_description: ClassVar[str] = "AWS Organizational Root is the top-level entity in AWS Organizations. It serves as the starting point for creating and managing multiple AWS accounts within an organization. The root provides centralized control over billing, access management, and resource allocation across all member accounts, ensuring consistent policies and governance throughout the organizational structure." # fmt: skip
425+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_root.html"
426+
_kind_service = "organizations"
427+
_metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "management"}
428+
429+
430+
@define(eq=False, slots=False)
431+
class AwsOrganizationalUnit(BaseOrganizationalUnit, AwsResource):
432+
kind: ClassVar[str] = "aws_organizational_unit"
433+
_kind_display: ClassVar[str] = "AWS Organizational Unit"
434+
_kind_description: ClassVar[str] = "AWS Organizational Unit is a container for AWS accounts within an organization. It groups accounts for management purposes and applies policies across multiple accounts. Organizational Units can be nested to create hierarchies, facilitating centralized control over permissions, compliance, and resource access. This structure supports governance and organizational alignment in complex AWS environments." # fmt: skip
435+
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html"
436+
_kind_service = "organizations"
437+
_metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "management"}
438+
439+
420440
class GraphBuilder:
421441
def __init__(
422442
self,

plugins/aws/fix_plugin_aws/resource/iam.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class AwsIamServerCertificate(AwsResource, BaseCertificate):
219219
kind: ClassVar[str] = "aws_iam_server_certificate"
220220
_kind_display: ClassVar[str] = "AWS IAM Server Certificate"
221221
_aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam:{region}:{account}:server-certificate/{name}"} # fmt: skip
222-
_kind_description: ClassVar[str] = "" # fmt: skip
222+
_kind_description: ClassVar[str] = "AWS IAM Server Certificate is a digital credential used to secure network communications for AWS services and applications. It authenticates the identity of servers and encrypts data transmitted between clients and servers. IAM Server Certificates can be managed, rotated, and deployed across multiple AWS regions to establish secure HTTPS connections for websites and applications." # fmt: skip
223223
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html"
224224
_kind_service: ClassVar[Optional[str]] = service_name
225225
api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(
@@ -618,10 +618,7 @@ class AwsRootUser(AwsResource, BaseUser, BaseIamPrincipal):
618618
kind: ClassVar[str] = "aws_root_user"
619619
_kind_display: ClassVar[str] = "AWS Root User"
620620
_aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:None:{region}:{account}:resource/{id}"} # fmt: skip
621-
_kind_description: ClassVar[str] = (
622-
"The AWS Root User is the initial user created when setting up an AWS account"
623-
" and has unrestricted access to all resources in the account."
624-
)
621+
_kind_description: ClassVar[str] = "The AWS Root User is the primary account holder for an Amazon Web Services (AWS) account. It has full access to all AWS services and resources within the account. The Root User can create and manage other users, assign permissions, and make billing changes. It should be used sparingly for security reasons." # fmt: skip
625622
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html"
626623
_kind_service: ClassVar[Optional[str]] = service_name
627624
_reference_kinds: ClassVar[ModelReference] = {
@@ -640,7 +637,7 @@ class AwsIamUser(AwsResource, BaseUser, BaseIamPrincipal):
640637
kind: ClassVar[str] = "aws_iam_user"
641638
_kind_display: ClassVar[str] = "AWS IAM User"
642639
_aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iam/home?region={region}#/users/details/{name}", "arn_tpl": "arn:{partition}:iam::{account}:user/{name}"} # fmt: skip
643-
_kind_description: ClassVar[str] = "" # fmt: skip
640+
_kind_description: ClassVar[str] = "AWS IAM User is an identity within Amazon Web Services that represents a person or application. It has associated credentials and permissions that determine its access to AWS services and resources. IAM Users can be assigned to groups, given specific policies, and authenticated using passwords or access keys for programmatic access to AWS." # fmt: skip
644641
_docs_url: ClassVar[str] = "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html"
645642
_kind_service: ClassVar[Optional[str]] = service_name
646643
api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "get-account-authorization-details")

0 commit comments

Comments
 (0)