From 66cbd9e3877a78e23725abb19a302bade560b729 Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Fri, 13 Sep 2024 13:59:00 +0200 Subject: [PATCH] [plugins][feat] Proper name, icon and group for AWS, Azure and GCP (#2188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lukas Lösche Co-authored-by: Lukas Lösche --- fixlib/fixlib/baseresources.py | 1 + fixlib/fixlib/core/model_export.py | 2 + plugins/aws/fix_plugin_aws/collector.py | 6 +- plugins/aws/fix_plugin_aws/resource/acm.py | 1 + .../aws/fix_plugin_aws/resource/amazonq.py | 28 ++- .../aws/fix_plugin_aws/resource/apigateway.py | 25 +- plugins/aws/fix_plugin_aws/resource/athena.py | 9 +- .../fix_plugin_aws/resource/autoscaling.py | 2 +- plugins/aws/fix_plugin_aws/resource/backup.py | 54 ++-- plugins/aws/fix_plugin_aws/resource/base.py | 4 +- .../fix_plugin_aws/resource/cloudformation.py | 9 +- .../aws/fix_plugin_aws/resource/cloudfront.py | 41 ++- .../aws/fix_plugin_aws/resource/cloudtrail.py | 4 +- .../aws/fix_plugin_aws/resource/cloudwatch.py | 12 +- .../aws/fix_plugin_aws/resource/cognito.py | 9 +- plugins/aws/fix_plugin_aws/resource/config.py | 4 +- .../aws/fix_plugin_aws/resource/dynamodb.py | 8 +- plugins/aws/fix_plugin_aws/resource/ec2.py | 54 +++- plugins/aws/fix_plugin_aws/resource/ecr.py | 2 + plugins/aws/fix_plugin_aws/resource/ecs.py | 25 +- plugins/aws/fix_plugin_aws/resource/efs.py | 9 +- plugins/aws/fix_plugin_aws/resource/eks.py | 8 +- .../fix_plugin_aws/resource/elasticache.py | 8 +- .../resource/elasticbeanstalk.py | 8 +- plugins/aws/fix_plugin_aws/resource/elb.py | 4 +- plugins/aws/fix_plugin_aws/resource/elbv2.py | 7 +- .../aws/fix_plugin_aws/resource/glacier.py | 8 +- plugins/aws/fix_plugin_aws/resource/iam.py | 11 +- .../aws/fix_plugin_aws/resource/kinesis.py | 5 +- plugins/aws/fix_plugin_aws/resource/kms.py | 4 +- .../aws/fix_plugin_aws/resource/lambda_.py | 1 + .../aws/fix_plugin_aws/resource/opensearch.py | 2 + plugins/aws/fix_plugin_aws/resource/rds.py | 11 +- .../aws/fix_plugin_aws/resource/redshift.py | 4 +- .../aws/fix_plugin_aws/resource/route53.py | 18 +- plugins/aws/fix_plugin_aws/resource/s3.py | 6 +- .../aws/fix_plugin_aws/resource/sagemaker.py | 87 +++++-- .../fix_plugin_aws/resource/secretsmanager.py | 2 + .../fix_plugin_aws/resource/service_quotas.py | 1 + plugins/aws/fix_plugin_aws/resource/sns.py | 16 +- plugins/aws/fix_plugin_aws/resource/sqs.py | 4 +- plugins/aws/fix_plugin_aws/resource/ssm.py | 6 + plugins/aws/fix_plugin_aws/resource/waf.py | 2 + .../resource/authorization.py | 22 +- .../azure/fix_plugin_azure/resource/base.py | 9 + .../fix_plugin_azure/resource/compute.py | 56 +++++ .../resource/containerservice.py | 15 +- .../fix_plugin_azure/resource/cosmosdb.py | 119 ++++++++- .../fix_plugin_azure/resource/keyvault.py | 14 +- .../resource/machinelearning.py | 123 +++++++++ .../resource/microsoft_graph.py | 8 + .../fix_plugin_azure/resource/monitor.py | 35 ++- .../azure/fix_plugin_azure/resource/mysql.py | 27 ++ .../fix_plugin_azure/resource/network.py | 149 ++++++++++- .../fix_plugin_azure/resource/postgresql.py | 23 +- .../fix_plugin_azure/resource/security.py | 27 +- .../fix_plugin_azure/resource/sql_server.py | 53 ++++ .../fix_plugin_azure/resource/storage.py | 26 +- .../azure/fix_plugin_azure/resource/web.py | 26 +- plugins/gcp/fix_plugin_gcp/resources/base.py | 2 + .../gcp/fix_plugin_gcp/resources/billing.py | 17 +- .../gcp/fix_plugin_gcp/resources/compute.py | 235 +++++++++++++----- .../gcp/fix_plugin_gcp/resources/container.py | 12 +- .../gcp/fix_plugin_gcp/resources/sqladmin.py | 21 +- .../gcp/fix_plugin_gcp/resources/storage.py | 8 +- plugins/k8s/fix_plugin_k8s/base.py | 1 + 66 files changed, 1327 insertions(+), 233 deletions(-) diff --git a/fixlib/fixlib/baseresources.py b/fixlib/fixlib/baseresources.py index a1e1d7b4f0..7d888d1e4f 100644 --- a/fixlib/fixlib/baseresources.py +++ b/fixlib/fixlib/baseresources.py @@ -267,6 +267,7 @@ class BaseResource(ABC): kind: ClassVar[str] = "resource" kind_display: ClassVar[str] = "Resource" kind_description: ClassVar[str] = "A generic resource." + kind_service: ClassVar[Optional[str]] = None phantom: ClassVar[bool] = False reference_kinds: ClassVar[ModelReference] = {} metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"} diff --git a/fixlib/fixlib/core/model_export.py b/fixlib/fixlib/core/model_export.py index 7044df5b87..e10f3aa4e4 100644 --- a/fixlib/fixlib/core/model_export.py +++ b/fixlib/fixlib/core/model_export.py @@ -249,6 +249,8 @@ def export_data_class(clazz: type) -> None: metadata = m.copy() if (s := clazz.__dict__.get("kind_display", None)) and isinstance(s, str): metadata["name"] = s + if (s := getattr(clazz, "kind_service", None)) and isinstance(s, str): + metadata["service"] = s if with_description and (s := clazz.__dict__.get("kind_description", None)) and isinstance(s, str): metadata["description"] = s diff --git a/plugins/aws/fix_plugin_aws/collector.py b/plugins/aws/fix_plugin_aws/collector.py index 4256c5d30d..395fcfd58a 100644 --- a/plugins/aws/fix_plugin_aws/collector.py +++ b/plugins/aws/fix_plugin_aws/collector.py @@ -2,7 +2,7 @@ import logging from concurrent.futures import Future, ThreadPoolExecutor from datetime import datetime, timedelta, timezone -from typing import List, Type, Optional, ClassVar, Union, cast +from typing import List, Type, Optional, ClassVar, Union, cast, Dict, Any from attrs import define @@ -432,6 +432,8 @@ class AwsOrganizationalRoot(BaseOrganizationalRoot, AwsResource): kind: ClassVar[str] = "aws_organizational_root" kind_display: ClassVar[str] = "AWS Organizational Root" kind_description: ClassVar[str] = "An AWS Organizational Root is the root of an AWS Organization." + kind_service = "organizations" + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} @define(eq=False, slots=False) @@ -439,3 +441,5 @@ class AwsOrganizationalUnit(BaseOrganizationalUnit, AwsResource): kind: ClassVar[str] = "aws_organizational_unit" kind_display: ClassVar[str] = "AWS Organizational Unit" kind_description: ClassVar[str] = "An AWS Organizational Unit is a container for AWS Accounts." + kind_service = "organizations" + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} diff --git a/plugins/aws/fix_plugin_aws/resource/acm.py b/plugins/aws/fix_plugin_aws/resource/acm.py index d1ee1e2b54..0575cbd0de 100644 --- a/plugins/aws/fix_plugin_aws/resource/acm.py +++ b/plugins/aws/fix_plugin_aws/resource/acm.py @@ -72,6 +72,7 @@ class AwsAcmCertificate(AwsResource, BaseCertificate): kind_display: ClassVar[str] = "AWS ACM Certificate" aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/acm/home?region={region}#/certificates/{id}", "arn_tpl": "arn:{partition}:acm:{region}:{account}:certificate/{id}"} # fmt: skip kind_description: ClassVar[str] = "An AWS ACM Certificate is used to provision, manage, and deploy Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates for secure web traffic on AWS services." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("acm", "describe-certificate", "Certificate") mapping: ClassVar[Dict[str, Bender]] = { "id": S("CertificateArn") >> F(AwsResource.id_from_arn), diff --git a/plugins/aws/fix_plugin_aws/resource/amazonq.py b/plugins/aws/fix_plugin_aws/resource/amazonq.py index 19e71a1fc4..901c606bdb 100644 --- a/plugins/aws/fix_plugin_aws/resource/amazonq.py +++ b/plugins/aws/fix_plugin_aws/resource/amazonq.py @@ -52,6 +52,8 @@ class AwsQBusinessApplication(AmazonQTaggable, AwsResource): "Represents a QBusiness application within the AWS QBusiness service. Applications" " define a set of tasks and configuration for processing data within the QBusiness ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "generative_ai"} aws_metadata: ClassVar[Dict[str, Any]] = { "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/amazonq/business/applications/{id}/details?region={region}", # fmt: skip "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{id}", @@ -316,6 +318,8 @@ class AwsQBusinessConversation(AwsResource): "Represents a conversation within the AWS QBusiness service. Conversations are" " interactions that involve a series of messages or data exchanges." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AwsQBusinessApplication() mapping: ClassVar[Dict[str, Bender]] = { "id": S("conversationId"), @@ -348,6 +352,8 @@ class AwsQBusinessDataSource(AmazonQTaggable, AwsResource): "Represents a data source in the AWS QBusiness service. Data sources are the origins" " from which data is ingested for processing or analysis within the QBusiness framework." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "generative_ai"} # Collected via AwsQBusinessApplication() aws_metadata: ClassVar[Dict[str, Any]] = { "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/amazonq/business/applications/{app_id}/indices/{indice_id}/datasources/{id}/details?region={region}", # fmt: skip @@ -436,6 +442,8 @@ class AwsQBusinessDataSourceSyncJob(AwsResource): "Represents a data source synchronization job in the AWS QBusiness service. Sync jobs" " ensure that data from data sources is up-to-date and correctly integrated into the system." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "generative_ai"} # Collected via AwsQBusinessApplication() mapping: ClassVar[Dict[str, Bender]] = { "id": S("executionId"), @@ -476,6 +484,8 @@ class AwsQBusinessDocument(AwsResource): "Represents a document within the AWS QBusiness service. Documents are structured pieces" " of information that can be used for various purposes within the QBusiness ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "generative_ai"} # Collected via AwsQBusinessApplication() mapping: ClassVar[Dict[str, Bender]] = { "id": S("documentId"), @@ -514,6 +524,8 @@ class AwsQBusinessIndice(AmazonQTaggable, AwsResource): "Represents an index in the AWS QBusiness service. Indices are used to organize and" " facilitate efficient searching and retrieval of data within the QBusiness framework." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "generative_ai"} aws_metadata: ClassVar[Dict[str, Any]] = { "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{application_id}/index/{id}", "extra_args": ["application_id"], @@ -693,6 +705,8 @@ class AwsQBusinessMessage(AwsResource): "Represents a message within the AWS QBusiness service. Messages are used for communication" " or data exchange between various components or users within the QBusiness ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "generative_ai"} # Collected via AwsQBusinessApplication() mapping: ClassVar[Dict[str, Bender]] = { "id": S("messageId"), @@ -735,6 +749,8 @@ class AwsQBusinessPlugin(AmazonQTaggable, AwsResource): "Represents a plugin in the AWS QBusiness service. Plugins extend the functionality of" " the QBusiness framework by adding new features or capabilities." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} aws_metadata: ClassVar[Dict[str, Any]] = { "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{application_id}/plugin/{id}", "extra_args": ["application_id"], @@ -794,11 +810,13 @@ def delete_resource(self, client: AwsClient, graph: Graph) -> bool: @define(eq=False, slots=False) class AwsQBusinessRetriever(AmazonQTaggable, AwsResource): kind: ClassVar[str] = "aws_q_business_retriever" - kind_display: ClassVar[str] = "AWS QBusiness Retriever" + kind_display: ClassVar[str] = "AWS Q Business Retriever" kind_description: ClassVar[str] = ( "Represents a retriever in the AWS QBusiness service. Retrievers are used to fetch and" " process data from various sources within the QBusiness ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "generative_ai"} aws_metadata: ClassVar[Dict[str, Any]] = { "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{application_id}/retriever/{id}", "extra_args": ["application_id"], @@ -849,11 +867,13 @@ def delete_resource(self, client: AwsClient, graph: Graph) -> bool: @define(eq=False, slots=False) class AwsQBusinessWebExperience(AmazonQTaggable, AwsResource): kind: ClassVar[str] = "aws_q_business_web_experience" - kind_display: ClassVar[str] = "AWS QBusiness Web Experience" + kind_display: ClassVar[str] = "AWS Q Business Web Experience" kind_description: ClassVar[str] = ( "Represents a web experience in the AWS QBusiness service. Web experiences define" " interactive web-based applications or interfaces within the QBusiness ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "generative_ai"} aws_metadata: ClassVar[Dict[str, Any]] = { "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{application_id}/web-experience/{id}", "extra_args": ["application_id"], @@ -920,6 +940,8 @@ class AwsQAppsLibraryItem(AwsResource): "Represents a library item in the AWS QApps service. Library items include resources" " such as scripts, templates, or other components that can be used in QApps applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "generative_ai"} # Collected via AwsQBusinessApplication() reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_q_apps"]}, @@ -999,6 +1021,8 @@ class AwsQApps(AwsResource): "Represents an application within the AWS QApps service. QApps applications include" " various components and configurations for developing and deploying apps within the AWS environment." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "generative_ai"} # Collected via AwsQBusinessApplication() mapping: ClassVar[Dict[str, Bender]] = { "id": S("appId"), diff --git a/plugins/aws/fix_plugin_aws/resource/apigateway.py b/plugins/aws/fix_plugin_aws/resource/apigateway.py index 5f6c310a39..c55708dfa5 100644 --- a/plugins/aws/fix_plugin_aws/resource/apigateway.py +++ b/plugins/aws/fix_plugin_aws/resource/apigateway.py @@ -183,12 +183,14 @@ class AwsApiGatewayMethod: class AwsApiGatewayResource(AwsResource): # collection of resource resources happens in AwsApiGatewayRestApi.collect() kind: ClassVar[str] = "aws_apigateway_resource" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS API Gateway Resource" kind_description: ClassVar[str] = ( "API Gateway Resource is a logical unit used in API Gateway to represent a" " part of an API's resource hierarchy." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["aws_apigateway_authorizer"]}} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -247,13 +249,15 @@ def service_name(cls) -> str: class AwsApiGatewayAuthorizer(AwsResource): # collection of authorizer resources happens in AwsApiGatewayRestApi.collect() kind: ClassVar[str] = "aws_apigateway_authorizer" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{api_link}/authorizers/{id}?api={api_link}®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:authorizer/{name}/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS API Gateway Authorizer" kind_description: ClassVar[str] = ( "API Gateway Authorizers are mechanisms that help control access to APIs" " deployed on AWS API Gateway by authenticating and authorizing client" " requests." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{api_link}/authorizers/{id}?api={api_link}®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:authorizer/{name}/{id}"} # fmt: skip + metadata: ClassVar[Dict[str, Any]] = {"icon": "access_control", "group": "networking"} + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_lambda_function"]}, "predecessors": {"default": ["aws_iam_role"], "delete": ["aws_lambda_function", "aws_iam_role"]}, @@ -339,13 +343,14 @@ class AwsApiGatewayCanarySetting: class AwsApiGatewayStage(ApiGatewayTaggable, AwsResource): # collection of stage resources happens in AwsApiGatewayRestApi.collect() kind: ClassVar[str] = "aws_apigateway_stage" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{api_link}/stages?api={api_link}®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/stages/{name}"} # fmt: skip - kind_display: ClassVar[str] = "AWS API Gateway Stage" kind_description: ClassVar[str] = ( "API Gateway Stages are environment configurations for deploying and managing" " APIs in the AWS API Gateway service." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{api_link}/stages?api={api_link}®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/stages/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("syntheticId"), # created by Fix to avoid collision with duplicate stage names "name": S("stageName"), @@ -402,12 +407,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsApiGatewayDeployment(AwsResource): # collection of deployment resources happens in AwsApiGatewayRestApi.collect() kind: ClassVar[str] = "aws_apigateway_deployment" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/deployments/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS API Gateway Deployment" kind_description: ClassVar[str] = ( "API Gateway Deployments represents a deployment of an API to an API Gateway stage." " This allows the API to be invocable by end-users." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:/restapis/{id}/deployments/{name}"} # fmt: skip # edge to aws_apigateway_stage is established in AwsApiGatewayRestApi.collect() reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["aws_apigateway_stage"]}} @@ -463,11 +470,13 @@ class AwsApiGatewayEndpointConfiguration: class AwsApiGatewayRestApi(ApiGatewayTaggable, AwsResource): kind: ClassVar[str] = "aws_apigateway_rest_api" kind_display: ClassVar[str] = "AWS API Gateway REST API" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{id}/resources?api={id}&experience=rest®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:restapi/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "API Gateway is a fully managed service that makes it easy for developers to" " create, publish, and manage APIs at any scale." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/apis/{id}/resources?api={id}&experience=rest®ion={region}", "arn_tpl": "arn:{partition}:apigateway:{region}:{account}:restapi/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "get-rest-apis", "items", override_iam_permission="apigateway:GET" ) @@ -618,12 +627,14 @@ class AwsApiGatewayMutualTlsAuthentication: class AwsApiGatewayDomainName(ApiGatewayTaggable, AwsResource): kind: ClassVar[str] = "aws_apigateway_domain_name" kind_display: ClassVar[str] = "AWS API Gateway Domain Name" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/publish/domain-names?api=unselected&domain={name}&®ion={region}", "arn_tpl": "arn:aws:apigateway:{region}:{account}:domainname/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "API Gateway Domain Name is a custom domain name that you can associate with" " your API in Amazon API Gateway, allowing you to have a more branded and" " user-friendly endpoint for your API." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/apigateway/main/publish/domain-names?api=unselected&domain={name}&®ion={region}", "arn_tpl": "arn:aws:apigateway:{region}:{account}:domainname/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "get-domain-names", "items", override_iam_permission="apigateway:GET" ) diff --git a/plugins/aws/fix_plugin_aws/resource/athena.py b/plugins/aws/fix_plugin_aws/resource/athena.py index a635e7740d..31542e4ac6 100644 --- a/plugins/aws/fix_plugin_aws/resource/athena.py +++ b/plugins/aws/fix_plugin_aws/resource/athena.py @@ -92,13 +92,14 @@ class AwsAthenaWorkGroupConfiguration: class AwsAthenaWorkGroup(AwsResource): kind: ClassVar[str] = "aws_athena_work_group" kind_display: ClassVar[str] = "AWS Athena Work Group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/athena/home?region={region}#/workgroups/details/{name}", "arn_tpl": "arn:{partition}:athena:{region}:{account}:workgroup/{id}"} # fmt: skip - kind_description: ClassVar[str] = ( "Amazon Athena Work Groups are a resource type for isolating query execution and history among different" " users, teams, or applications within the same AWS account, with features for access control, cost" " management, and integration with AWS CloudWatch for metrics monitoring." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/athena/home?region={region}#/workgroups/details/{name}", "arn_tpl": "arn:{partition}:athena:{region}:{account}:workgroup/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-work-groups", "WorkGroups") mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), @@ -208,12 +209,14 @@ def delete_resource(self, client: AwsClient, graph: Graph) -> bool: class AwsAthenaDataCatalog(AwsResource): kind: ClassVar[str] = "aws_athena_data_catalog" kind_display: ClassVar[str] = "AWS Athena Data Catalog" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/athena/home?region={region}#datacatalog/detail/{name}", "arn_tpl": "arn:{partition}:athena:{region}:{account}:catalog/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Athena Data Catalog is a managed metadata repository in AWS that allows you" " to store and organize metadata about your data sources, such as databases," " tables, and partitions." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/athena/home?region={region}#datacatalog/detail/{name}", "arn_tpl": "arn:{partition}:athena:{region}:{account}:catalog/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-data-catalogs", "DataCatalogsSummary") mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), diff --git a/plugins/aws/fix_plugin_aws/resource/autoscaling.py b/plugins/aws/fix_plugin_aws/resource/autoscaling.py index 0bba0241d6..f0caaeeed3 100644 --- a/plugins/aws/fix_plugin_aws/resource/autoscaling.py +++ b/plugins/aws/fix_plugin_aws/resource/autoscaling.py @@ -278,12 +278,12 @@ class AwsAutoScalingGroup(AwsResource, BaseAutoScalingGroup): kind: ClassVar[str] = "aws_autoscaling_group" kind_display: ClassVar[str] = "AWS Autoscaling Group" aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/awsautoscaling/home?region={region}#dashboard/{name}", "arn_tpl": "arn:{partition}:autoscaling:{region}:{account}:autoscalinggroup/{name}"} # fmt: skip - kind_description: ClassVar[str] = ( "An AWS Autoscaling Group is a collection of Amazon EC2 instances that are" " treated as a logical grouping for the purpose of automatic scaling and" " management." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-auto-scaling-groups", "AutoScalingGroups") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_ec2_instance", "aws_ec2_launch_template"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/backup.py b/plugins/aws/fix_plugin_aws/resource/backup.py index b3e8f6c4b3..bd509a5441 100644 --- a/plugins/aws/fix_plugin_aws/resource/backup.py +++ b/plugins/aws/fix_plugin_aws/resource/backup.py @@ -68,11 +68,13 @@ class AwsBackupRecoveryPointCreator: class AwsBackupJob(AwsResource): kind: ClassVar[str] = "aws_backup_job" kind_display: ClassVar[str] = "AWS Backup Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Backup Jobs represent the individual backup tasks that are executed based on backup plans. " "They encompass the execution details and status of the backup process for a specified resource." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_plan", "aws_backup_vault"]}, "successors": {"default": ["aws_backup_protected_resource", "aws_backup_recovery_point"]}, @@ -148,12 +150,14 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AwsBackupProtectedResource(AwsResource): kind: ClassVar[str] = "aws_backup_protected_resource" - kind_display: ClassVar[str] = "AWS Backup Plan" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/resources/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Protected Resource" kind_description: ClassVar[str] = ( "AWS Backup Protected Resources represent the AWS resources that are configured to be backed up according to a backup plan. " "They include information about the resource type and identifiers." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/resources/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_vault", "aws_backup_recovery_point"]}, "successors": { @@ -225,11 +229,13 @@ class AwsBackupAdvancedBackupSetting: class AwsBackupPlan(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_plan" kind_display: ClassVar[str] = "AWS Backup Plan" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{id}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:backup-plan:{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Backup Plans define the schedule and rules for automatically backing up AWS resources. " "They include settings such as backup frequency, retention period, and lifecycle policies." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "plan", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{id}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:backup-plan:{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("backup", "list-backup-plans", "BackupPlansList") mapping: ClassVar[Dict[str, Bender]] = { "id": S("BackupPlanId"), @@ -305,11 +311,13 @@ def add_tags(backup_plan: AwsBackupPlan) -> None: class AwsBackupVault(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_vault" kind_display: ClassVar[str] = "AWS Backup Vault" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:backup-vault:{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Backup Vaults are secure storage locations for backup data. " "They are used to store and organize backups created by AWS Backup, providing encryption and access control." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupplan/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:backup-vault:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("backup", "list-backup-vaults", "BackupVaultList") mapping: ClassVar[Dict[str, Bender]] = { "id": S("BackupVaultArn"), @@ -426,6 +434,8 @@ class AwsBackupRecoveryPoint(AwsResource): "They provide detailed information on the recovery points, including metadata, status, and lifecycle policies. " "These recovery points are crucial for restoring data during disaster recovery or operational recovery scenarios." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "backup", "group": "storage"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/backupvaults/details/{backup_vault_name}/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_vault", "aws_backup_plan"]}, @@ -572,12 +582,14 @@ class AwsBackupReportDeliveryChannel: @define(eq=False, slots=False) class AwsBackupReportPlan(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_report_plan" - kind_display: ClassVar[str] = "AWS Report Plan" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/compliance/reports/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:report-plan:{name}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Report Plan" kind_description: ClassVar[str] = ( "AWS Backup Report Plans generate reports that provide detailed information on backup jobs and resource compliance. " "These reports help in monitoring and auditing backup activities and compliance with organizational policies." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "plan", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/compliance/reports/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:report-plan:{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_framework"]}, } @@ -660,12 +672,14 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: class AwsBackupRestoreTestingPlan(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_restore_testing_plan" - kind_display: ClassVar[str] = "AWS Restore Testing Plan" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/restoretesting/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:restore-testing-plan:{name}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Restore Testing Plan" kind_description: ClassVar[str] = ( "AWS Backup Restore Testing Plans are configurations designed to test the restore capabilities and processes for backed-up data. " "They ensure that recovery procedures are effective and that data can be reliably restored." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "plan", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/restoretesting/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:restore-testing-plan:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("backup", "list-restore-testing-plans", "RestoreTestingPlans") mapping: ClassVar[Dict[str, Bender]] = { "id": S("RestoreTestingPlanArn"), @@ -738,12 +752,14 @@ def add_tags(restore_plan: AwsBackupRestoreTestingPlan) -> None: @define(eq=False, slots=False) class AwsBackupLegalHold(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_legal_hold" - kind_display: ClassVar[str] = "AWS Legal Hold" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/legalholds/details/{id}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:legal-hold:{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Legal Hold" kind_description: ClassVar[str] = ( "AWS Backup Legal Holds are used to retain backup data for compliance and legal purposes. " "They prevent deletion of backups that might be required for legal or regulatory reasons." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/legalholds/details/{id}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:legal-hold:{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("backup", "list-legal-holds", "LegalHolds") mapping: ClassVar[Dict[str, Bender]] = { "id": S("LegalHoldId"), @@ -803,12 +819,14 @@ def add_tags(legal_hold: AwsBackupLegalHold) -> None: @define(eq=False, slots=False) class AwsBackupRestoreJob(AwsResource): kind: ClassVar[str] = "aws_backup_restore_job" - kind_display: ClassVar[str] = "AWS Restore Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/jobs/restore/details/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Restore Job" kind_description: ClassVar[str] = ( "AWS Backup Restore Jobs represent the tasks that restore data from backups. " "They include details on the restore process, target resources, and status of the restoration." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/jobs/restore/details/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_testing_plan", "aws_backup_recovery_point"]}, } @@ -867,12 +885,14 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AwsBackupCopyJob(AwsResource): kind: ClassVar[str] = "aws_backup_copy_job" - kind_display: ClassVar[str] = "AWS Copy Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/jobs/copy/details/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Backup Copy Job" kind_description: ClassVar[str] = ( "AWS Backup Copy Jobs are operations that duplicate backups from one backup vault to another. " "They facilitate data redundancy and disaster recovery by ensuring copies are stored in different locations." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/jobs/copy/details/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_plan"]}, "successors": {"default": ["aws_backup_vault", "aws_backup_recovery_point"]}, @@ -941,11 +961,13 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: class AwsBackupFramework(BackupResourceTaggable, AwsResource): kind: ClassVar[str] = "aws_backup_framework" kind_display: ClassVar[str] = "AWS Backup Framework" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/compliance/frameworks/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:framework:{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Backup Frameworks are predefined sets of controls and requirements designed to help organizations align their backup operations with regulatory and compliance standards. " "They provide a structured approach to managing backups, ensuring adherence to policies, and facilitating audits." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "backup", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/backup/home?region={region_id}#/compliance/frameworks/details/{name}", "arn_tpl": "arn:{partition}:backup:{region}:{account}:framework:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( "backup", "list-frameworks", "Frameworks", expected_errors=["AccessDeniedException"] ) diff --git a/plugins/aws/fix_plugin_aws/resource/base.py b/plugins/aws/fix_plugin_aws/resource/base.py index 1203beb6dc..dd0dc591cf 100644 --- a/plugins/aws/fix_plugin_aws/resource/base.py +++ b/plugins/aws/fix_plugin_aws/resource/base.py @@ -388,11 +388,13 @@ def complete_graph(self, builder: GraphBuilder, source: Json) -> None: class AwsEc2VolumeType(AwsResource, BaseVolumeType): kind: ClassVar[str] = "aws_ec2_volume_type" kind_display: ClassVar[str] = "AWS EC2 Volume Type" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Volume Types are different storage options for Amazon Elastic Block" " Store (EBS) volumes, such as General Purpose (SSD) and Magnetic." ) + kind_service = "ec2" + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip class GraphBuilder: diff --git a/plugins/aws/fix_plugin_aws/resource/cloudformation.py b/plugins/aws/fix_plugin_aws/resource/cloudformation.py index 27cdd70a86..b6ff1e46c2 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudformation.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudformation.py @@ -96,6 +96,7 @@ class AwsCloudFormationStack(AwsResource, BaseStack): "CloudFormation Stacks are a collection of AWS resources that are created," " updated, or deleted together as a single unit." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-stacks", "Stacks") reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["aws_resource"]}} mapping: ClassVar[Dict[str, Bender]] = { @@ -253,12 +254,14 @@ class AwsCloudFormationAutoDeployment: class AwsCloudFormationStackSet(AwsResource): kind: ClassVar[str] = "aws_cloudformation_stack_set" kind_display: ClassVar[str] = "AWS CloudFormation Stack Set" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudformation/home?region={region}#/stacksets/{name}/info?permissions=self", "arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack-set/{name}/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFormation Stack Set is a feature in AWS CloudFormation that enables you" " to create, update, or delete stacks across multiple accounts and regions" " with a single CloudFormation template." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "stack", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudformation/home?region={region}#/stacksets/{name}/info?permissions=self", "arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack-set/{name}/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-stack-sets", "Summaries", dict(Status="ACTIVE")) mapping: ClassVar[Dict[str, Bender]] = { "id": S("StackSetId"), @@ -371,12 +374,14 @@ def _stack_instance_id(stack: Json) -> str: class AwsCloudFormationStackInstanceSummary(AwsResource): # note: resource is collected via AwsCloudFormationStackSet kind: ClassVar[str] = "aws_cloud_formation_stack_instance_summary" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack-instance/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS CloudFormation Stack Instance Summary" kind_description: ClassVar[str] = ( "CloudFormation Stack Instance Summary provides a summary of the overall stacks in a CloudFormation" " deployment. The information includes current status, name, and any associated resources or parameters." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "stack", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack-instance/{id}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": F(_stack_instance_id), "stack_instance_stack_set_id": S("StackSetId"), diff --git a/plugins/aws/fix_plugin_aws/resource/cloudfront.py b/plugins/aws/fix_plugin_aws/resource/cloudfront.py index facf62d4f7..2f0e7967cf 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudfront.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudfront.py @@ -580,13 +580,15 @@ class AwsCloudFrontDistributionConfig: class AwsCloudFrontDistribution(CloudFrontTaggable, CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_distribution" api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("cloudfront", "get-distribution", "Distribution") - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home#/distributions/{id}", "arn_tpl": "arn:{partition}:cloudfront::{account}:distribution/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS CloudFront Distribution" kind_description: ClassVar[str] = ( "CloudFront Distributions are a content delivery network (CDN) offered by" " Amazon Web Services, which enables users to deliver their content to end-" " users with low latency and high transfer speeds." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cdn", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home#/distributions/{id}", "arn_tpl": "arn:{partition}:cloudfront::{account}:distribution/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_lambda_function"]}, "successors": { @@ -761,12 +763,14 @@ class AwsCloudFrontFunctionConfig: class AwsCloudFrontFunction(CloudFrontTaggable, BaseServerlessFunction, CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_function" kind_display: ClassVar[str] = "AWS CloudFront Function" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v3/home?region={region}#/functions/{name}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:function/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFront Functions are serverless functions that allow developers to" " customize and extend the functionality of CloudFront content delivery" " network, enabling advanced edge processing of HTTP requests and responses." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "function", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v3/home?region={region}#/functions/{name}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:function/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-functions", "FunctionList.Items", parameter={"Stage": "LIVE"} ) @@ -813,11 +817,13 @@ def delete_resource(self, client: AwsClient, graph: Graph) -> bool: class AwsCloudFrontPublicKey(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_public_key" kind_display: ClassVar[str] = "AWS CloudFront Public Key" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/publickey/edit/{id}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:public-key/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS CloudFront Public Key is a public key used in conjunction with a private key for managing the" " identity of the content distributors and validating access to content served by AWS CloudFront." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/publickey/edit/{id}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:public-key/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-public-keys", "PublicKeyList.Items") mapping: ClassVar[Dict[str, Bender]] = { "id": S("Id"), @@ -874,12 +880,14 @@ class AwsCloudFrontEndPoint: class AwsCloudFrontRealtimeLogConfig(CloudFrontTaggable, CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_realtime_log_config" kind_display: ClassVar[str] = "AWS CloudFront Real-time Log Configuration" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/logs/realtime/{name}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:real-time-log-config/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFront Real-time Log Configuration allows you to configure real-time" " logging for your CloudFront distribution, enabling you to receive real-time" " logs for your web traffic." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/logs/realtime/{name}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:real-time-log-config/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-realtime-log-configs", "RealtimeLogConfigs.Items") mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), @@ -1109,13 +1117,14 @@ class AwsCloudFrontResponseHeadersPolicyConfig: class AwsCloudFrontResponseHeadersPolicy(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_response_headers_policy" kind_display: ClassVar[str] = "AWS CloudFront Response Headers Policy" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region=global#/policies/responseHeaders/{id}", "arn_tpl": "arn:{partition}:cloudfront::{account}:response-headers-policy/{id}"} # fmt: skip - kind_description: ClassVar[str] = ( "The AWS CloudFront Response Headers Policy is a configuration that allows" " you to manage and control the response headers that are included in the HTTP" " responses delivered by CloudFront." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region=global#/policies/responseHeaders/{id}", "arn_tpl": "arn:{partition}:cloudfront::{account}:response-headers-policy/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-response-headers-policies", "ResponseHeadersPolicyList.Items" ) @@ -1163,12 +1172,14 @@ class AwsCloudFrontS3Origin: class AwsCloudFrontStreamingDistribution(CloudFrontTaggable, CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_streaming_distribution" kind_display: ClassVar[str] = "AWS CloudFront Streaming Distribution" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:streaming-distribution/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFront Streaming Distribution is a content delivery network (CDN)" " service provided by AWS that allows for fast and secure streaming of audio" " and video content over the internet." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cdn", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:streaming-distribution/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-streaming-distributions", "StreamingDistributionList.Items" ) @@ -1200,12 +1211,14 @@ class AwsCloudFrontStreamingDistribution(CloudFrontTaggable, CloudFrontResource, class AwsCloudFrontOriginAccessControl(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_origin_access_control" kind_display: ClassVar[str] = "AWS CloudFront Origin Access Control" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:origin-access-identity/cloudfront/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS CloudFront Origin Access Control is a security feature that allows you to control access" " to your S3 bucket or custom origin, ensuring that your content can only be accessed via" " CloudFront distributions and not directly from the origin itself." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "access_control", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:origin-access-identity/cloudfront/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-origin-access-controls", "OriginAccessControlList.Items" ) @@ -1339,12 +1352,14 @@ class AwsCloudFrontCachePolicyConfig: class AwsCloudFrontCachePolicy(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_cache_policy" kind_display: ClassVar[str] = "AWS CloudFront Cache Policy" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/policies/cache/{id}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:cache-policy/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFront Cache Policies in AWS specify the caching behavior for CloudFront" " distributions, allowing users to control how content is cached and delivered" " to end users." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudfront/v4/home?region={region}#/policies/cache/{id}", "arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:cache-policy/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-cache-policies", "CachePolicyList.Items") mapping: ClassVar[Dict[str, Bender]] = { "id": S("CachePolicy", "Id"), @@ -1441,12 +1456,14 @@ class AwsCloudFrontContentTypeProfileConfig: class AwsCloudFrontFieldLevelEncryptionConfig(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_field_level_encryption_config" kind_display: ClassVar[str] = "AWS CloudFront Field-Level Encryption Configuration" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:field-level-encryption-config/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS CloudFront Field-Level Encryption Configuration is a feature that helps you to protect sensitive data" " by encrypting specific HTTP fields at CloudFront edge locations. It allows you to encrypt data within" " each individual field of an HTTPS request or response." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:field-level-encryption-config/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-field-level-encryption-configs", "FieldLevelEncryptionList.Items" ) @@ -1516,12 +1533,14 @@ class AwsCloudFrontEncryptionEntity: class AwsCloudFrontFieldLevelEncryptionProfile(CloudFrontResource, AwsResource): kind: ClassVar[str] = "aws_cloudfront_field_level_encryption_profile" kind_display: ClassVar[str] = "AWS CloudFront Field Level Encryption Profile" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:field-level-encryption-profile/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Field Level Encryption Profiles in AWS CloudFront allow users to encrypt" " specific fields in a web form, providing an extra layer of security to" " sensitive data." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront:{region}:{account}:field-level-encryption-profile/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-field-level-encryption-profiles", "FieldLevelEncryptionProfileList.Items" ) diff --git a/plugins/aws/fix_plugin_aws/resource/cloudtrail.py b/plugins/aws/fix_plugin_aws/resource/cloudtrail.py index 87cbcb0271..9cb183b6f3 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudtrail.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudtrail.py @@ -137,11 +137,13 @@ class AwsCloudTrailStatus: class AwsCloudTrail(AwsResource): kind: ClassVar[str] = "aws_cloud_trail" kind_display: ClassVar[str] = "AWS CloudTrail" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudtrail/home?region={region}#/trails/{arn}:trail/{name}", "arn_tpl": "arn:{partition}:cloudtrail:{region}:{account}:trail/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudTrail is a service that enables governance, compliance, operational" " auditing, and risk auditing of your AWS account." ) + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudtrail/home?region={region}#/trails/{arn}:trail/{name}", "arn_tpl": "arn:{partition}:cloudtrail:{region}:{account}:trail/{name}"} # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-trails", "Trails") mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), diff --git a/plugins/aws/fix_plugin_aws/resource/cloudwatch.py b/plugins/aws/fix_plugin_aws/resource/cloudwatch.py index 17cad5456a..64f8fdb397 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudwatch.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudwatch.py @@ -235,10 +235,12 @@ class AwsCloudwatchMetricDataQuery: class AwsCloudwatchAlarm(CloudwatchTaggable, AwsResource): kind: ClassVar[str] = "aws_cloudwatch_alarm" kind_display: ClassVar[str] = "AWS CloudWatch Alarm" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#alarmsV2:alarm/{name}", "arn_tpl": "arn:{partition}:cloudwatch:{region}:{account}:alarm/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudWatch Alarms allow you to monitor metrics and send notifications based on the thresholds you set." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "alarm", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#alarmsV2:alarm/{name}", "arn_tpl": "arn:{partition}:cloudwatch:{region}:{account}:alarm/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-alarms", "MetricAlarms") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_ec2_instance"], "delete": ["aws_ec2_instance"]}, @@ -334,12 +336,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsCloudwatchLogGroup(LogsTaggable, AwsResource): kind: ClassVar[str] = "aws_cloudwatch_log_group" kind_display: ClassVar[str] = "AWS CloudWatch Log Group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#logsV2:log-groups/log-group/{name}", "arn_tpl": "arn:{partition}:logs:{region}:{account}:log-group/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudWatch Log Groups are containers for log streams in Amazon's CloudWatch" " service, enabling centralized storage and analysis of log data from various" " AWS resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#logsV2:log-groups/log-group/{name}", "arn_tpl": "arn:{partition}:logs:{region}:{account}:log-group/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("logs", "describe-log-groups", "logGroups") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_kms_key"]}, @@ -403,12 +407,14 @@ class AwsCloudwatchMetricTransformation: class AwsCloudwatchMetricFilter(AwsResource): kind: ClassVar[str] = "aws_cloudwatch_metric_filter" kind_display: ClassVar[str] = "AWS CloudWatch Metric Filter" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#logsV2:log-groups/log-group/{arn}", "arn_tpl": "arn:{partition}:logs:{region}:{account}:metric-filter/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudWatch Metric Filter is a feature in Amazon CloudWatch that allows you" " to define a pattern to extract information from your log events and use it" " to create CloudWatch metrics." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudwatch/home?region={region}#logsV2:log-groups/log-group/{arn}", "arn_tpl": "arn:{partition}:logs:{region}:{account}:metric-filter/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("logs", "describe-metric-filters", "metricFilters") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_cloudwatch_log_group"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/cognito.py b/plugins/aws/fix_plugin_aws/resource/cognito.py index 67a667de41..6cfff439ed 100644 --- a/plugins/aws/fix_plugin_aws/resource/cognito.py +++ b/plugins/aws/fix_plugin_aws/resource/cognito.py @@ -19,13 +19,15 @@ class AwsCognitoGroup(AwsResource): # collection of group resources happens in AwsCognitoUserPool.collect() kind: ClassVar[str] = "aws_cognito_group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cognito/v2/idp/user-pools/{UserPoolId}/groups/details/{name}?region={region}", "arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:group/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS Cognito Group" kind_description: ClassVar[str] = ( "Cognito Groups are a way to manage and organize users in AWS Cognito, a" " fully managed service for user authentication, registration, and access" " control." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cognito/v2/idp/user-pools/{UserPoolId}/groups/details/{name}?region={region}", "arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:group/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_iam_role"], "delete": ["aws_iam_role"]} } @@ -104,6 +106,7 @@ class AwsCognitoUser(AwsResource, BaseUser): " provides secure user authentication and authorization for web and mobile" " applications." ) + kind_service: ClassVar[Optional[str]] = service_name mapping: ClassVar[Dict[str, Bender]] = { "id": S("Username"), "name": S("Username"), @@ -203,12 +206,14 @@ class AwsCognitoLambdaConfigType: class AwsCognitoUserPool(AwsResource): kind: ClassVar[str] = "aws_cognito_user_pool" kind_display: ClassVar[str] = "AWS Cognito User Pool" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cognito/v2/idp/user-pools/{id}/users?region={region}", "arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:userpool/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "An AWS Cognito User Pool is a managed user directory that enables user" " registration, authentication, and access control for your web and mobile" " apps." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cognito/v2/idp/user-pools/{id}/users?region={region}", "arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:userpool/{name}"} # fmt: skip # this call requires the MaxResult parameter, 60 is the maximum valid input api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-user-pools", "UserPools", {"MaxResults": 60}) reference_kinds: ClassVar[ModelReference] = { diff --git a/plugins/aws/fix_plugin_aws/resource/config.py b/plugins/aws/fix_plugin_aws/resource/config.py index dbcbcfa81b..3f1666e64e 100644 --- a/plugins/aws/fix_plugin_aws/resource/config.py +++ b/plugins/aws/fix_plugin_aws/resource/config.py @@ -64,12 +64,14 @@ class AwsConfigRecordingGroup: class AwsConfigRecorder(AwsResource): kind: ClassVar[str] = "aws_config_recorder" kind_display: ClassVar[str] = "AWS Config Recorder" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:config:{region}:{account}:config-recorder/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Config Recorder is a service provided by Amazon Web Services that" " continuously records the configuration changes made to resources in an AWS" " account." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:config:{region}:{account}:config-recorder/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-configuration-recorders", "ConfigurationRecorders" ) diff --git a/plugins/aws/fix_plugin_aws/resource/dynamodb.py b/plugins/aws/fix_plugin_aws/resource/dynamodb.py index 8b939ff665..fd291c6d21 100644 --- a/plugins/aws/fix_plugin_aws/resource/dynamodb.py +++ b/plugins/aws/fix_plugin_aws/resource/dynamodb.py @@ -357,12 +357,14 @@ class AwsDynamoDbContinuousBackup: class AwsDynamoDbTable(DynamoDbTaggable, AwsResource): kind: ClassVar[str] = "aws_dynamodb_table" kind_display: ClassVar[str] = "AWS DynamoDB Table" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/dynamodbv2/home?region={region}#table?name={name}", "arn_tpl": "arn:{partition}:dynamodb:{region}:{account}:table/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "An AWS DynamoDB Table is a collection of data items organized by a primary key in Amazon DynamoDB," " a fully managed NoSQL database service that provides fast and predictable performance with seamless" " scalability." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/dynamodbv2/home?region={region}#table?name={name}", "arn_tpl": "arn:{partition}:dynamodb:{region}:{account}:table/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-tables", "TableNames") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_kinesis_stream", "aws_kms_key"]}, @@ -488,12 +490,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsDynamoDbGlobalTable(DynamoDbTaggable, AwsResource): kind: ClassVar[str] = "aws_dynamodb_global_table" kind_display: ClassVar[str] = "AWS DynamoDB Global Table" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:dynamodb:{region}:{account}:table/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS DynamoDB Global Tables provide fully managed, multi-region, and globally" " distributed replicas of DynamoDB tables, enabling low-latency and high-" " performance global access to data." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:dynamodb:{region}:{account}:table/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-global-tables", "GlobalTables") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_kms_key"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/ec2.py b/plugins/aws/fix_plugin_aws/resource/ec2.py index e3f749897e..3d4b8630f0 100644 --- a/plugins/aws/fix_plugin_aws/resource/ec2.py +++ b/plugins/aws/fix_plugin_aws/resource/ec2.py @@ -387,12 +387,14 @@ class AwsEc2InferenceAcceleratorInfo: class AwsEc2InstanceType(AwsResource, BaseInstanceType): kind: ClassVar[str] = "aws_ec2_instance_type" kind_display: ClassVar[str] = "AWS EC2 Instance Type" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:instance/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS EC2 Instance Type refers to the classification of an EC2 instance based on the resources and" " capabilities it offers, such as CPU, memory, storage, and networking capacity, tailored for different" " workload requirements and applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:instance/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-instance-types", "InstanceTypes") reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -519,6 +521,7 @@ class AwsEc2Volume(EC2Taggable, AwsResource, BaseVolume): " instances in Amazon's cloud, providing additional storage for applications" " and data." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-volumes", "Volumes") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_ec2_volume_type", "aws_ec2_instance"], "delete": ["aws_kms_key"]}, @@ -739,6 +742,7 @@ class AwsEc2Snapshot(EC2Taggable, AwsResource, BaseSnapshot): " volumes, allowing users to capture and store point-in-time copies of their" " data." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-snapshots", "Snapshots", dict(OwnerIds=["self"]) ) @@ -803,8 +807,10 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsEc2KeyPair(EC2Taggable, AwsResource, BaseKeyPair): kind: ClassVar[str] = "aws_ec2_keypair" kind_display: ClassVar[str] = "AWS EC2 Keypair" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#KeyPairs:search={name}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:keypair/{name}"} # fmt: skip kind_description: ClassVar[str] = "EC2 Keypairs are SSH key pairs used to securely connect to EC2 instances in Amazon's cloud." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#KeyPairs:search={name}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:keypair/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-key-pairs", "KeyPairs") reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1245,6 +1251,7 @@ class AwsEc2Instance(EC2Taggable, AwsResource, BaseInstance): "EC2 Instances are virtual servers in Amazon's cloud, allowing users to run" " applications on the Amazon Web Services infrastructure." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-instances", "Reservations") reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -1569,12 +1576,14 @@ class AwsEc2RecurringCharge: class AwsEc2ReservedInstances(EC2Taggable, AwsResource): kind: ClassVar[str] = "aws_ec2_reserved_instances" kind_display: ClassVar[str] = "AWS EC2 Reserved Instances" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#ReservedInstances:instanceId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:reserved-instances/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "Reserved Instances are a purchasing option to save money on EC2 instance" " usage. Users can reserve instances for a one- or three-year term, allowing" " them to pay a lower hourly rate compared to on-demand instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#ReservedInstances:instanceId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:reserved-instances/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-reserved-instances", "ReservedInstances") reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["aws_ec2_instance_type"]}} mapping: ClassVar[Dict[str, Bender]] = { @@ -1705,11 +1714,13 @@ class AwsEc2NetworkAclEntry: class AwsEc2NetworkAcl(EC2Taggable, AwsResource, BaseNetworkAcl): kind: ClassVar[str] = "aws_ec2_network_acl" kind_display: ClassVar[str] = "AWS EC2 Network ACL" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpc/home?region={region}#NetworkAclDetails:networkAclId={NetworkAclId}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:network-acl/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Network ACLs are virtual stateless firewalls that control inbound and" " outbound traffic for EC2 instances in Amazon's cloud." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "access_control", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpc/home?region={region}#NetworkAclDetails:networkAclId={NetworkAclId}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:network-acl/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-network-acls", "NetworkAcls") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_vpc"], "delete": ["aws_vpc", "aws_ec2_subnet"]}, @@ -1762,6 +1773,7 @@ class AwsEc2ElasticIp(EC2Taggable, AwsResource, BaseIPAddress): " computing. They allow you to mask the failure or replacement of an instance" " by rapidly remapping the address to another instance in your account." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-addresses", "Addresses") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_ec2_instance", "aws_ec2_network_interface"]}, @@ -1927,12 +1939,14 @@ class AwsEc2Tag: class AwsEc2NetworkInterface(EC2Taggable, AwsResource, BaseNetworkInterface): kind: ClassVar[str] = "aws_ec2_network_interface" kind_display: ClassVar[str] = "AWS EC2 Network Interface" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/v2/home?region={region}#NetworkInterface:networkInterfaceId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:network-interface/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An EC2 Network Interface is a virtual network interface that can be attached" " to EC2 instances in the AWS cloud, allowing for communication between" " instances and with external networks." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/v2/home?region={region}#NetworkInterface:networkInterfaceId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:network-interface/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-network-interfaces", "NetworkInterfaces") reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -2105,6 +2119,7 @@ class AwsEc2Vpc(EC2Taggable, AwsResource, BaseNetwork): " dedicated to your AWS account, allowing you to launch AWS resources in a" " defined virtual network environment." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-vpcs", "Vpcs") mapping: ClassVar[Dict[str, Bender]] = { "id": S("VpcId"), @@ -2218,6 +2233,7 @@ class AwsEc2VpcPeeringConnection(EC2Taggable, AwsResource, BasePeeringConnection " Private Clouds (VPCs) that enables you to route traffic between them using" " private IP addresses." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-vpc-peering-connections", "VpcPeeringConnections" ) @@ -2303,6 +2319,7 @@ class AwsEc2VpcEndpoint(EC2Taggable, AwsResource, BaseEndpoint): " supported AWS services without using public IPs or requiring traffic to" " traverse the internet." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-vpc-endpoints", "VpcEndpoints") reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -2445,6 +2462,7 @@ class AwsEc2Subnet(EC2Taggable, AwsResource, BaseSubnet): " in Amazon's cloud, allowing users to group resources and control network" " access within a specific network segment." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-subnets", "Subnets") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_vpc"], "delete": ["aws_vpc"]}, @@ -2611,11 +2629,13 @@ class AwsEc2IpPermission: class AwsEc2SecurityGroup(EC2Taggable, AwsResource, BaseSecurityGroup): kind: ClassVar[str] = "aws_ec2_security_group" kind_display: ClassVar[str] = "AWS EC2 Security Group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/v2/home?region={region}#SecurityGroup:groupId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:security-group/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An EC2 Security Group acts as a virtual firewall that controls inbound and" " outbound traffic for EC2 instances within a VPC." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "security_group", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/v2/home?region={region}#SecurityGroup:groupId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:security-group/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-security-groups", "SecurityGroups") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_vpc"], "delete": ["aws_vpc"]}, @@ -2753,13 +2773,13 @@ class AwsEc2NatGateway(EC2Taggable, AwsResource, BaseGateway): kind: ClassVar[str] = "aws_ec2_nat_gateway" kind_display: ClassVar[str] = "AWS EC2 NAT Gateway" aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#NatGatewayDetails:natGatewayId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:nat-gateway/{id}"} # fmt: skip - kind_description: ClassVar[str] = ( "A NAT Gateway is a fully managed network address translation (NAT) service" " provided by Amazon Web Services (AWS) that allows instances within a private" " subnet to connect outbound to the Internet while also preventing inbound" " connections from the outside." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-nat-gateways", "NatGateways") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_ec2_network_interface", "aws_vpc", "aws_ec2_subnet"]}, @@ -2886,12 +2906,14 @@ class AwsEc2InternetGatewayAttachment: class AwsEc2InternetGateway(EC2Taggable, AwsResource, BaseGateway): kind: ClassVar[str] = "aws_ec2_internet_gateway" kind_display: ClassVar[str] = "AWS EC2 Internet Gateway" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpc/home?region={region}#InternetGateway:internetGatewayId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:internet-gateway/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An Internet Gateway is a horizontally scalable, redundant, and highly" " available VPC component that allows communication between instances in your" " VPC and the internet." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpc/home?region={region}#InternetGateway:internetGatewayId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:internet-gateway/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-internet-gateways", "InternetGateways") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_vpc"], "delete": ["aws_vpc"]}, @@ -3039,6 +3061,7 @@ class AwsEc2RouteTable(EC2Taggable, AwsResource, BaseRoutingTable): "EC2 Route Tables are used to determine where network traffic is directed" " within a Virtual Private Cloud (VPC) in Amazon's cloud infrastructure." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-route-tables", "RouteTables") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_vpc"], "delete": ["aws_vpc"]}, @@ -3178,11 +3201,12 @@ class AwsEc2HostInstance: class AwsEc2Host(EC2Taggable, AwsResource): kind: ClassVar[str] = "aws_ec2_host" kind_display: ClassVar[str] = "AWS EC2 Host" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#Host:hostId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:host/{id}"} # fmt: skip - kind_description: ClassVar[str] = ( "EC2 Hosts are physical servers in Amazon's cloud that are used to run EC2 instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "host", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#Host:hostId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:host/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-hosts", "Hosts") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_ec2_instance"], "delete": ["aws_ec2_instance"]} @@ -3275,12 +3299,14 @@ class AwsEc2DestinationOption: class AwsEc2FlowLog(EC2Taggable, AwsResource): kind: ClassVar[str] = "aws_ec2_flow_log" kind_display: ClassVar[str] = "AWS EC2 Flow Log" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:flow-log/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Flow Logs capture information about the IP traffic going to and from" " network interfaces in an Amazon EC2 instance, helping to troubleshoot" " network connectivity issues." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:flow-log/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-flow-logs", "FlowLogs") mapping: ClassVar[Dict[str, Bender]] = { "id": S("FlowLogId"), @@ -3376,11 +3402,13 @@ class AwsEc2BlockDeviceMapping: class AwsEc2Image(AwsResource): kind: ClassVar[str] = "aws_ec2_image" kind_display: ClassVar[str] = "AWS EC2 Image" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#ImageDetails:imageId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:image/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An Amazon Machine Image (AMI) is a supported and maintained image " "provided by AWS that provides the information required to launch an instance. " ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#ImageDetails:imageId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:image/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("ec2", "describe-images", "Images", {"Owners": ["self"]}) mapping: ClassVar[Dict[str, Bender]] = { "id": S("ImageId"), @@ -3946,6 +3974,8 @@ class AwsEc2LaunchTemplate(EC2Taggable, AwsResource): kind: ClassVar[str] = "aws_ec2_launch_template" kind_display: ClassVar[str] = "AWS EC2 Launch Template" kind_description: ClassVar[str] = "An AWS EC2 Launch Template provides a configurable blueprint for launching EC2 instances, allowing for the specification of settings like instance type, AMI, security groups, and block device mappings for consistency and automation in instance creation." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/v2/home?region={region}#LaunchTemplateDetails:launchTemplateId={LaunchTemplateId}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:launch-template/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( "ec2", "describe-launch-template-versions", "LaunchTemplateVersions", {"Versions": ["$Default"]} diff --git a/plugins/aws/fix_plugin_aws/resource/ecr.py b/plugins/aws/fix_plugin_aws/resource/ecr.py index 76e7b4db22..45d8b8615c 100644 --- a/plugins/aws/fix_plugin_aws/resource/ecr.py +++ b/plugins/aws/fix_plugin_aws/resource/ecr.py @@ -28,6 +28,8 @@ class AwsEcrRepository(AwsResource): kind: ClassVar[str] = "aws_ecr_repository" kind_display: ClassVar[str] = "AWS ECR Repository" kind_description: ClassVar[str] = "An AWS Elastic Container Registry (ECR) Repository is used for storing, managing, and deploying Docker container images in a secure, scalable, and private environment on AWS." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "repository", "group": "compute"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecr/repositories/{name}?region={region}", "arn_tpl": "arn:{partition}:ecr:{region}:{account}:repository/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("ecr", "describe-repositories", "repositories") public_spec: ClassVar[AwsApiSpec] = AwsApiSpec("ecr-public", "describe-repositories", "repositories") diff --git a/plugins/aws/fix_plugin_aws/resource/ecs.py b/plugins/aws/fix_plugin_aws/resource/ecs.py index 01747656c3..fae9cc27b1 100644 --- a/plugins/aws/fix_plugin_aws/resource/ecs.py +++ b/plugins/aws/fix_plugin_aws/resource/ecs.py @@ -105,12 +105,14 @@ class AwsEcsAutoScalingGroupProvider: class AwsEcsCapacityProvider(EcsTaggable, AwsResource): # collection of capacity provider resources happens in AwsEcsCluster.collect() kind: ClassVar[str] = "aws_ecs_capacity_provider" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ecs:{region}:{account}:capacity-provider/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS ECS Capacity Provider" kind_description: ClassVar[str] = ( "ECS Capacity Providers are used in Amazon's Elastic Container Service to" " manage the capacity and scaling for containerized applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "provider", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ecs:{region}:{account}:capacity-provider/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_autoscaling_group"]}, "successors": {"default": ["aws_autoscaling_group"]}, @@ -424,13 +426,14 @@ class AwsEcsTaskOverride: class AwsEcsTask(EcsTaggable, AwsResource): # collection of task resources happens in AwsEcsCluster.collect() kind: ClassVar[str] = "aws_ecs_task" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{clusterArn}/tasks/{id}/configuration?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:task/{name}"} # fmt: skip - kind_display: ClassVar[str] = "AWS ECS Task" kind_description: ClassVar[str] = ( "ECS Tasks are containers managed by Amazon Elastic Container Service, which" " allow users to run and scale applications easily using Docker containers." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{clusterArn}/tasks/{id}/configuration?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:task/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ecs_task_definition"], @@ -1072,12 +1075,14 @@ class AwsEcsProxyConfiguration: class AwsEcsTaskDefinition(EcsTaggable, AwsResource): kind: ClassVar[str] = "aws_ecs_task_definition" kind_display: ClassVar[str] = "AWS ECS Task Definition" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/task-definitions/{name}?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:task-definition/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "An ECS Task Definition is a blueprint for running tasks in AWS Elastic" " Container Service (ECS), providing information such as the Docker image," " CPU, memory, network configuration, and other parameters." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/task-definitions/{name}?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:task-definition/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-task-definitions", "taskDefinitionArns", {"sort": "desc"} ) @@ -1492,13 +1497,15 @@ class AwsEcsPlacementStrategy: class AwsEcsService(EcsTaggable, AwsResource): # collection of service resources happens in AwsEcsCluster.collect() kind: ClassVar[str] = "aws_ecs_service" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{clusterArn}/services/{name}/health?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:service/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS ECS Service" kind_description: ClassVar[str] = ( "ECS (Elastic Container Service) is a scalable container orchestration" " service provided by AWS, allowing users to easily manage, deploy, and scale" " containerized applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "service", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{clusterArn}/services/{name}/health?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:service/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_subnet", "aws_ec2_security_group"], @@ -1781,13 +1788,15 @@ class AwsEcsContainerInstanceHealthStatus: class AwsEcsContainerInstance(EcsTaggable, AwsResource): # collection of container instance resources happens in AwsEcsCluster.collect() kind: ClassVar[str] = "aws_ecs_container_instance" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ecs:{region}:{account}:container-instance/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS ECS Container Instance" kind_description: ClassVar[str] = ( "ECS Container Instances are virtual servers in Amazon's Elastic Container" " Service (ECS) that are used to run and manage containers within the ECS" " environment." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ecs:{region}:{account}:container-instance/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_ec2_instance"], "delete": ["aws_ec2_instance"]}, } @@ -1927,11 +1936,13 @@ class AwsEcsClusterSetting: class AwsEcsCluster(EcsTaggable, AwsResource): kind: ClassVar[str] = "aws_ecs_cluster" kind_display: ClassVar[str] = "AWS ECS Cluster" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{name}/services?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:cluster/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "ECS (Elastic Container Service) Cluster is a managed cluster of Amazon EC2" " instances used to deploy and manage Docker containers." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ecs/v2/clusters/{name}/services?region={region}", "arn_tpl": "arn:{partition}:ecs:{region}:{account}:cluster/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-clusters", "clusterArns") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_kms_key", "aws_s3_bucket"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/efs.py b/plugins/aws/fix_plugin_aws/resource/efs.py index aacf54c5c2..3a86e8a1ab 100644 --- a/plugins/aws/fix_plugin_aws/resource/efs.py +++ b/plugins/aws/fix_plugin_aws/resource/efs.py @@ -51,11 +51,13 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsEfsMountTarget(AwsResource): kind: ClassVar[str] = "aws_efs_mount_target" kind_display: ClassVar[str] = "AWS EFS Mount Target" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:efs:{region}:{account}:mount-target/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EFS Mount Targets are endpoints in Amazon's Elastic File System that allow" " EC2 instances to mount the file system and access the shared data." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": None, "arn_tpl": "arn:{partition}:efs:{region}:{account}:mount-target/{id}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("MountTargetId"), "owner_id": S("OwnerId"), @@ -83,6 +85,7 @@ class AwsEfsFileSystem(EfsTaggable, AwsResource, BaseNetworkShare): "EFS (Elastic File System) provides a scalable and fully managed file storage" " service for Amazon EC2 instances." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-file-systems", @@ -228,12 +231,14 @@ class AwsEfsRootDirectory: class AwsEfsAccessPoint(AwsResource, EfsTaggable): kind: ClassVar[str] = "aws_efs_access_point" kind_display: ClassVar[str] = "AWS EFS Access Point" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/efs/home?region={region}#/access-points/{id}", "arn_tpl": "arn:{partition}:efs:{region}:{account}:access-point/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS EFS Access Point is a way to securely access files in Amazon EFS" " (Elastic File System) using a unique hostname and optional path, providing" " fine-grained access control." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/efs/home?region={region}#/access-points/{id}", "arn_tpl": "arn:{partition}:efs:{region}:{account}:access-point/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-access-points", diff --git a/plugins/aws/fix_plugin_aws/resource/eks.py b/plugins/aws/fix_plugin_aws/resource/eks.py index d5b80a8ba2..3c4915a7ba 100644 --- a/plugins/aws/fix_plugin_aws/resource/eks.py +++ b/plugins/aws/fix_plugin_aws/resource/eks.py @@ -189,13 +189,15 @@ class AwsEksLaunchTemplateSpecification: class AwsEksNodegroup(EKSTaggable, AwsResource): # Note: this resource is collected via AwsEksCluster kind: ClassVar[str] = "aws_eks_nodegroup" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:eks:{region}:{account}:nodegroup/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS EKS Nodegroup" kind_description: ClassVar[str] = ( "An EKS Nodegroup is a set of EC2 instances that host containerized" " applications and run Kubernetes pods in Amazon Elastic Kubernetes Service" " (EKS) cluster." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "managed_kubernetes"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:eks:{region}:{account}:nodegroup/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_eks_cluster"], "delete": ["aws_eks_cluster", "aws_autoscaling_group"]}, "successors": {"default": ["aws_autoscaling_group"]}, @@ -403,12 +405,14 @@ class AwsEksConnectorConfig: class AwsEksCluster(EKSTaggable, BaseManagedKubernetesClusterProvider, AwsResource): kind: ClassVar[str] = "aws_eks_cluster" kind_display: ClassVar[str] = "AWS EKS Cluster" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/eks/home?region={region}#/clusters/{name}", "arn_tpl": "arn:{partition}:eks:{region}:{account}:cluster/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Amazon Elastic Kubernetes Service (EKS) Cluster is a managed Kubernetes" " service provided by AWS for running containerized applications using" " Kubernetes." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "managed_kubernetes"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/eks/home?region={region}#/clusters/{name}", "arn_tpl": "arn:{partition}:eks:{region}:{account}:cluster/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-clusters", "clusters") reference_kinds: ClassVar[ModelReference] = { "predecessors": { diff --git a/plugins/aws/fix_plugin_aws/resource/elasticache.py b/plugins/aws/fix_plugin_aws/resource/elasticache.py index f6d1022188..2ae7d557e0 100644 --- a/plugins/aws/fix_plugin_aws/resource/elasticache.py +++ b/plugins/aws/fix_plugin_aws/resource/elasticache.py @@ -249,13 +249,15 @@ class AwsElastiCacheLogDeliveryConfiguration: class AwsElastiCacheCacheCluster(ElastiCacheTaggable, AwsResource): kind: ClassVar[str] = "aws_elasticache_cache_cluster" kind_display: ClassVar[str] = "AWS ElastiCache Cache Cluster" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticache/home?region={region}#/{Engine}/{name}", "arn_tpl": "arn:{partition}:elasticache:{region}:{account}:cache-cluster/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "ElastiCache is a web service that makes it easy to set up, manage, and scale" " a distributed in-memory cache environment in the cloud. A cache cluster is a" " collection of one or more cache nodes that work together to provide a highly" " scalable and available cache solution." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticache/home?region={region}#/{Engine}/{name}", "arn_tpl": "arn:{partition}:elasticache:{region}:{account}:cache-cluster/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_ec2_security_group"], @@ -499,12 +501,14 @@ class AwsElastiCacheNodeGroup: class AwsElastiCacheReplicationGroup(ElastiCacheTaggable, AwsResource): kind: ClassVar[str] = "aws_elasticache_replication_group" kind_display: ClassVar[str] = "AWS ElastiCache Replication Group" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:elasticache:{region}:{account}:replication-group/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "ElastiCache Replication Groups in AWS are used to store and retrieve data in" " memory to improve the performance of web applications and reduce the load on" " databases." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:elasticache:{region}:{account}:replication-group/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-replication-groups", "ReplicationGroups") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_elasticache_cache_cluster", "aws_kms_key"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py b/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py index 77d98a43db..5cbe2b777c 100644 --- a/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py +++ b/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py @@ -92,11 +92,13 @@ class AwsBeanstalkApplicationResourceLifecycleConfig: class AwsBeanstalkApplication(AwsResource): kind: ClassVar[str] = "aws_beanstalk_application" kind_display: ClassVar[str] = "AWS Elastic Beanstalk Application" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticbeanstalk/home?region={region}#/application/overview?applicationName={name}", "arn_tpl": "arn:{partition}:elasticbeanstalk:{region}:{account}:application/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Elastic Beanstalk is a fully managed service that makes it easy to deploy" " and run applications in multiple languages." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticbeanstalk/home?region={region}#/application/overview?applicationName={name}", "arn_tpl": "arn:{partition}:elasticbeanstalk:{region}:{account}:application/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-applications", "Applications") mapping: ClassVar[Dict[str, Bender]] = { "id": S("ApplicationName"), @@ -287,12 +289,14 @@ class AwsBeanstalkEnvironmentResourcesDescription: class AwsBeanstalkEnvironment(AwsResource): kind: ClassVar[str] = "aws_beanstalk_environment" kind_display: ClassVar[str] = "AWS Elastic Beanstalk Environment" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticbeanstalk/home?region={region}#/environment/dashboard?environmentId={id}", "arn_tpl": "arn:{partition}:elasticbeanstalk:{region}:{account}:environment/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "An AWS Elastic Beanstalk environment is a collection of AWS resources running an application version." " It includes an application server, server instances, load balancers, and optionally, a database." " Each environment runs only one application and one version of that application at a time." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "environment", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/elasticbeanstalk/home?region={region}#/environment/dashboard?environmentId={id}", "arn_tpl": "arn:{partition}:elasticbeanstalk:{region}:{account}:environment/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-environments", "Environments") reference_kinds: ClassVar[ModelReference] = { "predecessors": { diff --git a/plugins/aws/fix_plugin_aws/resource/elb.py b/plugins/aws/fix_plugin_aws/resource/elb.py index a1a7a61cf2..4097ea8290 100644 --- a/plugins/aws/fix_plugin_aws/resource/elb.py +++ b/plugins/aws/fix_plugin_aws/resource/elb.py @@ -250,13 +250,15 @@ class AwsElbLoadBalancerAttributes: class AwsElb(ElbTaggable, AwsResource, BaseLoadBalancer): kind: ClassVar[str] = "aws_elb" kind_display: ClassVar[str] = "AWS ELB" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#LoadBalancer:loadBalancerArn={name}", "arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:loadbalancer/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "ELB stands for Elastic Load Balancer. It is a service provided by Amazon Web" " Services that automatically distributes incoming application traffic across" " multiple Amazon EC2 instances, making it easier to achieve fault tolerance" " in your applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "load_balancer", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#LoadBalancer:loadBalancerArn={name}", "arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:loadbalancer/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-load-balancers", diff --git a/plugins/aws/fix_plugin_aws/resource/elbv2.py b/plugins/aws/fix_plugin_aws/resource/elbv2.py index 8143024ba6..609922d157 100644 --- a/plugins/aws/fix_plugin_aws/resource/elbv2.py +++ b/plugins/aws/fix_plugin_aws/resource/elbv2.py @@ -352,6 +352,7 @@ class AwsAlb(ElbV2Taggable, AwsResource, BaseLoadBalancer): " application traffic across multiple targets, such as EC2 instances, in" " multiple availability zones." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-load-balancers", @@ -597,13 +598,15 @@ class AwsAlbTargetHealthDescription: @define(eq=False, slots=False) class AwsAlbTargetGroup(ElbV2Taggable, AwsResource): kind: ClassVar[str] = "aws_alb_target_group" - kind_display: ClassVar[str] = "AWS ALB Target Group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#TargetGroup:targetGroupArn={arn}", "arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:targetgroup/{name}/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Alb Target Group" kind_description: ClassVar[str] = ( "An ALB Target Group is a group of instances or IP addresses registered with" " an Application Load Balancer that receives traffic and distributes it to the" " registered targets." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "load_balancer", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#TargetGroup:targetGroupArn={arn}", "arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:targetgroup/{name}/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "describe-target-groups", diff --git a/plugins/aws/fix_plugin_aws/resource/glacier.py b/plugins/aws/fix_plugin_aws/resource/glacier.py index f905e071a2..8af3ccf495 100644 --- a/plugins/aws/fix_plugin_aws/resource/glacier.py +++ b/plugins/aws/fix_plugin_aws/resource/glacier.py @@ -137,11 +137,13 @@ class AwsGlacierJobOutputLocation: class AwsGlacierJob(AwsResource): kind: ClassVar[str] = "aws_glacier_job" kind_display: ClassVar[str] = "AWS Glacier Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:glacier:{region}:{account}:job/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Glacier Jobs are used to manage and execute operations on data stored in" " Amazon S3 Glacier, such as data retrieval or inventory retrieval." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:glacier:{region}:{account}:job/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "delete": ["aws_kms_key"], @@ -210,11 +212,13 @@ def service_name(cls) -> str: class AwsGlacierVault(AwsResource): kind: ClassVar[str] = "aws_glacier_vault" kind_display: ClassVar[str] = "AWS Glacier Vault" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/glacier/home?region={region}#/vault/{name}/view/properties", "arn_tpl": "arn:{partition}:glacier:{region}:{account}:vault/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Glacier Vaults are used for long term data archiving and backup," " providing a secure and durable storage solution with low cost." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "storage"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/glacier/home?region={region}#/vault/{name}/view/properties", "arn_tpl": "arn:{partition}:glacier:{region}:{account}:vault/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-vaults", "VaultList") reference_kinds: ClassVar[ModelReference] = { "successors": { diff --git a/plugins/aws/fix_plugin_aws/resource/iam.py b/plugins/aws/fix_plugin_aws/resource/iam.py index 7c16ce9baa..35096b7443 100644 --- a/plugins/aws/fix_plugin_aws/resource/iam.py +++ b/plugins/aws/fix_plugin_aws/resource/iam.py @@ -116,6 +116,7 @@ class AwsIamRole(AwsResource, BaseRole, BaseIamPrincipal): " However, instead of being uniquely associated with one person, IAM roles are" " intended to be assumable by anyone who needs it." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "successors": { "default": ["aws_iam_policy", "aws_iam_instance_profile"], @@ -228,6 +229,7 @@ class AwsIamServerCertificate(AwsResource, BaseCertificate): " HTTPS server. It enables secure communication between the server and AWS" " services." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-server-certificates", "ServerCertificateMetadataList" ) @@ -319,6 +321,7 @@ class AwsIamPolicy(AwsResource, BasePolicy): "IAM Policies in AWS are used to define permissions and access controls for" " users, groups, and roles within the AWS ecosystem." ) + kind_service: ClassVar[Optional[str]] = service_name mapping: ClassVar[Dict[str, Bender]] = { "id": S("PolicyId"), "tags": S("Tags", default=[]) >> ToDict(), @@ -396,6 +399,7 @@ class AwsIamGroup(AwsResource, BaseGroup): " permissions collectively for multiple users, making it easier to manage" " access to AWS resources." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_iam_policy"], "delete": ["aws_iam_policy"]}, } @@ -495,6 +499,7 @@ class AwsIamAccessKey(AwsResource, BaseAccessKey): kind_description: ClassVar[str] = ( "An AWS IAM Access Key is used to securely access AWS services and resources using API operations." ) + kind_service: ClassVar[Optional[str]] = service_name mapping: ClassVar[Dict[str, Bender]] = { "id": S("AccessKeyId"), "tags": S("Tags", default=[]) >> ToDict(), @@ -628,6 +633,7 @@ class AwsRootUser(AwsResource, BaseUser, BaseIamPrincipal): "The AWS Root User is the initial user created when setting up an AWS account" " and has unrestricted access to all resources in the account." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_account"]}, } @@ -648,6 +654,7 @@ class AwsIamUser(AwsResource, BaseUser, BaseIamPrincipal): "IAM Users are identities created within AWS Identity and Access Management" " (IAM) that can be assigned permissions to access and manage AWS resources." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "get-account-authorization-details") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_iam_group"]}, @@ -808,11 +815,13 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsIamInstanceProfile(AwsResource, BaseInstanceProfile): kind: ClassVar[str] = "aws_iam_instance_profile" kind_display: ClassVar[str] = "AWS IAM Instance Profile" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam:{region}:{account}:instance-profile/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "IAM Instance Profiles are used to associate IAM roles with EC2 instances," " allowing the instances to securely access AWS services and resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "access_control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam:{region}:{account}:instance-profile/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-instance-profiles", "InstanceProfiles") mapping: ClassVar[Dict[str, Bender]] = { "id": S("InstanceProfileId"), diff --git a/plugins/aws/fix_plugin_aws/resource/kinesis.py b/plugins/aws/fix_plugin_aws/resource/kinesis.py index 5e839821d4..0ed979523d 100644 --- a/plugins/aws/fix_plugin_aws/resource/kinesis.py +++ b/plugins/aws/fix_plugin_aws/resource/kinesis.py @@ -90,13 +90,14 @@ class AwsKinesisEnhancedMetrics: class AwsKinesisStream(AwsResource): kind: ClassVar[str] = "aws_kinesis_stream" kind_display: ClassVar[str] = "AWS Kinesis Stream" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/kinesis/home?region={region}#/streams/details/{name}", "arn_tpl": "arn:{partition}:kinesis:{region}:{account}:stream/{name}"} # fmt: skip - kind_description: ClassVar[str] = ( "Kinesis Streams are scalable and durable real-time data streaming services" " in Amazon's cloud, enabling users to capture, process, and analyze data in" " real-time." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "queue", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/kinesis/home?region={region}#/streams/details/{name}", "arn_tpl": "arn:{partition}:kinesis:{region}:{account}:stream/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "delete": ["aws_kms_key"], diff --git a/plugins/aws/fix_plugin_aws/resource/kms.py b/plugins/aws/fix_plugin_aws/resource/kms.py index ef0f4fbf80..6402c8685e 100644 --- a/plugins/aws/fix_plugin_aws/resource/kms.py +++ b/plugins/aws/fix_plugin_aws/resource/kms.py @@ -66,12 +66,14 @@ class AwsKmsMultiRegionConfig: class AwsKmsKey(AwsResource, BaseAccessKey): kind: ClassVar[str] = "aws_kms_key" kind_display: ClassVar[str] = "AWS KMS Key" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/kms/home?region={region}#/kms/keys/{id}", "arn_tpl": "arn:{partition}:kms:{region}:{account}:key/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS KMS (Key Management Service) Key is a managed service that allows you to" " create and control the encryption keys used to encrypt your data stored on" " various AWS services and applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/kms/home?region={region}#/kms/keys/{id}", "arn_tpl": "arn:{partition}:kms:{region}:{account}:key/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-keys", "Keys") mapping: ClassVar[Dict[str, Bender]] = { "id": S("KeyId"), diff --git a/plugins/aws/fix_plugin_aws/resource/lambda_.py b/plugins/aws/fix_plugin_aws/resource/lambda_.py index 155a76c30a..28b87a1a30 100644 --- a/plugins/aws/fix_plugin_aws/resource/lambda_.py +++ b/plugins/aws/fix_plugin_aws/resource/lambda_.py @@ -239,6 +239,7 @@ class AwsLambdaFunction(AwsResource, BaseServerlessFunction): " without provisioning or managing servers. Lambda functions are the compute" " units that run your code in response to events." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-functions", "Functions") reference_kinds: ClassVar[ModelReference] = { "predecessors": { diff --git a/plugins/aws/fix_plugin_aws/resource/opensearch.py b/plugins/aws/fix_plugin_aws/resource/opensearch.py index a0f90ea8f5..c92d87924c 100644 --- a/plugins/aws/fix_plugin_aws/resource/opensearch.py +++ b/plugins/aws/fix_plugin_aws/resource/opensearch.py @@ -250,6 +250,8 @@ class AwsOpenSearchDomain(AwsResource): kind: ClassVar[str] = "aws_opensearch_domain" kind_display: ClassVar[str] = "AWS OpenSearch Domain" kind_description: ClassVar[str] = "An AWS OpenSearch Domain provides a managed environment in the AWS cloud to easily deploy, operate, and scale OpenSearch, a popular search and analytics engine." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/aos/home?region={region}#opensearch/domains/{name}", "arn_tpl": "arn:{partition}:opensearch:{region}:{account}:domain/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("DomainId"), diff --git a/plugins/aws/fix_plugin_aws/resource/rds.py b/plugins/aws/fix_plugin_aws/resource/rds.py index 646fffd6d1..0efe938125 100644 --- a/plugins/aws/fix_plugin_aws/resource/rds.py +++ b/plugins/aws/fix_plugin_aws/resource/rds.py @@ -322,11 +322,13 @@ class AwsRdsDBRole: class AwsRdsInstance(RdsTaggable, AwsResource, BaseDatabase): kind: ClassVar[str] = "aws_rds_instance" kind_display: ClassVar[str] = "AWS RDS Instance" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#database:id={id};is-cluster=false", "arn_tpl": "arn:{partition}:rds:{region}:{account}:db:{name}"} # fmt: skip kind_description: ClassVar[str] = ( "RDS instances are managed relational databases in Amazon's cloud, providing" " scalable and fast performance for applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#database:id={id};is-cluster=false", "arn_tpl": "arn:{partition}:rds:{region}:{account}:db:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-db-instances", "DBInstances") reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -853,12 +855,14 @@ class AwsRdsMasterUserSecret: class AwsRdsCluster(RdsTaggable, AwsResource, BaseDatabase): kind: ClassVar[str] = "aws_rds_cluster" kind_display: ClassVar[str] = "AWS RDS Cluster" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#database:id={id};is-cluster=true", "arn_tpl": "arn:{partition}:rds:{region}:{account}:cluster/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "RDS Clusters are managed relational database services in Amazon's cloud," " providing scalable and highly available databases for applications running" " on the Amazon Web Services infrastructure." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#database:id={id};is-cluster=true", "arn_tpl": "arn:{partition}:rds:{region}:{account}:cluster/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-db-clusters", "DBClusters") mapping: ClassVar[Dict[str, Bender]] = { "id": S("DBClusterIdentifier"), @@ -1061,6 +1065,7 @@ class AwsRdsSnapshot(RdsTaggable, AwsResource, BaseSnapshot): kind: ClassVar[str] = "aws_rds_snapshot" kind_display: ClassVar[str] = "AWS RDS Snapshot" kind_description: ClassVar[str] = "An AWS RDS Snapshot is a backup tool used for creating a point-in-time copy of an RDS database instance, facilitating data recovery and replication." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#db-snapshot:engine={Engine};id={id}", "arn_tpl": "arn:{partition}:rds:{region}:{account}:snapshot:{id}/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("rds", "describe-db-snapshots", "DBSnapshots") mapping: ClassVar[Dict[str, Bender]] = { @@ -1160,6 +1165,8 @@ class AwsRdsClusterSnapshot(AwsResource): kind: ClassVar[str] = "aws_rds_cluster_snapshot" kind_display: ClassVar[str] = "AWS RDS Cluster Snapshot" kind_description: ClassVar[str] = "An AWS RDS Cluster Snapshot is a point-in-time backup of an Amazon RDS cluster that provides data persistence and recovery for disaster management." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "snapshot", "group": "storage"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/rds/home?region={region}#db-snapshot:engine={Engine};id={id}", "arn_tpl": "arn:{partition}:rds:{region}:{account}:snapshot/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("rds", "describe-db-cluster-snapshots", "DBClusterSnapshots") mapping: ClassVar[Dict[str, Bender]] = { diff --git a/plugins/aws/fix_plugin_aws/resource/redshift.py b/plugins/aws/fix_plugin_aws/resource/redshift.py index 3984b2b86e..1fc19aaf48 100644 --- a/plugins/aws/fix_plugin_aws/resource/redshift.py +++ b/plugins/aws/fix_plugin_aws/resource/redshift.py @@ -416,10 +416,12 @@ class AwsRedshiftLoggingStatus: class AwsRedshiftCluster(AwsResource): kind: ClassVar[str] = "aws_redshift_cluster" kind_display: ClassVar[str] = "AWS Redshift Cluster" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:redshift:{region}:{account}:cluster/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Redshift Cluster is a fully managed, petabyte-scale data warehouse service provided by AWS." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:redshift:{region}:{account}:cluster/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "describe-clusters", "Clusters") reference_kinds: ClassVar[ModelReference] = { "predecessors": { diff --git a/plugins/aws/fix_plugin_aws/resource/route53.py b/plugins/aws/fix_plugin_aws/resource/route53.py index b832ccfcbc..2de8b964af 100644 --- a/plugins/aws/fix_plugin_aws/resource/route53.py +++ b/plugins/aws/fix_plugin_aws/resource/route53.py @@ -61,12 +61,14 @@ class AwsRoute53LoggingConfig: @define(eq=False, slots=False) class AwsRoute53Zone(AwsResource, BaseDNSZone): kind: ClassVar[str] = "aws_route53_zone" - kind_display: ClassVar[str] = "AWS Route 53 Zone" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/route53/v2/hostedzones?region={region}#ListRecordSets/{id}", "arn_tpl": "arn:{partition}:route53:{region}:{account}:zone/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Route53 Zone" kind_description: ClassVar[str] = ( "AWS Route 53 Zones manage domain DNS settings, enabling users to direct" " internet traffic for their domains through various DNS records." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "zone", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/route53/v2/hostedzones?region={region}#ListRecordSets/{id}", "arn_tpl": "arn:{partition}:route53:{region}:{account}:zone/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-hosted-zones", "HostedZones") reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -237,12 +239,14 @@ class AwsRoute53CidrRoutingConfig: @define(eq=False, slots=False) class AwsRoute53ResourceRecord(AwsResource, BaseDNSRecord): kind: ClassVar[str] = "aws_route53_resource_record" - kind_display: ClassVar[str] = "AWS Route 53 Resource Record" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:route53:::{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Route53 Resource Record" kind_description: ClassVar[str] = ( "Route 53 Resource Records are domain name system (DNS) records used by AWS" " Route 53 to route traffic to AWS resources or to external resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns_record", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:route53:::{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [], @@ -262,13 +266,15 @@ def service_name(cls) -> str: @define(eq=False, slots=False) class AwsRoute53ResourceRecordSet(AwsResource, BaseDNSRecordSet): kind: ClassVar[str] = "aws_route53_resource_record_set" - kind_display: ClassVar[str] = "AWS Route 53 Resource Record Set" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:route53::{account}:recordset/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS Route53 Resource Record Set" kind_description: ClassVar[str] = ( "Route 53 Resource Record Sets are DNS records that map domain names to IP" " addresses or other DNS resources, allowing users to manage domain name" " resolution in the Amazon Route 53 service." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:route53::{account}:recordset/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "successors": { "default": ["aws_route53_resource_record"], diff --git a/plugins/aws/fix_plugin_aws/resource/s3.py b/plugins/aws/fix_plugin_aws/resource/s3.py index fe9e917fb6..f029d9882c 100644 --- a/plugins/aws/fix_plugin_aws/resource/s3.py +++ b/plugins/aws/fix_plugin_aws/resource/s3.py @@ -171,6 +171,7 @@ class AwsS3Bucket(AwsResource, BaseBucket): "S3 buckets are simple storage containers in Amazon's cloud, offering a" " scalable storage solution for various types of data." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-buckets", "Buckets", override_iam_permission="s3:ListAllMyBuckets" ) @@ -450,12 +451,13 @@ class AwsS3AccountSettings(AwsResource, PhantomBaseResource): kind: ClassVar[str] = "aws_s3_account_settings" kind_display: ClassVar[str] = "AWS S3 Account Settings" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://s3.console.aws.amazon.com/s3/settings?region={region_id}", "arn_tpl": "arn:{partition}:s3control:{region}:{account}:account/{name}"} # fmt: skip - kind_description: ClassVar[str] = ( "AWS S3 Account Settings refer to the configuration options and preferences" " available for an Amazon S3 (Simple Storage Service) account." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "control"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://s3.console.aws.amazon.com/s3/settings?region={region_id}", "arn_tpl": "arn:{partition}:s3control:{region}:{account}:account/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_account"]}, "successors": {"default": ["aws_s3_bucket"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/sagemaker.py b/plugins/aws/fix_plugin_aws/resource/sagemaker.py index f286b177bb..dd7bb1e210 100644 --- a/plugins/aws/fix_plugin_aws/resource/sagemaker.py +++ b/plugins/aws/fix_plugin_aws/resource/sagemaker.py @@ -72,12 +72,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerNotebook(SagemakerTaggable, AwsResource): kind: ClassVar[str] = "aws_sagemaker_notebook" kind_display: ClassVar[str] = "AWS SageMaker Notebook" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:notebook/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Notebooks are a fully managed service by AWS that provides a" " Jupyter notebook environment for data scientists and developers to build," " train, and deploy machine learning models." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "function", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:notebook/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_ec2_subnet", "aws_ec2_security_group", "aws_iam_role", "aws_sagemaker_code_repository"], @@ -757,11 +759,13 @@ class AwsSagemakerAlgorithmStatusDetails: class AwsSagemakerAlgorithm(AwsResource): kind: ClassVar[str] = "aws_sagemaker_algorithm" kind_display: ClassVar[str] = "AWS SageMaker Algorithm" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:algorithm/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Algorithms are pre-built machine learning algorithms provided by" " Amazon SageMaker, which can be used to train and deploy predictive models." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:algorithm/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_iam_role"], "delete": ["aws_iam_role"]} } @@ -897,11 +901,13 @@ class AwsSagemakerVpcConfig: class AwsSagemakerModel(SagemakerTaggable, AwsResource): kind: ClassVar[str] = "aws_sagemaker_model" kind_display: ClassVar[str] = "AWS SageMaker Model" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:model/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Models are machine learning models built and trained using Amazon" " SageMaker, a fully-managed machine learning service by Amazon Web Services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:model/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_subnet", "aws_ec2_security_group"], @@ -995,12 +1001,14 @@ class AwsSagemakerResourceSpec: class AwsSagemakerApp(AwsResource): kind: ClassVar[str] = "aws_sagemaker_app" kind_display: ClassVar[str] = "AWS SageMaker App" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:app/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "The AWS SageMaker App facilitates the creation and management of machine learning applications, enabling" " users to engage in interactive model building and analysis. It provides a user-centric, customizable" " workspace, complete with monitoring of app health and activity." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:app/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_sagemaker_domain", "aws_sagemaker_user_profile"], @@ -1365,12 +1373,14 @@ class AwsSagemakerDefaultSpaceSettings: class AwsSagemakerDomain(AwsResource): kind: ClassVar[str] = "aws_sagemaker_domain" kind_display: ClassVar[str] = "AWS SageMaker Domain" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sagemaker/home?region={region}#/studio/{id}", "arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:domain/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "A SageMaker Domain in AWS is a dedicated, managed environment within Amazon SageMaker that provides" " data scientists and developers with the necessary tools and permissions to build, train, and deploy" " machine learning models." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sagemaker/home?region={region}#/studio/{id}", "arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:domain/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -1565,12 +1575,14 @@ class AwsSagemakerExperimentSource: class AwsSagemakerExperiment(AwsResource): kind: ClassVar[str] = "aws_sagemaker_experiment" kind_display: ClassVar[str] = "AWS SageMaker Experiment" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:experiment/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Experiment is a service in AWS that enables users to organize," " track and compare machine learning experiments and their associated" " resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:experiment/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-experiments", "ExperimentSummaries") mapping: ClassVar[Dict[str, Bender]] = { "id": S("ExperimentName"), @@ -1646,12 +1658,14 @@ class AwsSagemakerMetadataProperties: class AwsSagemakerTrial(AwsResource): kind: ClassVar[str] = "aws_sagemaker_trial" kind_display: ClassVar[str] = "AWS SageMaker Trial" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:trial/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS SageMaker Trial represents a series of steps, known as trial components, which lead to the creation of" " a machine learning model. It is nested within a single SageMaker experiment for organizational" " and tracking purposes." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:trial/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -1731,12 +1745,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerProject(AwsResource): kind: ClassVar[str] = "aws_sagemaker_project" kind_display: ClassVar[str] = "AWS SageMaker Project" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:project/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Projects in AWS provide a collaborative environment for machine" " learning teams to manage and track their ML workflows, datasets, models, and" " code." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:project/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-projects", "ProjectSummaryList") mapping: ClassVar[Dict[str, Bender]] = { "id": S("ProjectId"), @@ -1780,11 +1796,13 @@ class AwsSagemakerGitConfig: class AwsSagemakerCodeRepository(AwsResource): kind: ClassVar[str] = "aws_sagemaker_code_repository" kind_display: ClassVar[str] = "AWS SageMaker Code Repository" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:code-repository/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "The AWS SageMaker Code Repository is a managed Git-based code repository for storing and versioning" " your machine learning code, making it easy to maintain and share code within your SageMaker projects." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "repository", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:code-repository/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-code-repositories", "CodeRepositorySummaryList") mapping: ClassVar[Dict[str, Bender]] = { "id": S("CodeRepositoryName"), @@ -2244,11 +2262,13 @@ class AwsSagemakerExplainerConfig: class AwsSagemakerEndpoint(SagemakerTaggable, AwsResource): kind: ClassVar[str] = "aws_sagemaker_endpoint" kind_display: ClassVar[str] = "AWS SageMaker Endpoint" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:endpoint/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Endpoints are the locations where deployed machine learning models" " are hosted and can be accessed for making predictions or inferences." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:endpoint/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "delete": ["aws_kms_key"], @@ -2344,12 +2364,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerImage(AwsResource): kind: ClassVar[str] = "aws_sagemaker_image" kind_display: ClassVar[str] = "AWS SageMaker Image" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:image/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS SageMaker Images are pre-built machine learning environments that" " include all necessary frameworks and packages to train and deploy models" " using Amazon SageMaker." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:image/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role"], @@ -2436,11 +2458,13 @@ class AwsSagemakerArtifactSource: class AwsSagemakerArtifact(AwsResource): kind: ClassVar[str] = "aws_sagemaker_artifact" kind_display: ClassVar[str] = "AWS SageMaker Artifact" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:artifact/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An Amazon SageMaker artifact is used for tracking the origin and usage of data" " or models within ML workflows, providing a clear history for auditing and reproducibility." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:artifact/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -2523,12 +2547,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerUserProfile(AwsResource): kind: ClassVar[str] = "aws_sagemaker_user_profile" kind_display: ClassVar[str] = "AWS SageMaker User Profile" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:user-profile/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker User Profiles are user-specific configurations in Amazon SageMaker" " that define settings and permissions for users accessing the SageMaker" " Studio environment." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:user-profile/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_sagemaker_domain"]}, "successors": {"delete": ["aws_sagemaker_domain"]}, @@ -2568,12 +2594,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerPipeline(AwsResource): kind: ClassVar[str] = "aws_sagemaker_pipeline" kind_display: ClassVar[str] = "AWS SageMaker Pipeline" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:pipeline/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Pipelines is a fully managed, easy-to-use CI/CD service for" " building, automating, and managing end-to-end machine learning workflows on" " Amazon SageMaker." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:pipeline/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_sagemaker_user_profile", "aws_sagemaker_domain"], @@ -2704,12 +2732,14 @@ class AwsSagemakerMemberDefinition: class AwsSagemakerWorkteam(SagemakerTaggable, AwsResource): kind: ClassVar[str] = "aws_sagemaker_workteam" kind_display: ClassVar[str] = "AWS SageMaker Workteam" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:workteam/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Workteam is a service in Amazon's cloud that allows organizations" " to create and manage teams of workers to label data for machine learning" " models." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:workteam/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "successors": { "default": ["aws_cognito_user_pool", "aws_cognito_group", "aws_sns_topic"], @@ -2781,12 +2811,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSagemakerJob(AwsResource): kind: ClassVar[str] = "aws_sagemaker_job" kind_display: ClassVar[str] = "AWS SageMaker Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:job/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Jobs in AWS are used to train and deploy machine learning models" " at scale, with built-in algorithms and frameworks provided by Amazon" " SageMaker." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "generative_ai"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:job/{id}"} # fmt: skip @define(eq=False, slots=False) @@ -3107,13 +3139,13 @@ class AwsSagemakerModelDeployConfig: @define(eq=False, slots=False) class AwsSagemakerAutoMLJob(AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_auto_ml_job" - kind_display: ClassVar[str] = "AWS SageMaker AutoML Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:automl-job/{name}"} # fmt: skip + kind_display: ClassVar[str] = "AWS SageMaker Auto ML Job" kind_description: ClassVar[str] = ( "SageMaker AutoML Jobs in AWS provide automated machine learning" " capabilities, allowing users to automatically discover and build optimal" " machine learning models without manual intervention." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:automl-job/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_security_group", "aws_ec2_subnet"], @@ -3316,12 +3348,13 @@ class AwsSagemakerNeoVpcConfig: class AwsSagemakerCompilationJob(AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_compilation_job" kind_display: ClassVar[str] = "AWS SageMaker Compilation Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:compilation-job/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Compilation Job is a resource in Amazon SageMaker that allows" " users to compile machine learning models for deployment on edge devices or" " inference in the cloud." ) + kind_service = service_name + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:compilation-job/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_security_group", "aws_ec2_subnet"], @@ -3788,13 +3821,14 @@ class AwsSagemakerHyperParameterTuningJobWarmStartConfig: @define(eq=False, slots=False) class AwsSagemakerHyperParameterTuningJob(SagemakerTaggable, AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_hyper_parameter_tuning_job" - kind_display: ClassVar[str] = "AWS SageMaker Hyperparameter Tuning Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:hyperparameter-tuning-job/{id}"} # fmt: skip + kind_display: ClassVar[str] = "AWS SageMaker Hyper Parameter Tuning Job" kind_description: ClassVar[str] = ( "SageMaker Hyperparameter Tuning Job is an automated process in Amazon" " SageMaker that helps optimize the hyperparameters of a machine learning" " model to achieve better performance." ) + kind_service = service_name + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:hyperparameter-tuning-job/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_security_group", "aws_ec2_subnet"], @@ -4255,12 +4289,13 @@ class AwsSagemakerEndpointPerformance: class AwsSagemakerInferenceRecommendationsJob(AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_inference_recommendations_job" kind_display: ClassVar[str] = "AWS SageMaker Inference Recommendations Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:transform-job/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS SageMaker Inference Recommendations Job evaluates different configurations for deploying machine" " learning models, providing suggestions to optimize performance and efficiency, along with monitoring" " job progress and outcomes." ) + kind_service = service_name + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:transform-job/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ec2_security_group", "aws_ec2_subnet"], @@ -4605,11 +4640,11 @@ class AwsSagemakerLabelingJobOutput: class AwsSagemakerLabelingJob(SagemakerTaggable, AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_labeling_job" kind_display: ClassVar[str] = "AWS SageMaker Labeling Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:labeling-job/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Labeling Jobs are used to annotate and label data for training" " machine learning models in Amazon SageMaker." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:labeling-job/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -5002,12 +5037,12 @@ class AwsSagemakerNetworkConfig: class AwsSagemakerProcessingJob(AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_processing_job" kind_display: ClassVar[str] = "AWS SageMaker Processing Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:processing-job/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Processing Jobs provide a managed infrastructure for executing" " data processing tasks in Amazon SageMaker, enabling users to preprocess and" " analyze data efficiently." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:processing-job/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -5407,11 +5442,11 @@ class AwsSagemakerWarmPoolStatus: class AwsSagemakerTrainingJob(SagemakerTaggable, AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_training_job" kind_display: ClassVar[str] = "AWS SageMaker Training Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:sagemaker-training-job/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Training Job is a service provided by AWS that allows users to" " train machine learning models and build high-quality custom models." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:sagemaker-training-job/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -5651,12 +5686,12 @@ class AwsSagemakerDataProcessing: class AwsSagemakerTransformJob(SagemakerTaggable, AwsSagemakerJob): kind: ClassVar[str] = "aws_sagemaker_transform_job" kind_display: ClassVar[str] = "AWS SageMaker Transform Job" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:transform-job/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SageMaker Transform Jobs are used in Amazon SageMaker to transform input" " data using a trained model, generating output results for further analysis" " or inference." ) + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:transform-job/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ diff --git a/plugins/aws/fix_plugin_aws/resource/secretsmanager.py b/plugins/aws/fix_plugin_aws/resource/secretsmanager.py index 0e773f9751..44cf47aa3b 100644 --- a/plugins/aws/fix_plugin_aws/resource/secretsmanager.py +++ b/plugins/aws/fix_plugin_aws/resource/secretsmanager.py @@ -31,6 +31,8 @@ class AwsSecretsManagerSecret(AwsResource): api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-secrets", "SecretList") kind_display: ClassVar[str] = "AWS Secrets Manager Secret" kind_description: ClassVar[str] = "An AWS Secrets Manager Secret is used for securely storing and managing sensitive information, such as passwords, API keys, and database credentials, in AWS environments." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "access_control"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/secretsmanager/home?region={region}#/secret?name={name}", "arn_tpl": "arn:{partition}:secretsmanager:{region}:{account}:secret/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), diff --git a/plugins/aws/fix_plugin_aws/resource/service_quotas.py b/plugins/aws/fix_plugin_aws/resource/service_quotas.py index 6f1a1c5204..bfc0b4fef5 100644 --- a/plugins/aws/fix_plugin_aws/resource/service_quotas.py +++ b/plugins/aws/fix_plugin_aws/resource/service_quotas.py @@ -71,6 +71,7 @@ class AwsServiceQuota(AwsResource, BaseQuota): "AWS Service Quota is a feature that enables you to view and manage your" " quotas (also referred to as limits) for AWS services." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ diff --git a/plugins/aws/fix_plugin_aws/resource/sns.py b/plugins/aws/fix_plugin_aws/resource/sns.py index 7a9c19a40d..0a51ff0f10 100644 --- a/plugins/aws/fix_plugin_aws/resource/sns.py +++ b/plugins/aws/fix_plugin_aws/resource/sns.py @@ -21,13 +21,15 @@ class AwsSnsTopic(AwsResource): kind: ClassVar[str] = "aws_sns_topic" kind_display: ClassVar[str] = "AWS SNS Topic" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sns/v3/home?region={region}#/topic/{arn}", "arn_tpl": "arn:{partition}:sns:{region}:{account}:{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS SNS (Simple Notification Service) Topic is a publish-subscribe messaging" " service provided by Amazon Web Services. It allows applications, services," " and devices to send and receive notifications via email, SMS, push" " notifications, and more." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "queue", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sns/v3/home?region={region}#/topic/{arn}", "arn_tpl": "arn:{partition}:sns:{region}:{account}:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-topics", "Topics") reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -175,12 +177,14 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSnsSubscription(AwsResource): kind: ClassVar[str] = "aws_sns_subscription" kind_display: ClassVar[str] = "AWS SNS Subscription" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sns/v3/home?region={region}#/topic/{arn}", "arn_tpl": "arn:{partition}:sns:{region}:{account}:{name}"} # fmt: skip kind_description: ClassVar[str] = ( "SNS Subscriptions in AWS allow applications to receive messages from topics" " of interest using different protocols such as HTTP, email, SMS, or Lambda" " function invocation." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sns/v3/home?region={region}#/topic/{arn}", "arn_tpl": "arn:{partition}:sns:{region}:{account}:{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-subscriptions", "Subscriptions") reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_sns_topic", "aws_iam_role"], "delete": ["aws_iam_role"]}, @@ -261,13 +265,15 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsSnsEndpoint(AwsResource): # collection of endpoint resources happens in AwsSnsPlatformApplication.collect() kind: ClassVar[str] = "aws_sns_endpoint" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sns:{region}:{account}:endpoint/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS SNS Endpoint" kind_description: ClassVar[str] = ( "An endpoint in the AWS Simple Notification Service (SNS), which is used to" " send push notifications or SMS messages to mobile devices or other" " applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sns:{region}:{account}:endpoint/{id}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("Arn"), "arn": S("Arn"), @@ -294,12 +300,14 @@ def service_name(cls) -> str: class AwsSnsPlatformApplication(AwsResource): kind: ClassVar[str] = "aws_sns_platform_application" kind_display: ClassVar[str] = "AWS SNS Platform Application" - aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sns:{region}:{account}:platform-application/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS SNS Platform Application is a service that allows you to create a" " platform application and register it with Amazon SNS so that your" " application can receive push notifications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "networking"} + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sns:{region}:{account}:platform-application/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( service_name, "list-platform-applications", "PlatformApplications", expected_errors=["InvalidAction"] ) diff --git a/plugins/aws/fix_plugin_aws/resource/sqs.py b/plugins/aws/fix_plugin_aws/resource/sqs.py index a5854d3151..e9714bb2a4 100644 --- a/plugins/aws/fix_plugin_aws/resource/sqs.py +++ b/plugins/aws/fix_plugin_aws/resource/sqs.py @@ -38,12 +38,14 @@ class AwsSqsRedrivePolicy: class AwsSqsQueue(AwsResource, BaseQueue): kind: ClassVar[str] = "aws_sqs_queue" kind_display: ClassVar[str] = "AWS SQS Queue" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sqs/v3/home?region={region}#/queues/{QueueUrl}", "arn_tpl": "arn:{partition}:sqs:{region}:{account}:{id}"} # fmt: skip kind_description: ClassVar[str] = ( "SQS (Simple Queue Service) is a fully managed message queuing service" " provided by Amazon Web Services. It enables you to decouple and scale" " microservices, distributed systems, and serverless applications." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "queue", "group": "compute"} + aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/sqs/v3/home?region={region}#/queues/{QueueUrl}", "arn_tpl": "arn:{partition}:sqs:{region}:{account}:{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec(service_name, "list-queues", "QueueUrls") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_kms_key"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/ssm.py b/plugins/aws/fix_plugin_aws/resource/ssm.py index f96d1c70b6..e779ddd248 100644 --- a/plugins/aws/fix_plugin_aws/resource/ssm.py +++ b/plugins/aws/fix_plugin_aws/resource/ssm.py @@ -36,6 +36,8 @@ class AwsSSMInstance(AwsResource): kind: ClassVar[str] = "aws_ssm_instance" kind_display: ClassVar[str] = "AWS SSM Instance" kind_description: ClassVar[str] = "An AWS SSM Instance refers to an EC2 instance or a managed node that has been configured for management by AWS Systems Manager, enabling centralized and automated management of configuration, security, and software updates." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "control"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/systems-manager/fleet-manager/managed-nodes/{id}/general?region={region}", "arn_tpl": "arn:{partition}:ssm:{region}:{account}:instance/{name}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("ssm", "describe-instance-information", "InstanceInformationList") reference_kinds: ClassVar[ModelReference] = { @@ -151,6 +153,8 @@ class AwsSSMDocument(AwsResource): kind: ClassVar[str] = "aws_ssm_document" kind_display: ClassVar[str] = "AWS SSM Document" kind_description: ClassVar[str] = "An AWS Systems Manager (SSM) Document defines the actions that Systems Manager performs on your managed instances and other AWS resources." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/systems-manager/documents/{name}/description?region={region}", "arn_tpl": "arn:{partition}:ssm:{region}:{account}:document/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), @@ -349,6 +353,8 @@ class AwsSSMResourceCompliance(AwsResource): kind: ClassVar[str] = "aws_ssm_resource_compliance" kind_display: ClassVar[str] = "AWS SSM Resource Compliance" kind_description: ClassVar[str] = "AWS SSM Resource Compliance is used to track the compliance status of your resources in relation to your AWS Systems Manager (SSM) configurations and policies." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "control"} aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ssm:{region}:{account}:resource-compliance/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( "ssm", "list-resource-compliance-summaries", "ResourceComplianceSummaryItems" diff --git a/plugins/aws/fix_plugin_aws/resource/waf.py b/plugins/aws/fix_plugin_aws/resource/waf.py index fd48cf57b5..299eefe8cc 100644 --- a/plugins/aws/fix_plugin_aws/resource/waf.py +++ b/plugins/aws/fix_plugin_aws/resource/waf.py @@ -801,6 +801,8 @@ class AwsWafWebACL(AwsResource, BaseFirewall): kind: ClassVar[str] = "aws_waf_web_acl" kind_display: ClassVar[str] = "AWS WAF Web ACL" kind_description: ClassVar[str] = "An AWS WAF Web ACL (Web Access Control List) is used for monitoring HTTP and HTTPS requests directed to AWS resources, allowing you to control access by permitting or blocking specific requests based on defined criteria." # fmt: skip + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "access_control", "group": "networking"} aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/wafv2/homev2/web-acl/{name}/{id}/overview?region={region}", "arn_tpl": "arn:{partition}:wafv2:{region}:{account}:webacl/{id}"} # fmt: skip api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("wafv2", "get-web-acl", "WebACL") reference_kinds: ClassVar[ModelReference] = { diff --git a/plugins/azure/fix_plugin_azure/resource/authorization.py b/plugins/azure/fix_plugin_azure/resource/authorization.py index 1ed0cc4378..4e8d9b107c 100644 --- a/plugins/azure/fix_plugin_azure/resource/authorization.py +++ b/plugins/azure/fix_plugin_azure/resource/authorization.py @@ -1,6 +1,6 @@ import re from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field @@ -23,6 +23,8 @@ from fixlib.json_bender import Bender, S, ForallBend, Bend from fixlib.types import Json +service_name = "authorization" + @define(eq=False, slots=False) class AzureDenyAssignmentPermission: @@ -61,8 +63,11 @@ class AzurePrincipal: @define(eq=False, slots=False) class AzureAuthorizationDenyAssignment(MicrosoftResource): kind: ClassVar[str] = "azure_authorization_deny_assignment" + kind_display: ClassVar[str] = "Azure Authorization Deny Assignment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "access_control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="authorization", + service=service_name, version="2022-04-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/denyAssignments", path_parameters=["subscriptionId"], @@ -111,8 +116,11 @@ class AzureAuthorizationDenyAssignment(MicrosoftResource): @define(eq=False, slots=False) class AzureAuthorizationRoleAssignment(MicrosoftResource): kind: ClassVar[str] = "azure_authorization_role_assignment" + kind_display: ClassVar[str] = "Azure Authorization Role Assignment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "access_control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="authorization", + service=service_name, version="2022-04-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleAssignments", path_parameters=["subscriptionId"], @@ -215,8 +223,11 @@ class AzurePermission: @define(eq=False, slots=False) class AzureAuthorizationRoleDefinition(MicrosoftResource, BaseRole): kind: ClassVar[str] = "azure_authorization_role_definition" + kind_display: ClassVar[str] = "Azure Authorization Role Definition" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "role", "group": "access_control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="authorization", + service=service_name, version="2022-04-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/roleDefinitions", path_parameters=["subscriptionId"], @@ -251,6 +262,9 @@ class AzureAuthorizationRoleDefinition(MicrosoftResource, BaseRole): @define(eq=False, slots=False) class AzureAuthorizationManagementLock(MicrosoftResource): kind: ClassVar[str] = "azure_authorization_management_lock" + kind_display: ClassVar[str] = "Azure Authorization Management Lock" + kind_service: ClassVar[Optional[str]] = "resources" + metadata: ClassVar[Dict[str, Any]] = {"icon": "lock", "group": "access_control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="resources", version="2020-05-01", diff --git a/plugins/azure/fix_plugin_azure/resource/base.py b/plugins/azure/fix_plugin_azure/resource/base.py index 93554ff99c..957a6b6e53 100644 --- a/plugins/azure/fix_plugin_azure/resource/base.py +++ b/plugins/azure/fix_plugin_azure/resource/base.py @@ -306,6 +306,9 @@ class AzureAvailabilityZoneMappings: @define(eq=False, slots=False) class AzureLocation(MicrosoftResource, BaseRegion): kind: ClassVar[str] = "azure_location" + kind_display: ClassVar[str] = "Azure Location" + kind_service: ClassVar[str] = "resources" + metadata: ClassVar[Dict[str, Any]] = {"icon": "region", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="resources", version="2022-12-01", @@ -339,6 +342,9 @@ class AzureLocation(MicrosoftResource, BaseRegion): @define(eq=False, slots=False) class AzureResourceGroup(MicrosoftResource, BaseGroup): kind: ClassVar[str] = "azure_resource_group" + kind_display: ClassVar[str] = "Azure Resource Group" + kind_service: ClassVar[str] = "resources" + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="resources", version="2022-09-01", @@ -539,6 +545,9 @@ class AzureSubscriptionPolicies: @define(eq=False, slots=False) class AzureSubscription(MicrosoftResource, BaseAccount): kind: ClassVar[str] = "azure_subscription" + kind_display: ClassVar[str] = "Azure Subscription" + kind_service: ClassVar[str] = "resources" + metadata: ClassVar[Dict[str, Any]] = {"icon": "account", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="resources", version="2022-12-01", diff --git a/plugins/azure/fix_plugin_azure/resource/compute.py b/plugins/azure/fix_plugin_azure/resource/compute.py index b7928e186f..92b77cf47c 100644 --- a/plugins/azure/fix_plugin_azure/resource/compute.py +++ b/plugins/azure/fix_plugin_azure/resource/compute.py @@ -67,6 +67,9 @@ class AzureInstanceViewStatus: @define(eq=False, slots=False) class AzureComputeAvailabilitySet(MicrosoftResource): kind: ClassVar[str] = "azure_compute_availability_set" + kind_display: ClassVar[str] = "Azure Compute Availability Set" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -119,6 +122,9 @@ class AzureComputeCapacityReservationGroupInstanceView: @define(eq=False, slots=False) class AzureComputeCapacityReservationGroup(MicrosoftResource): kind: ClassVar[str] = "azure_compute_capacity_reservation_group" + kind_display: ClassVar[str] = "Azure Compute Capacity Reservation Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -292,6 +298,9 @@ class AzureCloudServiceExtensionProfile: @define(eq=False, slots=False) class AzureComputeCloudService(MicrosoftResource): kind: ClassVar[str] = "azure_compute_cloud_service" + kind_display: ClassVar[str] = "Azure Compute Cloud Service" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "service", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2022-09-04", @@ -344,6 +353,9 @@ class AzureDedicatedHostGroupInstanceView: @define(eq=False, slots=False) class AzureComputeDedicatedHostGroup(MicrosoftResource): kind: ClassVar[str] = "azure_compute_dedicated_host_group" + kind_display: ClassVar[str] = "Azure Compute Dedicated Host Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -707,6 +719,9 @@ class AzurePricingOffers: @define(eq=False, slots=False) class AzureComputeDiskTypePricing(MicrosoftResource): kind: ClassVar[str] = "azure_compute_disk_type_pricing" + kind_display: ClassVar[str] = "Azure Compute Disk Type Pricing" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="", @@ -729,6 +744,9 @@ class AzureComputeDiskTypePricing(MicrosoftResource): @define(eq=False, slots=False) class AzureComputeDiskType(MicrosoftResource, BaseVolumeType): kind: ClassVar[str] = "azure_compute_disk_type" + kind_display: ClassVar[str] = "Azure Compute Disk Type" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "storage"} # Collect via AzureComputeDisk() mapping: ClassVar[Dict[str, Bender]] = { "id": S("skuName"), @@ -910,6 +928,9 @@ def create_unique_disk_sizes(collected_disks: List[MicrosoftResourceType], build @define(eq=False, slots=False) class AzureComputeDisk(MicrosoftResource, BaseVolume): kind: ClassVar[str] = "azure_compute_disk" + kind_display: ClassVar[str] = "Azure Compute Disk" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "volume", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-01-02", @@ -1162,6 +1183,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureComputeDiskAccess(MicrosoftResource): kind: ClassVar[str] = "azure_compute_disk_access" + kind_display: ClassVar[str] = "Azure Compute Disk Access" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-01-02", @@ -1247,6 +1271,9 @@ class AzureApiError: @define(eq=False, slots=False) class AzureComputeDiskEncryptionSet(MicrosoftResource): kind: ClassVar[str] = "azure_compute_disk_encryption_set" + kind_display: ClassVar[str] = "Azure Compute Disk Encryption Set" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-01-02", @@ -1345,6 +1372,9 @@ class AzureSharingStatus: @define(eq=False, slots=False) class AzureComputeGallery(MicrosoftResource): kind: ClassVar[str] = "azure_compute_gallery" + kind_display: ClassVar[str] = "Azure Compute Gallery" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2022-03-03", @@ -1417,6 +1447,9 @@ class AzureImageStorageProfile: @define(eq=False, slots=False) class AzureComputeImage(MicrosoftResource): kind: ClassVar[str] = "azure_compute_image" + kind_display: ClassVar[str] = "Azure Compute Image" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -1461,6 +1494,9 @@ class AzureVmSizes: @define(eq=False, slots=False) class AzureComputeProximityPlacementGroup(MicrosoftResource): kind: ClassVar[str] = "azure_compute_proximity_placement_group" + kind_display: ClassVar[str] = "Azure Compute Proximity Placement Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -1978,6 +2014,9 @@ class AzureRestorePoint(AzureProxyResource): @define(eq=False, slots=False) class AzureComputeRestorePointCollection(MicrosoftResource): kind: ClassVar[str] = "azure_compute_restore_point_collection" + kind_display: ClassVar[str] = "Azure Compute Restore Point Collection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "snapshot", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -2030,6 +2069,9 @@ class AzureCopyCompletionError: @define(eq=False, slots=False) class AzureComputeVirtualMachineSnapshot(MicrosoftResource, BaseSnapshot): kind: ClassVar[str] = "azure_compute_virtual_machine_snapshot" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine Snapshot" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "snapshot", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-01-02", @@ -2118,6 +2160,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureComputeSshPublicKey(MicrosoftResource, BaseKeyPair): kind: ClassVar[str] = "azure_compute_ssh_public_key" + kind_display: ClassVar[str] = "Azure Compute SSH Public Key" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -2754,6 +2799,9 @@ class AzureVirtualMachineIdentity: @define(eq=False, slots=False) class AzureComputeVirtualMachineBase(MicrosoftResource, BaseInstance): kind: ClassVar[str] = "azure_compute_virtual_machine_base" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "compute"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": [ @@ -3047,6 +3095,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureComputeVirtualMachine(AzureComputeVirtualMachineBase): kind: ClassVar[str] = "azure_compute_virtual_machine" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine" api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -3497,6 +3546,9 @@ class AzureVirtualMachineScaleSetIdentity: @define(eq=False, slots=False) class AzureComputeVirtualMachineScaleSet(MicrosoftResource, BaseAutoScalingGroup): kind: ClassVar[str] = "azure_compute_virtual_machine_scale_set" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine Scale Set" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "autoscaling_group", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="compute", version="2023-03-01", @@ -3624,6 +3676,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureComputeVirtualMachineSize(MicrosoftResource, BaseInstanceType): kind: ClassVar[str] = "azure_compute_virtual_machine_size" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine Size" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "compute"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("name"), "tags": S("tags", default={}), @@ -3668,6 +3723,7 @@ class AzureComputeVirtualMachineScaleSetInstance(AzureComputeVirtualMachineBase) # note: instances are collected as part of collecting AzureComputeVirtualMachineScaleSet kind: ClassVar[str] = "azure_compute_virtual_machine_scale_set_instance" + kind_display: ClassVar[str] = "Azure Compute Virtual Machine Scale Set Instance" resources: List[Type[MicrosoftResource]] = [ diff --git a/plugins/azure/fix_plugin_azure/resource/containerservice.py b/plugins/azure/fix_plugin_azure/resource/containerservice.py index 7bbd235d39..e307a98183 100644 --- a/plugins/azure/fix_plugin_azure/resource/containerservice.py +++ b/plugins/azure/fix_plugin_azure/resource/containerservice.py @@ -1,6 +1,6 @@ import logging from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Tuple, Type +from typing import ClassVar, Dict, Optional, List, Tuple, Type, Any from attr import define, field @@ -18,7 +18,7 @@ from fixlib.json_bender import Bender, S, Bend, ForallBend from fixlib.types import Json -service = "azure_container_service" +service_name = "azure_container_service" log = logging.getLogger("fix.plugins.azure") @@ -65,6 +65,9 @@ class AzureFleetHubProfile: @define(eq=False, slots=False) class AzureContainerServiceFleet(MicrosoftResource): kind: ClassVar[str] = "azure_container_service_fleet" + kind_display: ClassVar[str] = "Azure Container Service Fleet" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "managed_kubernetes"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="containerservice", version="2023-08-15-preview", @@ -116,7 +119,7 @@ def collect_fleets() -> None: except KeyError as e: log.warning(f"An error occured while taking cluster id: {e}") - graph_builder.submit_work(service, collect_fleets) + graph_builder.submit_work(service_name, collect_fleets) def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: if cluster_ids := self._cluster_resource_ids: @@ -745,6 +748,9 @@ class AzureServiceMeshProfile: @define(eq=False, slots=False) class AzureContainerServiceManagedCluster(MicrosoftResource, BaseManagedKubernetesClusterProvider): kind: ClassVar[str] = "azure_container_service_managed_cluster" + kind_display: ClassVar[str] = "Azure Container Service Managed Cluster" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "managed_kubernetes"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="containerservice", version="2023-08-01", @@ -887,6 +893,9 @@ def _get_poolnames_and_vmss_ids(self, builder: GraphBuilder) -> List[Tuple[str, @define(eq=False, slots=False) class AzureContainerServiceManagedClusterSnapshot(MicrosoftResource, BaseSnapshot): kind: ClassVar[str] = "azure_container_service_managed_cluster_snapshot" + kind_display: ClassVar[str] = "Azure Container Service Managed Cluster Snapshot" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "snapshot", "group": "managed_kubernetes"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="containerservice", version="2023-08-01", diff --git a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py index d294399c49..21793cbaff 100644 --- a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py +++ b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py @@ -2,7 +2,7 @@ from datetime import datetime import logging -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field @@ -164,6 +164,9 @@ class AzureCosmosDbNodes: @define(eq=False, slots=False) class AzureCosmosDBCassandraClusterPublicStatus(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_cassandra_cluster_public_status" + kind_display: ClassVar[str] = "Azure Cosmos DB Cassandra Cluster Public Status" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "database"} # Collect via AzureCosmosDBCassandraCluster() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -225,6 +228,9 @@ class AzureCassandraKeyspace(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBCassandraKeyspace(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_cassandra_keyspace" + kind_display: ClassVar[str] = "Azure Cosmos DB Cassandra Keyspace" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -315,6 +321,9 @@ class AzureCassandraTable(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBCassandraTable(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_cassandra_table" + kind_display: ClassVar[str] = "Azure Cosmos DB Cassandra Table" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBCassandraKeyspace() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -360,6 +369,9 @@ class AzureClientEncryptionKey(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBSqlDatabaseClientEncryptionKey(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_database_client_encryption_key" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Database Client Encryption Key" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBSqlDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -386,6 +398,9 @@ class AzureManagedCassandraManagedServiceIdentity: @define(eq=False, slots=False) class AzureCosmosDBCassandraCluster(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_cassandra_cluster" + kind_display: ClassVar[str] = "Azure Cosmos DB Cassandra Cluster" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2024-05-15", @@ -547,6 +562,9 @@ class AzureAuthenticationMethodLdap: @define(eq=False, slots=False) class AzureCosmosDBCassandraClusterDataCenter(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_cassandra_cluster_data_center" + kind_display: ClassVar[str] = "Azure Cosmos DB Cassandra Cluster Data Center" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} # Collect via AzureCosmosDBCassandraCluster() reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -768,6 +786,9 @@ class AzureDatabaseAccountKeysMetadata: @define(eq=False, slots=False) class AzureCosmosDBAccount(MicrosoftResource, BaseDatabase): kind: ClassVar[str] = "azure_cosmos_db_account" + kind_display: ClassVar[str] = "Azure Cosmos DB Account" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "account", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2024-05-15", @@ -1065,6 +1086,9 @@ class AzureGremlinDatabase(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBGremlinDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_gremlin_database" + kind_display: ClassVar[str] = "Azure Cosmos DB Gremlin Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1235,6 +1259,9 @@ class AzureGremlinGraph(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBGremlinGraph(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_gremlin_graph" + kind_display: ClassVar[str] = "Azure Cosmos DB Gremlin Graph" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBGremlinDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1295,6 +1322,9 @@ class AzureMongoDBCollection(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBMongoDBCollection(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_mongo_db_collection" + kind_display: ClassVar[str] = "Azure Cosmos DB Mongo DB Collection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBMongoDBDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1323,6 +1353,9 @@ class AzureMongoDBDatabase(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBMongoDBDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_mongo_db_database" + kind_display: ClassVar[str] = "Azure Cosmos DB Mongo DB Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1394,6 +1427,9 @@ class AzureRole: @define(eq=False, slots=False) class AzureCosmosDBMongoDBRoleDefinition(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_mongo_db_role_definition" + kind_display: ClassVar[str] = "Azure Cosmos DB Mongo DB Role Definition" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "role", "group": "access_control"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1413,6 +1449,9 @@ class AzureCosmosDBMongoDBRoleDefinition(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBMongoDBUserDefinition(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_mongo_db_user_definition" + kind_display: ClassVar[str] = "Azure Cosmos DB Mongo DB User Definition" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "access_control"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1436,6 +1475,9 @@ class AzureCosmosDBMongoDBUserDefinition(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBNotebookWorkspace(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_notebook_workspace" + kind_display: ClassVar[str] = "Azure Cosmos DB Notebook Workspace" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1451,6 +1493,9 @@ class AzureCosmosDBNotebookWorkspace(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBPrivateLink(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_private_link" + kind_display: ClassVar[str] = "Azure Cosmos DB Private Link" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "networking"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1483,6 +1528,9 @@ class AzureRestorableLocationResource: @define(eq=False, slots=False) class AzureCosmosDBRestorableAccount(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_account" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Account" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2024-05-15", @@ -1660,6 +1708,9 @@ class AzureSqlContainer(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBSqlDatabaseContainer(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_database_container" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Database Container" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBSqlDatabase() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1720,6 +1771,9 @@ class AzureCollsUsers(AzureSqlDatabaseResource, AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBSqlDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_database" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1789,6 +1843,9 @@ def post_process(self, graph_builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureCosmosDBSqlRoleAssignment(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_role_assignment" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Role Assignment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "access_control"} # Collect via AzureCosmosDBAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1841,6 +1898,9 @@ class AzureRolePermission: @define(eq=False, slots=False) class AzureCosmosDBSqlRoleDefinition(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_role_definition" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Role Definition" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "role", "group": "access_control"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1871,6 +1931,9 @@ class AzureDbTable(AzureCosmosDBResource): @define(eq=False, slots=False) class AzureCosmosDBTable(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_table" + kind_display: ClassVar[str] = "Azure Cosmos DB Table" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1886,6 +1949,9 @@ class AzureCosmosDBTable(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBSqlThroughputSetting(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_sql_throughput_setting" + kind_display: ClassVar[str] = "Azure Cosmos DB SQL Throughput Setting" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "database"} # Collect via AzureCosmosDBSqlDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1899,6 +1965,9 @@ class AzureCosmosDBSqlThroughputSetting(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBAccountUsage(MicrosoftResource, AzureBaseUsage): kind: ClassVar[str] = "azure_cosmos_db_account_usage" + kind_display: ClassVar[str] = "Azure Cosmos DB Account Usage" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} # Collect via AzureCosmosDBAccount() mapping: ClassVar[Dict[str, Bender]] = AzureBaseUsage.mapping | { "id": K(None), @@ -1923,6 +1992,9 @@ def collect_usages(cls, account_id: str, raw: List[Json], builder: GraphBuilder) @define(eq=False, slots=False) class AzureCosmosDBLocation(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_location" + kind_display: ClassVar[str] = "Azure Cosmos DB Location" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "region", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2024-05-15", @@ -1984,6 +2056,9 @@ class AzureNodeGroupSpec: @define(eq=False, slots=False) class AzureCosmosDBMongoDBCluster(MicrosoftResource, AzureTrackedResource): kind: ClassVar[str] = "azure_cosmos_db_mongo_db_cluster" + kind_display: ClassVar[str] = "Azure Cosmos DB Mongo DB Cluster" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2024-02-15-preview", @@ -2044,6 +2119,9 @@ class AzureRestorableDatabase: @define(eq=False, slots=False) class AzureCosmosDBRestorableGremlinDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_gremlin_database" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Gremlin Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -2087,6 +2165,9 @@ def collect_restorable_graphs() -> None: @define(eq=False, slots=False) class AzureCosmosDBRestorableGremlinGraph(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_gremlin_graph" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Gremlin Graph" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2100,6 +2181,9 @@ class AzureCosmosDBRestorableGremlinGraph(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBRestorableMongoDBCollection(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_mongo_db_collection" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Mongo DB Collection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2113,6 +2197,9 @@ class AzureCosmosDBRestorableMongoDBCollection(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBRestorableMongoDBDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_mongo_db_database" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Mongo DB Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -2156,6 +2243,9 @@ def collect_restorable_collections() -> None: @define(eq=False, slots=False) class AzureCosmosDBRestorableSqlContainer(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_sql_container" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable SQL Container" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2200,6 +2290,9 @@ class AzureExtendedPropertiesSqlDatabase(AzureSqlDatabaseResource): @define(eq=False, slots=False) class AzureCosmosDBRestorableSqlDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_sql_database" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable SQL Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -2257,6 +2350,9 @@ def collect_restorable_containers() -> None: @define(eq=False, slots=False) class AzureCosmosDBRestorableTable(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_restorable_table" + kind_display: ClassVar[str] = "Azure Cosmos DB Restorable Table" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureCosmosDBRestorableAccount() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2296,6 +2392,9 @@ class AzureServerNameItem: @define(eq=False, slots=False) class AzureCosmosDBPostgresqlCluster(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="cosmos-db", version="2022-11-08", @@ -2447,6 +2546,9 @@ def post_process(self, graph_builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterServer(MicrosoftResource, BaseDatabase, AzureProxyResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_server" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Server" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "database"} # Collect via AzureCosmosDBPostgresqlCluster() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -2539,6 +2641,9 @@ def collect_server_configs() -> None: @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterConfiguration(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_configuration" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} # Collect via AzureCosmosDBPostgresqlCluster() config: Json = field(factory=dict) @@ -2574,6 +2679,9 @@ def collect_configs( @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterServerConfiguration(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_server_configuration" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Server Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "database"} # Collect via AzureCosmosDBPostgresqlClusterServer() config: Json = field(factory=dict) @@ -2608,6 +2716,9 @@ def collect_configs( @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterPrivateEndpointConnection(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_private_endpoint_connection" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Private Endpoint Connection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} # Collect via AzureCosmosDBPostgresqlCluster() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2631,6 +2742,9 @@ class AzureCosmosDBPostgresqlClusterPrivateEndpointConnection(MicrosoftResource) @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterPrivateLink(MicrosoftResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_private_link" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Private Link" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "networking"} # Collect via AzureCosmosDBPostgresqlCluster() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -2652,6 +2766,9 @@ class AzureCosmosDBPostgresqlClusterPrivateLink(MicrosoftResource): @define(eq=False, slots=False) class AzureCosmosDBPostgresqlClusterRole(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_cosmos_db_postgresql_cluster_role" + kind_display: ClassVar[str] = "Azure Cosmos DB PostgreSQL Cluster Role" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "role", "group": "access_control"} # Collect via AzureCosmosDBPostgresqlCluster() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), diff --git a/plugins/azure/fix_plugin_azure/resource/keyvault.py b/plugins/azure/fix_plugin_azure/resource/keyvault.py index 3355e89898..ded422ec02 100644 --- a/plugins/azure/fix_plugin_azure/resource/keyvault.py +++ b/plugins/azure/fix_plugin_azure/resource/keyvault.py @@ -2,7 +2,7 @@ import logging from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field @@ -183,6 +183,9 @@ class AzureKeyReleasePolicy: @define(eq=False, slots=False) class AzureKeyVaultSecret(MicrosoftResource): kind: ClassVar[str] = "azure_key_vault_secret" + kind_display: ClassVar[str] = "Azure Key Vault Secret" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "control"} # collected via AzureKeyVault mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -206,6 +209,9 @@ class AzureKeyVaultSecret(MicrosoftResource): @define(eq=False, slots=False) class AzureKeyVaultManagedHsm(MicrosoftResource): kind: ClassVar[str] = "azure_key_vault_managed_hsm" + kind_display: ClassVar[str] = "Azure Key Vault Managed Hsm" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="keyvault", version="2023-07-01", @@ -266,6 +272,9 @@ class AzureKeyVaultManagedHsm(MicrosoftResource): @define(eq=False, slots=False) class AzureKeyVaultKey(MicrosoftResource): kind: ClassVar[str] = "azure_key_vault_key" + kind_display: ClassVar[str] = "Azure Key Vault Key" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "control"} # collected via AzureKeyVault mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -297,6 +306,9 @@ class AzureKeyVaultKey(MicrosoftResource): @define(eq=False, slots=False) class AzureKeyVault(MicrosoftResource): kind: ClassVar[str] = "azure_key_vault" + kind_display: ClassVar[str] = "Azure Key Vault" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "vault", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="keyvault", version="2023-07-01", diff --git a/plugins/azure/fix_plugin_azure/resource/machinelearning.py b/plugins/azure/fix_plugin_azure/resource/machinelearning.py index 5582e5f02e..98e02f51c1 100644 --- a/plugins/azure/fix_plugin_azure/resource/machinelearning.py +++ b/plugins/azure/fix_plugin_azure/resource/machinelearning.py @@ -66,6 +66,9 @@ class AzureEndpointAuthKeys: @define(eq=False, slots=False) class AzureMachineLearningBatchEndpoint(MicrosoftResource, AzureTrackedResource): kind: ClassVar[str] = "azure_machine_learning_batch_endpoint" + kind_display: ClassVar[str] = "Azure Machine Learning Batch Endpoint" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": {"default": [MicrosoftGraphServicePrincipal.kind, MicrosoftGraphUser.kind]}, @@ -121,6 +124,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningCodeContainerBase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_code_container_base" + kind_display: ClassVar[str] = "Azure Machine Learning Code Container Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -146,6 +152,7 @@ class AzureMachineLearningCodeContainerBase(MicrosoftResource, AzureProxyResourc class AzureMachineLearningWorkspaceCodeContainer(AzureMachineLearningCodeContainerBase): # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_code_container" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Code Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -181,6 +188,7 @@ def collect_versions() -> None: class AzureMachineLearningRegistryCodeContainer(AzureMachineLearningCodeContainerBase): # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_code_container" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Code Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -215,6 +223,9 @@ def collect_versions() -> None: @define(eq=False, slots=False) class AzureMachineLearningCodeVersionBase(CheckVersionIsArchived, MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_code_version_base" + kind_display: ClassVar[str] = "Azure Machine Learning Code Version Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningCodeContainerBase() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -240,17 +251,23 @@ class AzureMachineLearningCodeVersionBase(CheckVersionIsArchived, MicrosoftResou class AzureMachineLearningWorkspaceCodeVersion(AzureMachineLearningCodeVersionBase): # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_code_version" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Code Version" @define(eq=False, slots=False) class AzureMachineLearningRegistryCodeVersion(AzureMachineLearningCodeVersionBase): # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_code_version" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Code Version" + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} @define(eq=False, slots=False) class AzureMachineLearningComponentContainerBase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_component_container_base" + kind_display: ClassVar[str] = "Azure Machine Learning Component Container Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -277,6 +294,7 @@ class AzureMachineLearningWorkspaceComponentContainer(AzureMachineLearningCompon # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_component_container" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Component Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -313,6 +331,7 @@ class AzureMachineLearningRegistryComponentContainer(AzureMachineLearningCompone # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_component_container" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Component Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -347,6 +366,9 @@ def collect_versions() -> None: @define(eq=False, slots=False) class AzureMachineLearningComponentVersionBase(CheckVersionIsArchived, MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_component_version_base" + kind_display: ClassVar[str] = "Azure Machine Learning Component Version Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningComponentContainerBase() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -374,6 +396,7 @@ class AzureMachineLearningWorkspaceComponentVersion(AzureMachineLearningComponen # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_component_version" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Component Version" @define(eq=False, slots=False) @@ -381,11 +404,16 @@ class AzureMachineLearningRegistryComponentVersion(AzureMachineLearningComponent # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_component_version" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Component Version" + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} @define(eq=False, slots=False) class AzureMachineLearningComputeNode(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_compute_node" + kind_display: ClassVar[str] = "Azure Machine Learning Compute Node" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "compute"} # Collected via AzureMachineLearningCompute() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("nodeId"), @@ -435,6 +463,9 @@ class AzureErrorResponse: @define(eq=False, slots=False) class AzureMachineLearningCompute(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_compute" + kind_display: ClassVar[str] = "Azure Machine Learning Compute" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "compute"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -561,6 +592,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningDataContainerBase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_data_container_base" + kind_display: ClassVar[str] = "Azure Machine Learning Data Container Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -587,6 +621,7 @@ class AzureMachineLearningWorkspaceDataContainer(AzureMachineLearningDataContain # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_data_container" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Data Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -623,6 +658,7 @@ class AzureMachineLearningRegistryDataContainer(AzureMachineLearningDataContaine # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_data_container" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Data Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -657,6 +693,9 @@ def collect_versions() -> None: @define(eq=False, slots=False) class AzureMachineLearningDataVersionBase(CheckVersionIsArchived, MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_data_version_base" + kind_display: ClassVar[str] = "Azure Machine Learning Data Version Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningDataContainerBase() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -686,6 +725,7 @@ class AzureMachineLearningWorkspaceDataVersion(AzureMachineLearningDataVersionBa # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_data_version" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Data Version" @define(eq=False, slots=False) @@ -693,11 +733,16 @@ class AzureMachineLearningRegistryDataVersion(AzureMachineLearningDataVersionBas # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_data_version" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Data Version" + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} @define(eq=False, slots=False) class AzureMachineLearningDatastore(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_datastore" + kind_display: ClassVar[str] = "Azure Machine Learning Datastore" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "storage"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -740,6 +785,9 @@ class AzureEndpointDeploymentResourcePropertiesBasicResource: @define(eq=False, slots=False) class AzureMachineLearningEndpoint(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_endpoint" + kind_display: ClassVar[str] = "Azure Machine Learning Endpoint" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -798,6 +846,9 @@ class AzureInferenceContainerProperties: @define(eq=False, slots=False) class AzureMachineLearningEnvironmentContainerBase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_environment_container_base" + kind_display: ClassVar[str] = "Azure Machine Learning Environment Container Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -824,6 +875,7 @@ class AzureMachineLearningWorkspaceEnvironmentContainer(AzureMachineLearningEnvi # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_environment_container" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Environment Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -860,6 +912,7 @@ class AzureMachineLearningRegistryEnvironmentContainer(AzureMachineLearningEnvir # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_environment_container" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Environment Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -894,6 +947,9 @@ def collect_versions() -> None: @define(eq=False, slots=False) class AzureMachineLearningEnvironmentVersionBase(CheckVersionIsArchived, MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_environment_version_base" + kind_display: ClassVar[str] = "Azure Machine Learning Environment Version Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningEnvironmentContainerBase() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -935,6 +991,7 @@ class AzureMachineLearningWorkspaceEnvironmentVersion(AzureMachineLearningEnviro # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_environment_version" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Environment Version" @define(eq=False, slots=False) @@ -942,11 +999,16 @@ class AzureMachineLearningRegistryEnvironmentVersion(AzureMachineLearningEnviron # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_environment_version" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Environment Version" + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} @define(eq=False, slots=False) class AzureMachineLearningFeature(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_feature" + kind_display: ClassVar[str] = "Azure Machine Learning Feature" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningFeaturesetVersion() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -1047,6 +1109,9 @@ class AzureMaterializationSettings: @define(eq=False, slots=False) class AzureMachineLearningFeaturesetContainer(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_featureset_container" + kind_display: ClassVar[str] = "Azure Machine Learning Featureset Container" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1100,6 +1165,9 @@ def collect_versions() -> None: @define(eq=False, slots=False) class AzureMachineLearningFeaturesetVersion(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_featureset_version" + kind_display: ClassVar[str] = "Azure Machine Learning Featureset Version" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} # Collected via AzureMachineLearningFeaturesetContainer() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1161,6 +1229,9 @@ def collect_features() -> None: @define(eq=False, slots=False) class AzureMachineLearningFeaturestoreEntityContainer(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_featurestore_entity_container" + kind_display: ClassVar[str] = "Azure Machine Learning Featurestore Entity Container" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -1222,6 +1293,9 @@ class AzureIndexColumn: @define(eq=False, slots=False) class AzureMachineLearningFeaturestoreEntityVersion(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_featurestore_entity_version" + kind_display: ClassVar[str] = "Azure Machine Learning Featurestore Entity Version" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} # Collected via AzureMachineLearningFeaturestoreEntityContainer() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -1270,6 +1344,9 @@ class AzureJobService: @define(eq=False, slots=False) class AzureMachineLearningJob(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_job" + kind_display: ClassVar[str] = "Azure Machine Learning Job" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -1436,6 +1513,9 @@ class AzureStatusMessage: @define(eq=False, slots=False) class AzureMachineLearningLabelingJob(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_labeling_job" + kind_display: ClassVar[str] = "Azure Machine Learning Labeling Job" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "generative_ai"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), "tags": S("tags", default={}), @@ -1474,6 +1554,9 @@ class AzureMachineLearningLabelingJob(MicrosoftResource): @define(eq=False, slots=False) class AzureMachineLearningModelContainerBase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_model_container_base" + kind_display: ClassVar[str] = "Azure Machine Learning Model Container Base" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "container", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -1500,6 +1583,7 @@ class AzureMachineLearningWorkspaceModelContainer(AzureMachineLearningModelConta # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_model_container" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Model Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -1536,6 +1620,7 @@ class AzureMachineLearningRegistryModelContainer(AzureMachineLearningModelContai # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_model_container" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Model Container" reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -1577,6 +1662,9 @@ class AzureFlavorData: @define(eq=False, slots=False) class AzureMachineLearningModelVersionBase(CheckVersionIsArchived, MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_base_model_version" + kind_display: ClassVar[str] = "Azure Machine Learning Base Model Version" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "generative_ai"} # Collected via AzureMachineLearningModelContainerBase() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -1612,6 +1700,7 @@ class AzureMachineLearningWorkspaceModelVersion(AzureMachineLearningModelVersion # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_workspace_model_version" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Model Version" @define(eq=False, slots=False) @@ -1619,11 +1708,15 @@ class AzureMachineLearningRegistryModelVersion(AzureMachineLearningModelVersionB # Defined to split registry and workspace resource kind: ClassVar[str] = "azure_machine_learning_registry_model_version" + kind_display: ClassVar[str] = "Azure Machine Learning Registry Model Version" @define(eq=False, slots=False) class AzureMachineLearningOnlineEndpoint(MicrosoftResource, AzureTrackedResource): kind: ClassVar[str] = "azure_machine_learning_online_endpoint" + kind_display: ClassVar[str] = "Azure Machine Learning Online Endpoint" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -1687,6 +1780,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningPrivateEndpointConnection(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_private_endpoint_connection" + kind_display: ClassVar[str] = "Azure Machine Learning Private Endpoint Connection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "connection", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": {"default": [MicrosoftGraphServicePrincipal.kind, MicrosoftGraphUser.kind]}, @@ -1735,6 +1831,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningPrivateLink(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_private_link" + kind_display: ClassVar[str] = "Azure Machine Learning Private Link" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": {"default": [MicrosoftGraphServicePrincipal.kind, MicrosoftGraphUser.kind]}, @@ -1894,6 +1993,9 @@ class AzureRegistryRegionArmDetails: @define(eq=False, slots=False) class AzureMachineLearningRegistry(MicrosoftResource, AzureTrackedResource): kind: ClassVar[str] = "azure_machine_learning_registry" + kind_display: ClassVar[str] = "Azure Machine Learning Registry" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="machinelearningservices", version="2024-04-01", @@ -2014,6 +2116,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningQuota(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_quota" + kind_display: ClassVar[str] = "Azure Machine Learning Quota" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "queue", "group": "generative_ai"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="machinelearningservices", version="2024-04-01", @@ -2039,6 +2144,9 @@ class AzureMachineLearningQuota(MicrosoftResource): @define(eq=False, slots=False) class AzureMachineLearningSchedule(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_machine_learning_schedule" + kind_display: ClassVar[str] = "Azure Machine Learning Schedule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -2073,6 +2181,9 @@ class AzureServerlessInferenceEndpoint: @define(eq=False, slots=False) class AzureMachineLearningServerlessEndpoint(MicrosoftResource, AzureTrackedResource): kind: ClassVar[str] = "azure_machine_learning_serverless_endpoint" + kind_display: ClassVar[str] = "Azure Machine Learning Serverless Endpoint" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -2140,6 +2251,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningUsage(MicrosoftResource, AzureBaseUsage): kind: ClassVar[str] = "azure_machine_learning_usage" + kind_display: ClassVar[str] = "Azure Machine Learning Usage" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "generative_ai"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="machinelearningservices", version="2024-04-01", @@ -2194,6 +2308,9 @@ class AzureEstimatedVMPrices: @define(eq=False, slots=False) class AzureMachineLearningVirtualMachineSize(MicrosoftResource, BaseInstanceType): kind: ClassVar[str] = "azure_machine_learning_virtual_machine_size" + kind_display: ClassVar[str] = "Azure Machine Learning Virtual Machine Size" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "control"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("name"), "tags": S("tags", default={}), @@ -2372,6 +2489,9 @@ class AzureWorkspaceHubConfig: @define(eq=False, slots=False) class AzureMachineLearningWorkspace(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_workspace" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="machinelearningservices", version="2024-04-01", @@ -2592,6 +2712,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMachineLearningWorkspaceConnection(MicrosoftResource): kind: ClassVar[str] = "azure_machine_learning_workspace_connection" + kind_display: ClassVar[str] = "Azure Machine Learning Workspace Connection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "generative_ai"} # Collected via AzureMachineLearningWorkspace() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), diff --git a/plugins/azure/fix_plugin_azure/resource/microsoft_graph.py b/plugins/azure/fix_plugin_azure/resource/microsoft_graph.py index 7abbd55c8b..c68d56c6d8 100644 --- a/plugins/azure/fix_plugin_azure/resource/microsoft_graph.py +++ b/plugins/azure/fix_plugin_azure/resource/microsoft_graph.py @@ -247,6 +247,7 @@ class MicrosoftGraphAssignedPlan: @define(eq=False, slots=False) class MicrosoftGraphRole(MicrosoftGraphEntity, BaseRole): kind: ClassVar[str] = "microsoft_graph_role" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/beta/roleManagement/directory/roleDefinitions", @@ -522,6 +523,7 @@ class MicrosoftGraphVerifiedDomain: @define(eq=False, slots=False) class MicrosoftGraphServicePrincipal(MicrosoftGraphEntity): kind: ClassVar[str] = "microsoft_graph_service_principal" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/v1.0/serviceprincipals", @@ -628,6 +630,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class MicrosoftGraphDevice(MicrosoftGraphEntity): kind: ClassVar[str] = "microsoft_graph_device" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/v1.0/devices", @@ -725,6 +728,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class MicrosoftGraphUser(MicrosoftGraphEntity, BaseUser): kind: ClassVar[str] = "microsoft_graph_user" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/v1.0/users", @@ -892,6 +896,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class MicrosoftGraphGroup(MicrosoftGraphEntity, BaseGroup): kind: ClassVar[str] = "microsoft_graph_group" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/v1.0/groups", @@ -1031,6 +1036,7 @@ def add_transitive(gp: MicrosoftGraphGroup) -> None: @define(eq=False, slots=False) class MicrosoftGraphOrganization(MicrosoftGraphEntity, BaseAccount): kind: ClassVar[str] = "microsoft_graph_organization" + kind_service: ClassVar[Optional[str]] = "entra_id" api_spec: ClassVar[MicrosoftRestSpec] = RestApiSpec( "graph", "https://graph.microsoft.com/v1.0/organization", @@ -1114,11 +1120,13 @@ def deferred_edge_to_subscription(cls, builder: GraphBuilder) -> None: @define(eq=False, slots=False) class MicrosoftGraphOrganizationRoot(MicrosoftGraphEntity, BaseRegion): kind: ClassVar[str] = "microsoft_graph_organization_root" + kind_service: ClassVar[Optional[str]] = "entra_id" @define(eq=False, slots=False) class MicrosoftGraphPolicy(MicrosoftGraphEntity): kind: ClassVar[str] = "microsoft_graph_policy" + kind_service: ClassVar[Optional[str]] = "entra_id" policy_kind: Optional[str] = field(default=None, metadata={"description": "The kind of policy."}) enabled: Optional[bool] = field(default=None, metadata={"description": "Indicates whether the policy is enabled."}) diff --git a/plugins/azure/fix_plugin_azure/resource/monitor.py b/plugins/azure/fix_plugin_azure/resource/monitor.py index 7e873bf2df..1daa8f5e6e 100644 --- a/plugins/azure/fix_plugin_azure/resource/monitor.py +++ b/plugins/azure/fix_plugin_azure/resource/monitor.py @@ -2,7 +2,7 @@ import logging from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field from jsons import snakecase @@ -202,6 +202,9 @@ class AzureMonitorEventHubReceiver: @define(eq=False, slots=False) class AzureMonitorActionGroup(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_action_group" + kind_display: ClassVar[str] = "Azure Monitor Action Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -293,6 +296,9 @@ class AzureMonitorActionGroupRef: @define(eq=False, slots=False) class AzureMonitorActivityLogAlert(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_activity_log_alert" + kind_display: ClassVar[str] = "Azure Monitor Activity Log Alert" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "alarm", "group": "control"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AzureMonitorActionGroup.kind]}, } @@ -358,6 +364,9 @@ class AzureMonitorRuleCondition: @define(eq=False, slots=False) class AzureMonitorAlertRule(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_alert_rule" + kind_display: ClassVar[str] = "Azure Monitor Alert Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -417,6 +426,9 @@ class AzureMonitorAccessModeSettings: @define(eq=False, slots=False) class AzureMonitorPrivateLinkScope(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_private_link_scope" + kind_display: ClassVar[str] = "Azure Monitor Private Link Scope" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -696,6 +708,9 @@ class AzureMonitorDataFlow: @define(eq=False, slots=False) class AzureMonitorWorkspace(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_workspace" + kind_display: ClassVar[str] = "Azure Monitor Workspace" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -731,6 +746,9 @@ class AzureMonitorWorkspace(MicrosoftResource): @define(eq=False, slots=False) class AzureMonitorDataCollectionRule(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_data_collection_rule" + kind_display: ClassVar[str] = "Azure Monitor Data Collection Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -789,6 +807,9 @@ class AzureMonitorRetentionPolicy: @define(eq=False, slots=False) class AzureMonitorLogProfile(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_log_profile" + kind_display: ClassVar[str] = "Azure Monitor Log Profile" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -830,6 +851,9 @@ class AzureMetricAlertAction: @define(eq=False, slots=False) class AzureMetricAlert(MicrosoftResource): kind: ClassVar[str] = "azure_metric_alert" + kind_display: ClassVar[str] = "Azure Metric Alert" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "alarm", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -1092,6 +1116,9 @@ class AzureMonitorNetworkingConfiguration: @define(eq=False, slots=False) class AzureMonitorPipelineGroup(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_pipeline_group" + kind_display: ClassVar[str] = "Azure Monitor Pipeline Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -1202,6 +1229,9 @@ class AzureMonitorRuleResolveConfiguration: @define(eq=False, slots=False) class AzureMonitorScheduledQueryRule(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_scheduled_query_rule" + kind_display: ClassVar[str] = "Azure Monitor Scheduled Query Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", @@ -1295,6 +1325,9 @@ class AzureDiagnosticLogSetting: @define(eq=False, slots=False) class AzureMonitorDiagnosticSettings(MicrosoftResource): kind: ClassVar[str] = "azure_monitor_diagnostic_settings" + kind_display: ClassVar[str] = "Azure Monitor Diagnostic Settings" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} _is_provider_link: ClassVar[bool] = False api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="monitor", diff --git a/plugins/azure/fix_plugin_azure/resource/mysql.py b/plugins/azure/fix_plugin_azure/resource/mysql.py index 6922833c69..980c35d354 100644 --- a/plugins/azure/fix_plugin_azure/resource/mysql.py +++ b/plugins/azure/fix_plugin_azure/resource/mysql.py @@ -105,6 +105,9 @@ class AzureServerMaintenanceWindow: @define(eq=False, slots=False) class AzureMysqlServerADAdministrator(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_ad_administrator" + kind_display: ClassVar[str] = "Azure MySQL Server Ad Administrator" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -211,6 +214,9 @@ class AzureServerEditionCapability: @define(eq=False, slots=False) class AzureMysqlServerType(MicrosoftResource, BaseDatabaseInstanceType): kind: ClassVar[str] = "azure_mysql_server_type" + kind_display: ClassVar[str] = "Azure MySQL Server Type" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -318,6 +324,9 @@ def collect( @define(eq=False, slots=False) class AzureMysqlServerConfiguration(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_configuration" + kind_display: ClassVar[str] = "Azure MySQL Server Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "database"} # Collect via AzureMysqlServer() config: Json = field(factory=dict) @@ -352,6 +361,9 @@ def collect_configs( @define(eq=False, slots=False) class AzureMysqlServerDatabase(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_database" + kind_display: ClassVar[str] = "Azure MySQL Server Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -373,6 +385,9 @@ class AzureMysqlServerDatabase(MicrosoftResource): @define(eq=False, slots=False) class AzureMysqlServerFirewallRule(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_firewall_rule" + kind_display: ClassVar[str] = "Azure MySQL Server Firewall Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -394,6 +409,9 @@ class AzureMysqlServerFirewallRule(MicrosoftResource): @define(eq=False, slots=False) class AzureMysqlServerLogFile(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_log_file" + kind_display: ClassVar[str] = "Azure MySQL Server Log File" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -419,6 +437,9 @@ class AzureMysqlServerLogFile(MicrosoftResource): @define(eq=False, slots=False) class AzureMysqlServerMaintenance(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_maintenance" + kind_display: ClassVar[str] = "Azure MySQL Server Maintenance" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -507,6 +528,9 @@ class AzureImportSourceProperties: @define(eq=False, slots=False) class AzureMysqlServer(MicrosoftResource, BaseDatabase): kind: ClassVar[str] = "azure_mysql_server" + kind_display: ClassVar[str] = "Azure MySQL Server" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="mysql", version="2023-12-30", @@ -744,6 +768,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureMysqlServerBackup(MicrosoftResource): kind: ClassVar[str] = "azure_mysql_server_backup" + kind_display: ClassVar[str] = "Azure MySQL Server Backup" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "backup", "group": "database"} # Collect via AzureMysqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), diff --git a/plugins/azure/fix_plugin_azure/resource/network.py b/plugins/azure/fix_plugin_azure/resource/network.py index 889c1a2469..a19f900f62 100644 --- a/plugins/azure/fix_plugin_azure/resource/network.py +++ b/plugins/azure/fix_plugin_azure/resource/network.py @@ -1,5 +1,5 @@ import logging -from typing import Callable, ClassVar, Dict, Optional, List, Type, Tuple +from typing import Callable, ClassVar, Dict, Optional, List, Type, Tuple, Any from attr import define, field @@ -956,6 +956,9 @@ class AzureApplicationGatewayGlobalConfiguration: @define(eq=False, slots=False) class AzureNetworkApplicationGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_application_gateway" + kind_display: ClassVar[str] = "Azure Network Application Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1116,6 +1119,9 @@ class AzureApplicationGatewayFirewallRuleGroup: @define(eq=False, slots=False) class AzureNetworkApplicationGatewayFirewallRuleSet(MicrosoftResource): kind: ClassVar[str] = "azure_network_application_gateway_firewall_rule_set" + kind_display: ClassVar[str] = "Azure Network Application Gateway Firewall Rule Set" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1344,6 +1350,9 @@ class AzureFirewallSku: @define(eq=False, slots=False) class AzureNetworkFirewall(MicrosoftResource, BaseFirewall): kind: ClassVar[str] = "azure_network_firewall" + kind_display: ClassVar[str] = "Azure Network Firewall" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1440,6 +1449,9 @@ class AzureIpRules: @define(eq=False, slots=False) class AzureNetworkBastionHost(MicrosoftResource): kind: ClassVar[str] = "azure_network_bastion_host" + kind_display: ClassVar[str] = "Azure Network Bastion Host" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "host", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1505,6 +1517,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkCustomIpPrefix(MicrosoftResource): kind: ClassVar[str] = "azure_network_custom_ip_prefix" + kind_display: ClassVar[str] = "Azure Network Custom IP Prefix" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1556,6 +1571,9 @@ class AzureNetworkCustomIpPrefix(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkDdosProtectionPlan(MicrosoftResource): kind: ClassVar[str] = "azure_network_ddos_protection_plan" + kind_display: ClassVar[str] = "Azure Network DDoS Protection Plan" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1735,6 +1753,9 @@ class AzureTrafficAnalyticsProperties: @define(eq=False, slots=False) class AzureNetworkFlowLog(MicrosoftResource): kind: ClassVar[str] = "azure_network_flow_log" + kind_display: ClassVar[str] = "Azure Network Flow Log" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} # Collect via AzureNetworkWatcher() reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_storage_account"]}, @@ -1776,6 +1797,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkSecurityGroup(MicrosoftResource, BaseSecurityGroup): kind: ClassVar[str] = "azure_network_security_group" + kind_display: ClassVar[str] = "Azure Network Security Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "security_group", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -1853,6 +1877,9 @@ class AzureRoute(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkRouteTable(MicrosoftResource, BaseRoutingTable): kind: ClassVar[str] = "azure_network_route_table" + kind_display: ClassVar[str] = "Azure Network Route Table" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-09-01", @@ -1989,6 +2016,9 @@ class AzureIpTag: @define(eq=False, slots=False) class AzureNetworkNatGateway(MicrosoftResource): kind: ClassVar[str] = "azure_network_nat_gateway" + kind_display: ClassVar[str] = "Azure Network NAT Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2028,6 +2058,9 @@ class AzureNetworkNatGateway(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkPublicIPAddress(MicrosoftResource, BaseIPAddress): kind: ClassVar[str] = "azure_network_public_ip_address" + kind_display: ClassVar[str] = "Azure Network Public IP Address" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2199,6 +2232,9 @@ class AzureDelegation(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkSubnet(MicrosoftResource, BaseSubnet): kind: ClassVar[str] = "azure_network_subnet" + kind_display: ClassVar[str] = "Azure Network Subnet" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "subnet", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "successors": { "default": [ @@ -2313,6 +2349,9 @@ class AzureFrontendIPConfiguration(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualNetworkTap(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_network_tap" + kind_display: ClassVar[str] = "Azure Network Virtual Network TAP" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2514,6 +2553,9 @@ class AzureResourceSet: @define(eq=False, slots=False) class AzureNetworkPrivateLinkService(MicrosoftResource): kind: ClassVar[str] = "azure_network_private_link_service" + kind_display: ClassVar[str] = "Azure Network Private Link Service" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2562,6 +2604,9 @@ class AzureNetworkPrivateLinkService(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkInterface(MicrosoftResource, BaseNetworkInterface): kind: ClassVar[str] = "azure_network_interface" + kind_display: ClassVar[str] = "Azure Network Interface" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2673,6 +2718,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkDscpConfiguration(MicrosoftResource): kind: ClassVar[str] = "azure_network_dscp_configuration" + kind_display: ClassVar[str] = "Azure Network Dscp Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -2957,6 +3005,9 @@ class AzureExpressRouteCircuitServiceProviderProperties: @define(eq=False, slots=False) class AzureNetworkExpressRouteCircuit(MicrosoftResource): kind: ClassVar[str] = "azure_network_express_route_circuit" + kind_display: ClassVar[str] = "Azure Network Express Route Circuit" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3084,6 +3135,9 @@ class AzureExpressRouteCrossConnectionPeering(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkExpressRouteCrossConnection(MicrosoftResource): kind: ClassVar[str] = "azure_network_express_route_cross_connection" + kind_display: ClassVar[str] = "Azure Network Express Route Cross Connection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3228,6 +3282,9 @@ class AzureExpressRouteConnection(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkExpressRouteGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_express_route_gateway" + kind_display: ClassVar[str] = "Azure Network Express Route Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "access_control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3302,6 +3359,9 @@ class AzureExpressRouteLink(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkExpressRoutePort(MicrosoftResource): kind: ClassVar[str] = "azure_network_express_route_port" + kind_display: ClassVar[str] = "Azure Network Express Route Port" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3355,6 +3415,9 @@ class AzureExpressRoutePortsLocationBandwidths: @define(eq=False, slots=False) class AzureNetworkExpressRoutePortsLocation(MicrosoftResource): kind: ClassVar[str] = "azure_network_express_route_ports_location" + kind_display: ClassVar[str] = "Azure Network Express Route Ports Location" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "region", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3539,6 +3602,9 @@ class AzureFirewallPolicyTransportSecurity: @define(eq=False, slots=False) class AzureNetworkFirewallPolicy(MicrosoftResource, BasePolicy): kind: ClassVar[str] = "azure_network_firewall_policy" + kind_display: ClassVar[str] = "Azure Network Firewall Policy" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3595,6 +3661,9 @@ class AzureNetworkFirewallPolicy(MicrosoftResource, BasePolicy): @define(eq=False, slots=False) class AzureNetworkIpAllocation(MicrosoftResource): kind: ClassVar[str] = "azure_network_ip_allocation" + kind_display: ClassVar[str] = "Azure Network IP Allocation" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3638,6 +3707,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkIpGroup(MicrosoftResource): kind: ClassVar[str] = "azure_network_ip_group" + kind_display: ClassVar[str] = "Azure Network IP Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -3697,6 +3769,9 @@ def _get_virtual_network_ips_and_ids(self, builder: GraphBuilder) -> List[Tuple[ @define(eq=False, slots=False) class AzureNetworkLoadBalancerProbe(MicrosoftResource, BaseHealthCheck): kind: ClassVar[str] = "azure_network_load_balancer_probe" + kind_display: ClassVar[str] = "Azure Network Load Balancer Probe" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "networking"} # Collect via AzureNetworkLoadBalancer mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -3921,6 +3996,9 @@ class AzureOutboundRule(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkLoadBalancer(MicrosoftResource, BaseLoadBalancer): kind: ClassVar[str] = "azure_network_load_balancer" + kind_display: ClassVar[str] = "Azure Network Load Balancer" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "load_balancer", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4119,6 +4197,9 @@ class AzureContainerNetworkInterface(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkProfile(MicrosoftResource): kind: ClassVar[str] = "azure_network_profile" + kind_display: ClassVar[str] = "Azure Network Profile" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4251,6 +4332,9 @@ class AzurePartnerManagedResourceProperties: @define(eq=False, slots=False) class AzureNetworkVirtualAppliance(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_appliance" + kind_display: ClassVar[str] = "Azure Network Virtual Appliance" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4372,6 +4456,9 @@ class AzureNetworkVirtualApplianceSkuInstances: @define(eq=False, slots=False) class AzureNetworkVirtualApplianceSku(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_appliance_sku" + kind_display: ClassVar[str] = "Azure Network Virtual Appliance SKU" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-04-01", @@ -4400,6 +4487,9 @@ class AzureNetworkVirtualApplianceSku(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkWatcher(MicrosoftResource): kind: ClassVar[str] = "azure_network_watcher" + kind_display: ClassVar[str] = "Azure Network Watcher" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4557,6 +4647,9 @@ class AzureVpnClientConnectionHealth: @define(eq=False, slots=False) class AzureNetworkP2SVpnGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_p2_s_vpn_gateway" + kind_display: ClassVar[str] = "Azure Network P2 S VPN Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4601,6 +4694,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkPublicIPPrefix(MicrosoftResource): kind: ClassVar[str] = "azure_network_public_ip_prefix" + kind_display: ClassVar[str] = "Azure Network Public IP Prefix" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4665,6 +4761,9 @@ class AzureRouteFilterRule(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkRouteFilter(MicrosoftResource): kind: ClassVar[str] = "azure_network_route_filter" + kind_display: ClassVar[str] = "Azure Network Route Filter" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4692,6 +4791,9 @@ class AzureNetworkRouteFilter(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkSecurityPartnerProvider(MicrosoftResource): kind: ClassVar[str] = "azure_network_security_partner_provider" + kind_display: ClassVar[str] = "Azure Network Security Partner Provider" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4719,6 +4821,9 @@ class AzureNetworkSecurityPartnerProvider(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkUsage(MicrosoftResource, AzureBaseUsage, BaseNetworkQuota): kind: ClassVar[str] = "azure_network_usage" + kind_display: ClassVar[str] = "Azure Network Usage" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4791,6 +4896,9 @@ class AzureVirtualHubRouteTableV2(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualHub(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_hub" + kind_display: ClassVar[str] = "Azure Network Virtual Hub" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -4990,6 +5098,9 @@ class AzureVirtualNetworkPeering(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualNetwork(MicrosoftResource, BaseNetwork): kind: ClassVar[str] = "azure_network_virtual_network" + kind_display: ClassVar[str] = "Azure Network Virtual Network" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5067,6 +5178,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureNetworkVirtualRouter(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_router" + kind_display: ClassVar[str] = "Azure Network Virtual Router" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5098,6 +5212,9 @@ class AzureNetworkVirtualRouter(MicrosoftResource): @define(eq=False, slots=False) class AzureNetworkVirtualWAN(MicrosoftResource): kind: ClassVar[str] = "azure_network_virtual_wan" + kind_display: ClassVar[str] = "Azure Network Virtual WAN" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5228,6 +5345,9 @@ class AzureVpnSiteLinkConnection(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualWANVpnConnection(MicrosoftResource, BaseTunnel): kind: ClassVar[str] = "azure_network_virtual_wan_vpn_connection" + kind_display: ClassVar[str] = "Azure Network Virtual WAN VPN Connection" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} # Collect via AzureNetworkVirtualWANVpnGateway mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -5361,6 +5481,9 @@ class AzureVpnGatewayNatRule(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualWANVpnGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_virtual_wan_vpn_gateway" + kind_display: ClassVar[str] = "Azure Network Virtual WAN VPN Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5484,6 +5607,9 @@ class AzureAadAuthenticationParameters: @define(eq=False, slots=False) class AzureNetworkVpnServerConfiguration(MicrosoftResource): kind: ClassVar[str] = "azure_network_vpn_server_configuration" + kind_display: ClassVar[str] = "Azure Network VPN Server Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5610,6 +5736,9 @@ class AzureO365PolicyProperties: @define(eq=False, slots=False) class AzureNetworkVpnSite(MicrosoftResource, BasePeeringConnection): kind: ClassVar[str] = "azure_network_vpn_site" + kind_display: ClassVar[str] = "Azure Network VPN Site" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -5856,6 +5985,9 @@ class AzureManagedRulesDefinition: @define(eq=False, slots=False) class AzureNetworkWebApplicationFirewallPolicy(MicrosoftResource): kind: ClassVar[str] = "azure_network_web_application_firewall_policy" + kind_display: ClassVar[str] = "Azure Network Web Application Firewall Policy" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2023-05-01", @@ -6090,6 +6222,9 @@ class AzureVirtualNetworkGatewayNatRule(AzureSubResource): @define(eq=False, slots=False) class AzureNetworkVirtualNetworkGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_virtual_network_gateway" + kind_display: ClassVar[str] = "Azure Network Virtual Network Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} # Collect via AzureResourceGroup mapping: ClassVar[Dict[str, Bender]] = { "active_active": S("properties", "activeActive"), @@ -6163,6 +6298,9 @@ class AzureNetworkVirtualNetworkGateway(MicrosoftResource, BaseGateway): @define(eq=False, slots=False) class AzureNetworkLocalNetworkGateway(MicrosoftResource, BaseGateway): kind: ClassVar[str] = "azure_network_local_network_gateway" + kind_display: ClassVar[str] = "Azure Network Local Network Gateway" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} # Collect via AzureResourceGroup mapping: ClassVar[Dict[str, Bender]] = { "bgp_settings": S("properties", "bgpSettings") >> Bend(AzureBgpSettings.mapping), @@ -6207,7 +6345,10 @@ class AzureTunnelConnectionHealth: @define(eq=False, slots=False) class AzureNetworkVirtualNetworkGatewayConnection(MicrosoftResource, BaseTunnel): kind: ClassVar[str] = "azure_network_virtual_network_gateway_connection" + kind_display: ClassVar[str] = "Azure Network Virtual Network Gateway Connection" + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} # Collect via AzureResourceGroup + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_network_virtual_network_gateway", "azure_network_local_network_gateway"]}, } @@ -6364,6 +6505,9 @@ class AzureCaaRecord: @define(eq=False, slots=False) class AzureNetworkDNSRecordSet(MicrosoftResource, BaseDNSRecordSet): kind: ClassVar[str] = "azure_network_dns_record_set" + kind_display: ClassVar[str] = "Azure Network DNS Record Set" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_network_dns_zone"]}, } @@ -6407,6 +6551,9 @@ class AzureNetworkDNSRecordSet(MicrosoftResource, BaseDNSRecordSet): @define(eq=False, slots=False) class AzureNetworkDNSZone(MicrosoftResource, BaseDNSZone): kind: ClassVar[str] = "azure_network_dns_zone" + kind_display: ClassVar[str] = "Azure Network DNS Zone" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns_record", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="network", version="2018-05-01", diff --git a/plugins/azure/fix_plugin_azure/resource/postgresql.py b/plugins/azure/fix_plugin_azure/resource/postgresql.py index e0b21435d1..403fb4f622 100644 --- a/plugins/azure/fix_plugin_azure/resource/postgresql.py +++ b/plugins/azure/fix_plugin_azure/resource/postgresql.py @@ -2,7 +2,7 @@ import logging from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field, evolve @@ -37,6 +37,9 @@ @define(eq=False, slots=False) class AzurePostgresqlServerADAdministrator(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_ad_administrator" + kind_display: ClassVar[str] = "Azure PostgreSQL Ad Administrator" + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "database"} + kind_service: ClassVar[Optional[str]] = service_name # Collect via AzurePostgresqlServer() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -198,6 +201,9 @@ class AzureFastProvisioningEditionCapability: @define(eq=False, slots=False) class AzurePostgresqlServerType(MicrosoftResource, BaseDatabaseInstanceType): kind: ClassVar[str] = "azure_postgresql_server_type" + kind_display: ClassVar[str] = "Azure PostgreSQL Server Type" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "control"} # Collect via AzurePostgresqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -313,6 +319,9 @@ def collect(cls, raw: List[Json], builder: GraphBuilder) -> List[AzurePostgresql @define(eq=False, slots=False) class AzurePostgresqlServerConfiguration(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_server_configuration" + kind_display: ClassVar[str] = "Azure PostgreSQL Server Configuration" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "database"} # Collect via AzurePostgresqlServer() config: Json = field(factory=dict) @@ -347,6 +356,9 @@ def collect_configs( @define(eq=False, slots=False) class AzurePostgresqlServerDatabase(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_server_database" + kind_display: ClassVar[str] = "Azure PostgreSQL Server Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzurePostgresqlServer() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -364,6 +376,9 @@ class AzurePostgresqlServerDatabase(MicrosoftResource, AzureProxyResource): @define(eq=False, slots=False) class AzurePostgresqlServerFirewallRule(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_server_firewall_rule" + kind_display: ClassVar[str] = "Azure PostgreSQL Server Firewall Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} # Collect via AzurePostgresqlServer() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), @@ -396,6 +411,9 @@ class AzureAuthConfig: @define(eq=False, slots=False) class AzurePostgresqlServer(MicrosoftResource, AzureTrackedResource, BaseDatabase): kind: ClassVar[str] = "azure_postgresql_server" + kind_display: ClassVar[str] = "Azure PostgreSQL Server" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="postgresql", version="2023-06-01-preview", @@ -634,6 +652,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzurePostgresqlServerBackup(MicrosoftResource, AzureProxyResource): kind: ClassVar[str] = "azure_postgresql_server_backup" + kind_display: ClassVar[str] = "Azure PostgreSQL Server Backup" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "backup", "group": "database"} # Collect via AzurePostgresqlServer() mapping: ClassVar[Dict[str, Bender]] = AzureProxyResource.mapping | { "id": S("id"), diff --git a/plugins/azure/fix_plugin_azure/resource/security.py b/plugins/azure/fix_plugin_azure/resource/security.py index c24ff27e8a..804aceeb4b 100644 --- a/plugins/azure/fix_plugin_azure/resource/security.py +++ b/plugins/azure/fix_plugin_azure/resource/security.py @@ -8,6 +8,8 @@ from fixlib.json_bender import Bender, S, Bend, ForallBend, F from fixlib.types import Json +service_name = "security" + @define(eq=False, slots=False) class AzureSecurityOperationStatus: @@ -35,8 +37,11 @@ class AzureSecurityExtension: @define(eq=False, slots=False) class AzureSecurityPricing(MicrosoftResource): kind: ClassVar[str] = "azure_security_pricing" + kind_display: ClassVar[str] = "Azure Security Pricing" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="security", + service=service_name, version="2023-01-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings", path_parameters=["subscriptionId"], @@ -86,8 +91,11 @@ class AzureAssessmentStatus: @define(eq=False, slots=False) class AzureSecurityAssessment(MicrosoftResource): kind: ClassVar[str] = "azure_security_assessment" + kind_display: ClassVar[str] = "Azure Security Assessment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="security", + service=service_name, version="2021-06-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessments", path_parameters=["subscriptionId"], @@ -125,8 +133,11 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSecurityServerVulnerabilityAssessmentsSetting(MicrosoftResource): kind: ClassVar[str] = "azure_security_server_vulnerability_assessments_setting" + kind_display: ClassVar[str] = "Azure Security Server Vulnerability Assessments Setting" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="security", + service=service_name, version="2023-05-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings", path_parameters=["subscriptionId"], @@ -150,8 +161,11 @@ class AzureSecurityServerVulnerabilityAssessmentsSetting(MicrosoftResource): @define(eq=False, slots=False) class AzureSecuritySetting(MicrosoftResource): kind: ClassVar[str] = "azure_security_setting" + kind_display: ClassVar[str] = "Azure Security Setting" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="security", + service=service_name, version="2022-05-01", path="/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings", path_parameters=["subscriptionId"], @@ -173,8 +187,11 @@ class AzureSecuritySetting(MicrosoftResource): @define(eq=False, slots=False) class AzureSecurityAutoProvisioningSetting(MicrosoftResource): kind: ClassVar[str] = "azure_security_auto_provisioning_setting" + kind_display: ClassVar[str] = "Azure Security Auto Provisioning Setting" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( - service="security", + service=service_name, version="2017-08-01-preview", path="/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings", path_parameters=["subscriptionId"], diff --git a/plugins/azure/fix_plugin_azure/resource/sql_server.py b/plugins/azure/fix_plugin_azure/resource/sql_server.py index 456bb2b5f6..d231602195 100644 --- a/plugins/azure/fix_plugin_azure/resource/sql_server.py +++ b/plugins/azure/fix_plugin_azure/resource/sql_server.py @@ -28,6 +28,9 @@ @define(eq=False, slots=False) class AzureSqlServerADAdministrator(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_ad_administrator" + kind_display: ClassVar[str] = "Azure SQL Server Ad Administrator" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "database"} # Collect via AzureSqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -80,6 +83,9 @@ class AzureDatabaseIdentity: @define(eq=False, slots=False) class AzureSqlServerDatabase(MicrosoftResource, BaseDatabase): kind: ClassVar[str] = "azure_sql_server_database" + kind_display: ClassVar[str] = "Azure SQL Server Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureSqlServer() reference_kinds: ClassVar[ModelReference] = { "successors": { @@ -315,6 +321,9 @@ class AzureElasticPoolPerDatabaseSettings: @define(eq=False, slots=False) class AzureSqlServerElasticPool(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_elastic_pool" + kind_display: ClassVar[str] = "Azure SQL Server Elastic Pool" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "compute"} # Collect via AzureSqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -378,6 +387,9 @@ class AzurePartnerInfo: @define(eq=False, slots=False) class AzureSqlServerFailoverGroup(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_failover_group" + kind_display: ClassVar[str] = "Azure SQL Server Failover Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} # Collect via AzureSqlServer() reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_sql_server_database"]}, @@ -414,6 +426,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerFirewallRule(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_firewall_rule" + kind_display: ClassVar[str] = "Azure SQL Server Firewall Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "firewall", "group": "networking"} # Collect via AzureSqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -431,6 +446,9 @@ class AzureSqlServerFirewallRule(MicrosoftResource): @define(eq=False, slots=False) class AzureSqlServerDatabaseGeoBackupPolicy(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_database_geo_backup_policy" + kind_display: ClassVar[str] = "Azure SQL Server Database Geo Backup Policy" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "database"} # Collect via AzureSqlServerDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -480,6 +498,9 @@ class AzureManagedInstancePairInfo: @define(eq=False, slots=False) class AzureSqlServerManagedInstanceFailoverGroup(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_managed_instance_failover_group" + kind_display: ClassVar[str] = "Azure SQL Server Managed Instance Failover Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureSqlServerManagedInstance() reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_sql_server_managed_instance"]}, @@ -531,6 +552,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerManagedInstancePool(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_managed_instance_pool" + kind_display: ClassVar[str] = "Azure SQL Server Managed Instance Pool" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="sql", version="2021-11-01", @@ -569,6 +593,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerJobAgent(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_job_agent" + kind_display: ClassVar[str] = "Azure SQL Server Job Agent" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "database"} # Collect via AzureSqlServer() reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["azure_sql_server_database"]}, @@ -599,6 +626,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerManagedInstanceADAdministrator(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_managed_instance_ad_administrator" + kind_display: ClassVar[str] = "Azure SQL Server Managed Instance Ad Administrator" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "access_control"} # Collect via AzureSqlManagedInstance() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -628,6 +658,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerManagedInstanceDatabase(MicrosoftResource, BaseDatabase): kind: ClassVar[str] = "azure_sql_server_managed_instance_database" + kind_display: ClassVar[str] = "Azure SQL Server Managed Instance Database" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} # Collect via AzureSqlServerManagedInstance() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -782,6 +815,9 @@ class AzureServicePrincipal: @define(eq=False, slots=False) class AzureSqlServerManagedInstance(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_managed_instance" + kind_display: ClassVar[str] = "Azure SQL Server Managed Instance" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="sql", version="2021-11-01", @@ -992,6 +1028,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerVirtualCluster(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_virtual_cluster" + kind_display: ClassVar[str] = "Azure SQL Server Virtual Cluster" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="sql", version="2022-05-01-preview", @@ -1036,6 +1075,9 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: @define(eq=False, slots=False) class AzureSqlServerTrustGroup(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_trust_group" + kind_display: ClassVar[str] = "Azure SQL Server Trust Group" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "access_control"} # Collect via AzureSqlServerManagedInstance() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1053,6 +1095,9 @@ class AzureSqlServerTrustGroup(MicrosoftResource): @define(eq=False, slots=False) class AzureSqlServerVirtualNetworkRule(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_virtual_network_rule" + kind_display: ClassVar[str] = "Azure SQL Server Virtual Network Rule" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} # Collect via AzureSqlServer() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1072,6 +1117,8 @@ class AzureSqlServerVirtualNetworkRule(MicrosoftResource): @define(eq=False, slots=False) class AzureSqlServerDatabaseWorkloadGroup(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_database_workload_group" + kind_display: ClassVar[str] = "Azure SQL Server Database Workload Group" + kind_service: ClassVar[Optional[str]] = service_name # Collect via AzureSqlServerDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1223,6 +1270,9 @@ class AzureRecommendedAction: @define(eq=False, slots=False) class AzureSqlServerAdvisor(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server_advisor" + kind_display: ClassVar[str] = "Azure SQL Server Advisor" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "profile", "group": "database"} # Collect via AzureSqlServer() and AzureSqlServerDatabase() mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), @@ -1321,6 +1371,9 @@ class AzureSqlEncryptionProtector: @define(eq=False, slots=False) class AzureSqlServer(MicrosoftResource): kind: ClassVar[str] = "azure_sql_server" + kind_display: ClassVar[str] = "Azure SQL Server" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="sql", version="2021-11-01", diff --git a/plugins/azure/fix_plugin_azure/resource/storage.py b/plugins/azure/fix_plugin_azure/resource/storage.py index 6e8b0d0852..adc774f834 100644 --- a/plugins/azure/fix_plugin_azure/resource/storage.py +++ b/plugins/azure/fix_plugin_azure/resource/storage.py @@ -1,6 +1,6 @@ import logging from datetime import datetime, timedelta -from typing import ClassVar, Optional, Dict, List, Type +from typing import ClassVar, Optional, Dict, List, Type, Any from attr import define, field @@ -133,6 +133,9 @@ class AzureImmutableStorageWithVersioning: @define(eq=False, slots=False) class AzureStorageBlobContainer(MicrosoftResource, BaseBucket): kind: ClassVar[str] = "azure_storage_blob_container" + kind_display: ClassVar[str] = "Azure Storage Blob Container" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "storage"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), "tags": S("tags", default={}), @@ -185,6 +188,9 @@ class AzureStorageBlobContainer(MicrosoftResource, BaseBucket): @define(eq=False, slots=False) class AzureStorageAccountDeleted(MicrosoftResource): kind: ClassVar[str] = "azure_storage_account_deleted" + kind_display: ClassVar[str] = "Azure Storage Account Deleted" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "account", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="storage", version="2023-01-01", @@ -240,6 +246,9 @@ class AzureSignedIdentifier: @define(eq=False, slots=False) class AzureStorageFileShare(MicrosoftResource, BaseNetworkShare): kind: ClassVar[str] = "azure_storage_file_share" + kind_display: ClassVar[str] = "Azure Storage File Share" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network_share", "group": "storage"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), "tags": S("tags", default={}), @@ -291,6 +300,9 @@ class AzureStorageFileShare(MicrosoftResource, BaseNetworkShare): @define(eq=False, slots=False) class AzureStorageQueue(MicrosoftResource, BaseQueue): kind: ClassVar[str] = "azure_storage_queue" + kind_display: ClassVar[str] = "Azure Storage Queue" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "queue", "group": "storage"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), "tags": S("tags", default={}), @@ -322,6 +334,9 @@ class AzureRestriction: @define(eq=False, slots=False) class AzureStorageSku(MicrosoftResource): kind: ClassVar[str] = "azure_storage_sku" + kind_display: ClassVar[str] = "Azure Storage SKU" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "misc"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="storage", version="2023-01-01", @@ -693,6 +708,9 @@ class AzureStorageAccountSkuConversionStatus: @define(eq=False, slots=False) class AzureStorageAccount(MicrosoftResource): kind: ClassVar[str] = "azure_storage_account" + kind_display: ClassVar[str] = "Azure Storage Account" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "account", "group": "storage"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="storage", version="2023-01-01", @@ -1036,6 +1054,9 @@ def collect_usage_metrics( @define(eq=False, slots=False) class AzureStorageAccountUsage(MicrosoftResource, AzureBaseUsage): kind: ClassVar[str] = "azure_storage_account_usage" + kind_display: ClassVar[str] = "Azure Storage Account Usage" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="storage", version="2023-01-01", @@ -1079,6 +1100,9 @@ class AzureTableSignedIdentifier: @define(eq=False, slots=False) class AzureStorageTable(MicrosoftResource): kind: ClassVar[str] = "azure_storage_table" + kind_display: ClassVar[str] = "Azure Storage Table" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "storage"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("id"), "tags": S("tags", default={}), diff --git a/plugins/azure/fix_plugin_azure/resource/web.py b/plugins/azure/fix_plugin_azure/resource/web.py index 78d589e869..14b9e981b9 100644 --- a/plugins/azure/fix_plugin_azure/resource/web.py +++ b/plugins/azure/fix_plugin_azure/resource/web.py @@ -1,6 +1,6 @@ import logging from datetime import datetime -from typing import ClassVar, Optional, Dict, List, Type +from typing import ClassVar, Optional, Dict, List, Type, Any from attr import define, field @@ -70,6 +70,9 @@ class AzureKubeEnvironmentProfile: @define(eq=False, slots=False) class AzureWebAppServicePlan(MicrosoftResource): kind: ClassVar[str] = "azure_web_app_service_plan" + kind_display: ClassVar[str] = "Azure Web App Service Plan" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "misc"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", @@ -142,6 +145,9 @@ class AzureWebAppServicePlan(MicrosoftResource): @define(eq=False, slots=False) class AzureWebCertificate(MicrosoftResource): kind: ClassVar[str] = "azure_web_certificate" + kind_display: ClassVar[str] = "Azure Web Certificate" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "certificate", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", @@ -384,6 +390,9 @@ class AzureTemplate: @define(eq=False, slots=False) class AzureWebContainerApp(MicrosoftResource): kind: ClassVar[str] = "azure_web_container_app" + kind_display: ClassVar[str] = "Azure Web Container App" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2021-03-01", @@ -492,6 +501,9 @@ class AzureDomainPurchaseConsent: @define(eq=False, slots=False) class AzureWebDomain(MicrosoftResource): kind: ClassVar[str] = "azure_web_domain" + kind_display: ClassVar[str] = "Azure Web Domain" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", @@ -632,6 +644,9 @@ class AzureNetworkAccessControlEntry: @define(eq=False, slots=False) class AzureWebHostingEnvironment(MicrosoftResource): kind: ClassVar[str] = "azure_web_hosting_environment" + kind_display: ClassVar[str] = "Azure Web Hosting Environment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "environment", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2015-08-01", @@ -773,6 +788,9 @@ class AzureContainerAppsConfiguration: @define(eq=False, slots=False) class AzureWebKubeEnvironment(MicrosoftResource): kind: ClassVar[str] = "azure_web_kube_environment" + kind_display: ClassVar[str] = "Azure Web Kube Environment" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "environment", "group": "managed_kubernetes"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", @@ -1370,6 +1388,9 @@ class AzureWebAppAuthSettings: @define(eq=False, slots=False) class AzureWebApp(MicrosoftResource, BaseServerlessFunction): kind: ClassVar[str] = "azure_web_app" + kind_display: ClassVar[str] = "Azure Web App" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "function", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", @@ -1626,6 +1647,9 @@ class AzureDatabaseConnectionOverview: @define(eq=False, slots=False) class AzureWebAppStaticSite(MicrosoftResource): kind: ClassVar[str] = "azure_web_app_static_site" + kind_display: ClassVar[str] = "Azure Web App Static Site" + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "service", "group": "compute"} api_spec: ClassVar[AzureResourceSpec] = AzureResourceSpec( service="web", version="2023-12-01", diff --git a/plugins/gcp/fix_plugin_gcp/resources/base.py b/plugins/gcp/fix_plugin_gcp/resources/base.py index c8295c50aa..9a90ca21d8 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/base.py +++ b/plugins/gcp/fix_plugin_gcp/resources/base.py @@ -448,6 +448,7 @@ def called_mutator_apis(cls) -> List[GcpApiSpec]: class GcpProject(GcpResource, BaseAccount): kind: ClassVar[str] = "gcp_project" kind_display: ClassVar[str] = "GCP Project" + metadata: ClassVar[Dict[str, Any]] = {"icon": "access_control", "group": "networking"} kind_description: ClassVar[str] = ( "A GCP Project is a container for resources in the Google Cloud Platform," " allowing users to organize and manage their cloud resources." @@ -506,6 +507,7 @@ class GcpRegionQuota(GcpResource): " provisioned in a specific region, such as compute instances, storage, or" " networking resources." ) + metadata: ClassVar[Dict[str, Any]] = {"icon": "quota", "group": "misc"} mapping: ClassVar[Dict[str, Bender]] = { "id": S("name").or_else(S("id")).or_else(S("selfLink")), "name": S("name"), diff --git a/plugins/gcp/fix_plugin_gcp/resources/billing.py b/plugins/gcp/fix_plugin_gcp/resources/billing.py index 99bffcdea1..b94d65ddc1 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/billing.py +++ b/plugins/gcp/fix_plugin_gcp/resources/billing.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type, cast +from typing import ClassVar, Dict, Optional, List, Type, cast, Any from attr import define, field @@ -13,6 +13,8 @@ # https://cloud.google.com/billing/docs # API https://googleapis.github.io/google-api-python-client/docs/dyn/cloudbilling_v1.html +service_name = "cloudbilling" + @define(eq=False, slots=False) class GcpBillingAccount(GcpResource): @@ -22,11 +24,13 @@ class GcpBillingAccount(GcpResource): "GCP Billing Account is a financial account used to manage the payment and" " billing information for Google Cloud Platform services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "account", "group": "control"} reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["gcp_project_billing_info"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="cloudbilling", + service=service_name, version="v1", accessors=["billingAccounts"], action="list", @@ -72,8 +76,10 @@ class GcpProjectBillingInfo(GcpResource): "GCP Project Billing Info provides information and management capabilities" " for the billing aspects of a Google Cloud Platform project." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "control"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="cloudbilling", + service=service_name, version="v1", accessors=["billingAccounts", "projects"], action="list", @@ -117,7 +123,7 @@ class GcpService(GcpResource): "successors": {"default": ["gcp_sku"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="cloudbilling", + service=service_name, version="v1", accessors=["services"], action="list", @@ -314,8 +320,9 @@ class GcpSku(GcpResource): "GCP SKU represents a Stock Keeping Unit in Google Cloud Platform, providing" " unique identifiers for different resources and services." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="cloudbilling", + service=service_name, version="v1", accessors=["services", "skus"], action="list", diff --git a/plugins/gcp/fix_plugin_gcp/resources/compute.py b/plugins/gcp/fix_plugin_gcp/resources/compute.py index 9611662e61..4f0446e312 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/compute.py +++ b/plugins/gcp/fix_plugin_gcp/resources/compute.py @@ -1,7 +1,7 @@ import logging import ipaddress from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Tuple, Type +from typing import ClassVar, Dict, Optional, List, Tuple, Type, Any from urllib.parse import urlparse from attr import define, field @@ -39,6 +39,8 @@ # This service is called Compute Engine in the GCP API. # https://cloud.google.com/kubernetes-engine/docs +service_name = "compute" + def health_check_types() -> Tuple[Type[GcpResource], ...]: return GcpHealthCheck, GcpHttpsHealthCheck, GcpHttpHealthCheck @@ -53,8 +55,10 @@ class GcpAcceleratorType(GcpResource): " Google Cloud Platform (GCP) that are designed to enhance the performance of" " certain workloads, such as machine learning models or graphics processing." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "compute"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["acceleratorTypes"], action="aggregatedList", @@ -97,6 +101,8 @@ class GcpAddress(GcpResource, BaseIPAddress): " address for virtual machine instances or other resources within the Google" " Cloud network." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_subnetwork"]}, "successors": { @@ -104,7 +110,7 @@ class GcpAddress(GcpResource, BaseIPAddress): }, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["addresses"], action="aggregatedList", @@ -328,6 +334,7 @@ class GcpAutoscaler(GcpResource, BaseAutoScalingGroup): " adjusts the number of instances in a managed instance group based on the" " workload, helping to maintain cost efficiency and performance." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "successors": { "default": ["gcp_instance_group_manager"], @@ -335,7 +342,7 @@ class GcpAutoscaler(GcpResource, BaseAutoScalingGroup): } } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["autoscalers"], action="aggregatedList", @@ -457,8 +464,9 @@ class GcpBackendBucket(GcpResource, BaseBucket): "A GCP Backend Bucket is a storage bucket used to distribute static content" " for a load balanced website or application running on Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["backendBuckets"], action="list", @@ -850,6 +858,8 @@ class GcpBackendService(GcpResource): " Cloud Platform that allows you to distribute traffic across multiple" " backends and regions in a flexible and scalable manner." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "load_balancer", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["gcp_network"], @@ -873,7 +883,7 @@ class GcpBackendService(GcpResource): }, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["backendServices"], action="aggregatedList", @@ -978,8 +988,10 @@ class GcpDiskType(GcpResource, BaseVolumeType): "GCP Disk Types are storage options provided by Google Cloud Platform, which" " define the performance characteristics and pricing of persistent disks." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "storage"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["diskTypes"], action="aggregatedList", @@ -1102,12 +1114,13 @@ class GcpDisk(GcpResource, BaseVolume): "GCP Disk is a persistent block storage service provided by Google Cloud" " Platform, allowing users to store and manage data in the cloud." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_disk_type", "gcp_instance"]}, "successors": {"delete": ["gcp_instance"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["disks"], action="aggregatedList", @@ -1230,8 +1243,9 @@ class GcpExternalVpnGateway(GcpResource, BaseGateway): "GCP External VPN Gateway is a resource that provides connectivity from Google Cloud to external networks" " via VPN, featuring interfaces for tunnel configuration and redundancy options for high availability." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["externalVpnGateways"], action="list", @@ -1376,9 +1390,11 @@ class GcpFirewallPolicy(GcpResource): "GCP Firewall Policy is a security rule set that controls incoming and" " outgoing network traffic for resources in the Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["gcp_network"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["firewallPolicies"], action="list", @@ -1471,9 +1487,10 @@ class GcpFirewall(GcpResource, BaseFirewall): " that controls incoming and outgoing traffic to and from virtual machine" " instances." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["gcp_network"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["firewalls"], action="list", @@ -1579,6 +1596,8 @@ class GcpForwardingRule(GcpResource, BaseLoadBalancer): " different destinations based on the configuration settings. They can be used" " to load balance or redirect traffic within a network or between networks." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"]}, "successors": { @@ -1595,7 +1614,7 @@ class GcpForwardingRule(GcpResource, BaseLoadBalancer): }, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["forwardingRules"], action="aggregatedList", @@ -1699,7 +1718,7 @@ def _collect_backends(self, graph_builder: GraphBuilder) -> None: def fetch_instances(group: str) -> None: api_spec = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["instanceGroups"], action="listInstances", @@ -1797,11 +1816,13 @@ class GcpNetworkEndpointGroup(GcpResource): " allowing users to distribute network traffic across multiple endpoints in" " Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network", "gcp_subnetwork"], "delete": ["gcp_network", "gcp_subnetwork"]} } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["networkEndpointGroups"], action="aggregatedList", @@ -1994,6 +2015,8 @@ class GcpOperation(GcpResource): "An operation represents a long-running asynchronous API call in Google Cloud" " Platform (GCP), allowing users to create, update, or delete resources" ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "control"} reference_kinds: ClassVar[ModelReference] = { "successors": { # operation can target multiple resources, unclear which others are possible @@ -2001,7 +2024,7 @@ class GcpOperation(GcpResource): } } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["globalOperations"], action="aggregatedList", @@ -2094,8 +2117,10 @@ class GcpPublicDelegatedPrefix(GcpResource): " use their own IPv6 addresses on GCP resources for public internet" " connectivity." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["publicDelegatedPrefixes"], action="aggregatedList", @@ -2291,8 +2316,10 @@ class GcpHealthCheck(GcpResource, BaseHealthCheck): " monitor the health and availability of your resources by periodically" " sending requests to them and verifying the responses." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "health", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["healthChecks"], action="aggregatedList", @@ -2347,8 +2374,10 @@ class GcpHttpHealthCheck(GcpResource): " of web services and determine if they are reachable and responding correctly" " to requests." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "health", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["httpHealthChecks"], action="list", @@ -2393,8 +2422,10 @@ class GcpHttpsHealthCheck(GcpResource): " check the availability and performance of their HTTPS endpoints on Google" " Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "health", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["httpsHealthChecks"], action="list", @@ -2489,8 +2520,9 @@ class GcpImage(GcpResource): "GCP Images are pre-configured virtual machine templates that can be used to" " create and deploy virtual machines in the Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "compute"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_disk"]}} - api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( service="compute", version="v1", @@ -2790,6 +2822,8 @@ class GcpInstanceGroupManager(GcpResource): "GCP Instance Group Manager is a resource in Google Cloud Platform that helps" " manage and scale groups of Compute Engine instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["gcp_instance_group"], @@ -2798,7 +2832,7 @@ class GcpInstanceGroupManager(GcpResource): "successors": {"default": ["gcp_health_check", "gcp_http_health_check", "gcp_https_health_check"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["instanceGroupManagers"], action="aggregatedList", @@ -2872,11 +2906,9 @@ class GcpInstanceGroup(GcpResource): "Instance Group is a resource in Google Cloud Platform that allows you to" " manage and scale multiple instances together as a single unit." ) - reference_kinds: ClassVar[ModelReference] = { - "predecessors": {"default": ["gcp_network", "gcp_subnetwork"], "delete": ["gcp_network", "gcp_subnetwork"]} - } + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["instanceGroups"], action="aggregatedList", @@ -3370,9 +3402,11 @@ class GcpInstanceTemplate(GcpResource): "GCP Instance Templates are reusable configuration templates that define the" " settings for Google Compute Engine virtual machine instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_machine_type"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["instanceTemplates"], action="list", @@ -3386,10 +3420,6 @@ class GcpInstanceTemplate(GcpResource): "id": S("name").or_else(S("id")).or_else(S("selfLink")), "tags": S("labels", default={}), "name": S("name"), - "ctime": S("creationTimestamp"), - "description": S("description"), - "link": S("selfLink"), - "label_fingerprint": S("labelFingerprint"), "deprecation_status": S("deprecated", default={}) >> Bend(GcpDeprecationStatus.mapping), "template_properties": S("properties", default={}) >> Bend(GcpInstanceProperties.mapping), "source_instance": S("sourceInstance"), @@ -3426,6 +3456,7 @@ class GcpInstance(GcpResource, BaseInstance): "GCP Instances are virtual machines in Google Cloud Platform that can be used" " to run applications and services on Google's infrastructure." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["gcp_network", "gcp_subnetwork", "gcp_machine_type"], @@ -3433,7 +3464,7 @@ class GcpInstance(GcpResource, BaseInstance): } } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["instances"], action="aggregatedList", @@ -3625,8 +3656,10 @@ class GcpInterconnectAttachment(GcpResource): " premises network to Google Cloud Platform (GCP) using a dedicated physical" " link." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["interconnectAttachments"], action="aggregatedList", @@ -3731,8 +3764,10 @@ class GcpInterconnectLocation(GcpResource): " connectivity options between an organization's on-premises network and GCP's" " network." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "region", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["interconnectLocations"], action="list", @@ -3831,8 +3866,10 @@ class GcpInterconnect(GcpResource): " and Google Cloud Platform, providing a high-speed and reliable link for data" " transfer." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["interconnects"], action="list", @@ -3910,8 +3947,10 @@ class GcpLicense(GcpResource): kind_description: ClassVar[str] = ( "GCP Licenses are used to authorize the use of certain Google Cloud Platform services and resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "certificate", "group": "compute"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["licenses"], action="list", @@ -4073,13 +4112,15 @@ class GcpMachineImage(GcpResource): " disk that can be used to create new instances with the same configuration" " and data." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "image", "group": "compute"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["gcp_disk"], } } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["machineImages"], action="list", @@ -4159,8 +4200,10 @@ class GcpMachineType(GcpResource, BaseInstanceType): "GCP Machine Types are predefined hardware configurations that define the" " virtualized hardware resources for Google Cloud Platform virtual machines." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "compute"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["machineTypes"], action="aggregatedList", @@ -4171,7 +4214,7 @@ class GcpMachineType(GcpResource, BaseInstanceType): mutate_iam_permissions=[], # can not be mutated ) collect_individual_api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["machineTypes"], action="get", @@ -4331,8 +4374,10 @@ class GcpNetworkEdgeSecurityService(GcpResource): " resources in the Google Cloud Platform network, reducing the risk of" " unauthorized access and data breaches." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "service", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["networkEdgeSecurityServices"], action="aggregatedList", @@ -4408,8 +4453,9 @@ class GcpNetwork(GcpResource, BaseNetwork): "GCP Network is a virtual network infrastructure that allows users to" " securely connect and isolate their resources in the Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["networks"], action="list", @@ -4525,9 +4571,11 @@ class GcpNodeGroup(GcpResource): " capabilities for autoscaling, scheduled maintenance, and specifying node affinity to optimize placement" " and utilization." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "compute"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_node_template"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["nodeGroups"], action="aggregatedList", @@ -4612,9 +4660,11 @@ class GcpNodeTemplate(GcpResource): "GCP Node Template is a reusable configuration template used to create and" " manage virtual machine instances in the Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_disk_type"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["nodeTemplates"], action="aggregatedList", @@ -4669,8 +4719,10 @@ class GcpNodeType(GcpResource): " Google Cloud Platform (GCP). Each node type has specific CPU, memory, and" " storage capacity." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "type", "group": "compute"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["nodeTypes"], action="aggregatedList", @@ -4804,9 +4856,11 @@ class GcpPacketMirroring(GcpResource): " allows users to capture and mirror network traffic in order to monitor and" " analyze network data for security and troubleshooting purposes." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "networking"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_instance", "gcp_subnetwork"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["packetMirrorings"], action="aggregatedList", @@ -4879,9 +4933,11 @@ class GcpPublicAdvertisedPrefix(GcpResource): "A GCP Public Advertised Prefix is a range of IP addresses that can be" " advertised over the internet to allow communication with GCP resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "dns", "group": "networking"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_public_delegated_prefix"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["publicAdvertisedPrefixes"], action="list", @@ -5068,8 +5124,10 @@ class GcpCommitment(GcpResource): "A GCP Commitment is a pre-purchased commitment in Google Cloud Platform," " which provides discounted pricing for certain services and resources." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "compute"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["regionCommitments"], action="aggregatedList", @@ -5127,8 +5185,10 @@ class GcpHealthCheckService(GcpResource): " (GCP) that monitors the health and availability of backend services and" " instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "service", "group": "access_control"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["regionHealthCheckServices"], action="list", @@ -5192,8 +5252,10 @@ class GcpNotificationEndpoint(GcpResource): "A GCP Notification Endpoint is a specific destination to send notifications" " from Google Cloud Platform services to, such as Pub/Sub or HTTP endpoints." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "endpoint", "group": "control"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["regionNotificationEndpoints"], action="list", @@ -5459,8 +5521,10 @@ class GcpSecurityPolicy(GcpResource): " to define and enforce security rules and policies for their virtual machine" " instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["securityPolicies"], action="aggregatedList", @@ -5540,8 +5604,10 @@ class GcpSslCertificate(GcpResource, BaseCertificate): " a website and encrypts information sent to the server, ensuring secure" " communication over the Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["sslCertificates"], action="aggregatedList", @@ -5587,8 +5653,10 @@ class GcpSslPolicy(GcpResource): "SSL policies in Google Cloud Platform (GCP) manage how SSL/TLS connections" " are established and maintained for HTTPS services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "networking"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["sslPolicies"], action="aggregatedList", @@ -5630,12 +5698,14 @@ class GcpTargetHttpProxy(GcpResource): "GCP Target HTTP Proxy is a resource in Google Cloud Platform that allows for" " load balancing and routing of HTTP traffic to backend services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "proxy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["gcp_url_map"]}, "successors": {"default": ["gcp_url_map"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetHttpProxies"], action="aggregatedList", @@ -5676,12 +5746,14 @@ class GcpTargetHttpsProxy(GcpResource): " you to configure SSL/TLS termination for HTTP(S) load balancing, allowing" " secure communication between clients and your backend services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "proxy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_ssl_certificate", "gcp_ssl_policy"], "delete": ["gcp_url_map"]}, "successors": {"default": ["gcp_url_map"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetHttpsProxies"], action="aggregatedList", @@ -5739,12 +5811,14 @@ class GcpTargetTcpProxy(GcpResource): " balance TCP traffic to backend instances based on target proxy" " configuration." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "proxy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["gcp_backend_service"]}, "successors": {"default": ["gcp_backend_service"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetTcpProxies"], action="list", @@ -6231,9 +6305,11 @@ class GcpUrlMap(GcpResource): " service in Google Cloud Platform. It allows for routing of requests based on" " the URL path." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "networking"} reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["gcp_backend_service"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["urlMaps"], action="aggregatedList", @@ -6504,8 +6580,10 @@ class GcpResourcePolicy(GcpResource): " Cloud, enabling users to define scheduling for instance creation, automated snapshots, and" " resource grouping, which can optimize costs and maintain the necessary resource availability." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "control"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["resourcePolicies"], action="aggregatedList", @@ -6815,11 +6893,13 @@ class GcpRouter(GcpResource): "GCP Router is a networking component in Google Cloud Platform that directs" " traffic between virtual networks." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_network"]} } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["routers"], action="aggregatedList", @@ -6884,11 +6964,13 @@ class GcpRoute(GcpResource): "A GCP Route is a rule that specifies the next-hop information for network" " traffic within a Google Cloud Platform virtual network." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "routing_table", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_network"]} } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["routes"], action="list", @@ -7002,9 +7084,10 @@ class GcpServiceAttachment(GcpResource): " Google Cloud services and external services, offering controls like connection preferences, domain" " names management, and protocol support." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["gcp_backend_service", "gcp_subnetwork"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["serviceAttachments"], action="aggregatedList", @@ -7065,9 +7148,10 @@ class GcpSnapshot(GcpResource, BaseSnapshot): "GCP Snapshot is a point-in-time copy of the data in a persistent disk in" " Google Cloud Platform, allowing for data backup and recovery." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_disk"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["snapshots"], action="list", @@ -7190,11 +7274,13 @@ class GcpSubnetwork(GcpResource, BaseSubnet): " that allows for more granular control over network traffic and IP address" " allocation." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "network", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_network"]} } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["subnetworks"], action="aggregatedList", @@ -7262,6 +7348,8 @@ class GcpTargetGrpcProxy(GcpResource): "GCP Target gRPC Proxy is a service in Google Cloud Platform that allows you" " to load balance gRPC traffic to backend services." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "proxy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { "delete": ["gcp_url_map"], @@ -7269,7 +7357,7 @@ class GcpTargetGrpcProxy(GcpResource): "successors": {"default": ["gcp_url_map"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetGrpcProxies"], action="list", @@ -7311,12 +7399,14 @@ class GcpTargetInstance(GcpResource): "Target Instances in Google Cloud Platform are virtual machine instances that" " are used as forwarding targets for load balancing and traffic routing." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_instance"]}, "successors": {"default": ["gcp_instance"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetInstances"], action="aggregatedList", @@ -7359,12 +7449,14 @@ class GcpTargetPool(GcpResource): " receive traffic from a load balancer. They are used to distribute incoming" " requests across multiple backend instances." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["gcp_http_health_check", "gcp_instance"]}, "successors": {"delete": ["gcp_http_health_check", "gcp_instance"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetPools"], action="aggregatedList", @@ -7413,12 +7505,14 @@ class GcpTargetSslProxy(GcpResource): " specific target HTTPS or SSL Proxy load balancing setup in Google Cloud" " Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "proxy", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["gcp_ssl_certificate", "gcp_backend_service"]}, "successors": {"default": ["gcp_ssl_certificate", "gcp_backend_service"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetSslProxies"], action="list", @@ -7466,11 +7560,13 @@ class GcpTargetVpnGateway(GcpResource): " secure communication between on-premises networks and networks running on" " Google Cloud Platform (GCP)." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "gateway", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_network"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["targetVpnGateways"], action="aggregatedList", @@ -7532,12 +7628,13 @@ class GcpVpnGateway(GcpResource, BaseGateway): " Platform that allows users to securely connect their on-premises network to" " their GCP network." ) + kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["gcp_network"], "delete": ["gcp_network"]}, "successors": {"default": ["gcp_interconnect_attachment"]}, } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["vpnGateways"], action="aggregatedList", @@ -7581,6 +7678,8 @@ class GcpVpnTunnel(GcpResource, BaseTunnel): " their on-premises network to their Google Cloud Platform (GCP) Virtual" " Private Cloud (VPC)." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "link", "group": "networking"} reference_kinds: ClassVar[ModelReference] = { "successors": { "default": ["gcp_target_vpn_gateway", "gcp_vpn_gateway", "gcp_router"], @@ -7588,7 +7687,7 @@ class GcpVpnTunnel(GcpResource, BaseTunnel): } } api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="compute", + service=service_name, version="v1", accessors=["vpnTunnels"], action="aggregatedList", diff --git a/plugins/gcp/fix_plugin_gcp/resources/container.py b/plugins/gcp/fix_plugin_gcp/resources/container.py index d35732531c..ceda107c0e 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/container.py +++ b/plugins/gcp/fix_plugin_gcp/resources/container.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import ClassVar, Dict, Optional, List, Type +from typing import ClassVar, Dict, Optional, List, Type, Any from attr import define, field @@ -12,6 +12,8 @@ # This service is called Google Kubernetes Engine in the docs # https://cloud.google.com/kubernetes-engine/docs +service_name = "container" + @define(eq=False, slots=False) class GcpContainerCloudRunConfig: @@ -1091,8 +1093,10 @@ class GcpContainerCluster(BaseManagedKubernetesClusterProvider, GcpResource): " Cloud Platform, which allows users to deploy, manage, and scale" " containerized applications using Kubernetes." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "managed_kubernetes"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="container", + service=service_name, version="v1", accessors=["projects", "locations", "clusters"], action="list", @@ -1302,9 +1306,11 @@ class GcpContainerOperation(GcpResource): " Cloud Platform, including creating, starting, stopping, and deleting" " containers." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "managed_kubernetes"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_container_cluster"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="container", + service=service_name, version="v1", accessors=["projects", "locations", "operations"], action="list", diff --git a/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py b/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py index e283347cb9..25937eacf5 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py +++ b/plugins/gcp/fix_plugin_gcp/resources/sqladmin.py @@ -12,6 +12,7 @@ from fixlib.types import Json log = logging.getLogger("fix.plugins.gcp") +service_name = "sqladmin" @define(eq=False, slots=False) @@ -37,9 +38,11 @@ class GcpSqlBackupRun(GcpResource): "GCP SQL Backup Run is a feature in Google Cloud Platform that allows users" " to schedule and execute automated backups of their SQL databases." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "backup", "group": "database"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_database_instance"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="sqladmin", + service=service_name, version="v1", accessors=["backupRuns"], action="list", @@ -116,8 +119,10 @@ class GcpSqlDatabase(GcpResource): kind_description: ClassVar[str] = ( "GCP SQL Database is a managed relational database service provided by Google Cloud Platform." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "database", "group": "database"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="sqladmin", + service=service_name, version="v1", accessors=["databases"], action="list", @@ -645,9 +650,11 @@ class GcpSqlDatabaseInstance(GcpResource, BaseDatabase): "GCP SQL Database Instance is a resource provided by Google Cloud Platform" " that allows users to create and manage relational databases in the cloud." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "instance", "group": "database"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_ssl_certificate"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="sqladmin", + service=service_name, version="v1", accessors=["instances"], action="list", @@ -941,9 +948,11 @@ class GcpSqlOperation(GcpResource): " instance, such as backups, imports, and exports, including details about execution times, status, and any" " errors encountered." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "database"} reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": ["gcp_sql_database_instance"]}} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="sqladmin", + service=service_name, version="v1", accessors=["operations"], action="list", @@ -1058,8 +1067,10 @@ class GcpSqlUser(GcpResource): "A GCP SQL User refers to a user account that can access and manage databases" " in Google Cloud SQL, a fully-managed relational database service." ) + kind_service: ClassVar[Optional[str]] = service_name + metadata: ClassVar[Dict[str, Any]] = {"icon": "user", "group": "database"} api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="sqladmin", + service=service_name, version="v1", accessors=["users"], action="list", diff --git a/plugins/gcp/fix_plugin_gcp/resources/storage.py b/plugins/gcp/fix_plugin_gcp/resources/storage.py index 95764448b5..84256b0411 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/storage.py +++ b/plugins/gcp/fix_plugin_gcp/resources/storage.py @@ -9,6 +9,8 @@ from fixlib.graph import Graph from fixlib.json_bender import Bender, S, Bend, ForallBend +service_name = "storage" + @define(eq=False, slots=False) class GcpProjectteam: @@ -319,8 +321,9 @@ class GcpObject(GcpResource): "GCP Object, specifically referring to the Google Cloud Storage, is a basic unit of data that is stored" " in Google Cloud Storage, often matching to an individual file." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="storage", + service=service_name, version="v1", accessors=["objects"], action="list", @@ -343,8 +346,9 @@ class GcpBucket(GcpResource, BaseBucket): "A GCP Bucket is a cloud storage container provided by Google Cloud Platform," " allowing users to store and access data in a scalable and durable manner." ) + kind_service: ClassVar[Optional[str]] = service_name api_spec: ClassVar[GcpApiSpec] = GcpApiSpec( - service="storage", + service=service_name, version="v1", accessors=["buckets"], action="list", diff --git a/plugins/k8s/fix_plugin_k8s/base.py b/plugins/k8s/fix_plugin_k8s/base.py index d89721c5db..e6b04ade81 100644 --- a/plugins/k8s/fix_plugin_k8s/base.py +++ b/plugins/k8s/fix_plugin_k8s/base.py @@ -30,6 +30,7 @@ @define(eq=False, slots=False) class KubernetesResource(BaseResource): kind: ClassVar[str] = "kubernetes_resource" + kind_service: ClassVar[Optional[str]] = "kubernetes" mapping: ClassVar[Dict[str, Bender]] = { "id": S("metadata", "uid"),