From f6e2b4c4f440c88dcee5e7b73df8236b3a55db7d Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Tue, 24 Sep 2024 10:56:20 +0200 Subject: [PATCH 1/2] remove _metadata --- fixlib/fixlib/baseresources.py | 1 - fixlib/fixlib/core/model_export.py | 1 - plugins/aws/fix_plugin_aws/resource/base.py | 19 ------------------- .../azure/fix_plugin_azure/resource/base.py | 8 ++++---- .../fix_plugin_azure/resource/cosmosdb.py | 12 ++---------- 5 files changed, 6 insertions(+), 35 deletions(-) diff --git a/fixlib/fixlib/baseresources.py b/fixlib/fixlib/baseresources.py index 851e52a08f..9596fe7337 100644 --- a/fixlib/fixlib/baseresources.py +++ b/fixlib/fixlib/baseresources.py @@ -287,7 +287,6 @@ class BaseResource(ABC): _protected: bool = False _deferred_connections: List[Dict[str, Any]] = field(factory=list) _resource_usage: Dict[MetricNameWithUnit, Dict[str, float]] = field(factory=lambda: defaultdict(dict)) - _metadata: Dict[str, Any] = field(factory=dict) # values will be exported in the metadata section of the node _categories: ClassVar[List[Category]] = [] ctime: Optional[datetime] = field( diff --git a/fixlib/fixlib/core/model_export.py b/fixlib/fixlib/core/model_export.py index 8918ff3798..820d506006 100644 --- a/fixlib/fixlib/core/model_export.py +++ b/fixlib/fixlib/core/model_export.py @@ -334,7 +334,6 @@ def node_to_dict(node: BaseResource, changes_only: bool = False, include_revisio "phantom": node.phantom, "protected": node.protected, "categories": node.categories(), - **node._metadata, }, "usage": node._resource_usage, } diff --git a/plugins/aws/fix_plugin_aws/resource/base.py b/plugins/aws/fix_plugin_aws/resource/base.py index 78f550299f..8d38e51ab4 100644 --- a/plugins/aws/fix_plugin_aws/resource/base.py +++ b/plugins/aws/fix_plugin_aws/resource/base.py @@ -531,25 +531,6 @@ def add_node( # If there is no provider_link: try to create one from template. # The template can use the complete src json, plus some base attributes. - if node._metadata.get("provider_link") is None and (link_tpl := meta.get("provider_link_tpl")): - try: - all_params = True - link = link_tpl - for placeholder in TemplateRE.findall(link_tpl): - value = ( - fn(node) - if (fn := TemplateFn.get(placeholder)) - else (value_in_path(source, placeholder) or getattr(node, placeholder, None)) - ) - if value is None: - all_params = False - break - else: - link = link.replace("{" + placeholder + "}", urlquote(str(value))) - if all_params: - node._metadata["provider_link"] = link - except Exception as e: - log.warning(f"Can not compute provider_link for {node} with template: {link_tpl}: {e}") with self.graph_nodes_access.write_access: self.graph.add_node(node, source=source or {}) diff --git a/plugins/azure/fix_plugin_azure/resource/base.py b/plugins/azure/fix_plugin_azure/resource/base.py index 6b464821d3..6dded4ec9a 100644 --- a/plugins/azure/fix_plugin_azure/resource/base.py +++ b/plugins/azure/fix_plugin_azure/resource/base.py @@ -93,6 +93,10 @@ class MicrosoftResource(BaseResource): etag: Optional[str] = field(default=None, metadata={'description': 'A unique read-only string that changes whenever the resource is updated.'}) # fmt: skip provisioning_state: Optional[str] = field(default=None, metadata={'description': 'The current provisioning state.'}) # fmt: skip + @property + def provider_link(self) -> str: + return f"https://portal.azure.com/#@/resource{self.id}/overview" + @property def resource_subscription_id(self) -> Optional[str]: return self.extract_part("subscriptions") @@ -857,10 +861,6 @@ def add_node(self, node: MicrosoftResourceType, source: Optional[Json] = None) - # add edge from subscription to resource last_edge_key = self.add_edge(self.account, node=node) - # create provider link - if node._metadata.get("provider_link") is None and node._is_provider_link: - node._metadata["provider_link"] = f"https://portal.azure.com/#@/resource{node.id}/overview" - if last_edge_key is not None: with self.graph_access_lock.write_access: self.graph.add_node(node, source=source or {}) diff --git a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py index a18d72e671..8d242527c6 100644 --- a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py +++ b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py @@ -985,20 +985,12 @@ def post_process(self, graph_builder: GraphBuilder, source: Json) -> None: ( "mongodbRoleDefinitions", AzureCosmosDBMongoDBRoleDefinition, - { - "BadRequest": mongo_cosmosdb_error_message.format( - provider_link=self._metadata.get("provider_link") - ) - }, + {"BadRequest": mongo_cosmosdb_error_message.format(provider_link=self.provider_link)}, ), ( "mongodbUserDefinitions", AzureCosmosDBMongoDBUserDefinition, - { - "BadRequest": mongo_cosmosdb_error_message.format( - provider_link=self._metadata.get("provider_link") - ) - }, + {"BadRequest": mongo_cosmosdb_error_message.format(provider_link=self.provider_link)}, ), ] ) From 524c403cf87a1ae23777d742c3f7b4f26498dd07 Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Tue, 24 Sep 2024 11:06:49 +0200 Subject: [PATCH 2/2] remove provider_link --- plugins/aws/fix_plugin_aws/resource/acm.py | 2 +- .../aws/fix_plugin_aws/resource/amazonq.py | 2 - .../aws/fix_plugin_aws/resource/apigateway.py | 12 +++--- plugins/aws/fix_plugin_aws/resource/athena.py | 4 +- .../fix_plugin_aws/resource/autoscaling.py | 2 +- plugins/aws/fix_plugin_aws/resource/backup.py | 17 +++------ plugins/aws/fix_plugin_aws/resource/base.py | 11 ++---- .../aws/fix_plugin_aws/resource/bedrock.py | 17 --------- .../fix_plugin_aws/resource/cloudformation.py | 4 +- .../aws/fix_plugin_aws/resource/cloudfront.py | 12 +++--- .../aws/fix_plugin_aws/resource/cloudtrail.py | 2 +- .../aws/fix_plugin_aws/resource/cloudwatch.py | 6 +-- .../aws/fix_plugin_aws/resource/cognito.py | 6 +-- .../aws/fix_plugin_aws/resource/dynamodb.py | 2 +- plugins/aws/fix_plugin_aws/resource/ec2.py | 38 +++++++++---------- plugins/aws/fix_plugin_aws/resource/ecr.py | 2 +- plugins/aws/fix_plugin_aws/resource/ecs.py | 8 ++-- plugins/aws/fix_plugin_aws/resource/efs.py | 6 +-- plugins/aws/fix_plugin_aws/resource/eks.py | 2 +- .../fix_plugin_aws/resource/elasticache.py | 2 +- .../resource/elasticbeanstalk.py | 4 +- plugins/aws/fix_plugin_aws/resource/elb.py | 2 +- plugins/aws/fix_plugin_aws/resource/elbv2.py | 4 +- .../aws/fix_plugin_aws/resource/glacier.py | 2 +- plugins/aws/fix_plugin_aws/resource/iam.py | 9 ++--- .../aws/fix_plugin_aws/resource/kinesis.py | 2 +- plugins/aws/fix_plugin_aws/resource/kms.py | 2 +- .../aws/fix_plugin_aws/resource/lambda_.py | 2 +- .../aws/fix_plugin_aws/resource/opensearch.py | 2 +- plugins/aws/fix_plugin_aws/resource/rds.py | 8 ++-- .../aws/fix_plugin_aws/resource/route53.py | 2 +- plugins/aws/fix_plugin_aws/resource/s3.py | 4 +- .../aws/fix_plugin_aws/resource/sagemaker.py | 2 +- .../fix_plugin_aws/resource/secretsmanager.py | 2 +- .../fix_plugin_aws/resource/service_quotas.py | 2 +- plugins/aws/fix_plugin_aws/resource/sns.py | 4 +- plugins/aws/fix_plugin_aws/resource/sqs.py | 2 +- plugins/aws/fix_plugin_aws/resource/ssm.py | 4 +- plugins/aws/fix_plugin_aws/resource/waf.py | 2 +- 39 files changed, 95 insertions(+), 123 deletions(-) diff --git a/plugins/aws/fix_plugin_aws/resource/acm.py b/plugins/aws/fix_plugin_aws/resource/acm.py index 0575cbd0de..21e22e6a77 100644 --- a/plugins/aws/fix_plugin_aws/resource/acm.py +++ b/plugins/aws/fix_plugin_aws/resource/acm.py @@ -70,7 +70,7 @@ class AwsAcmExtendedKeyUsage: class AwsAcmCertificate(AwsResource, BaseCertificate): kind: ClassVar[str] = "aws_acm_certificate" 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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") diff --git a/plugins/aws/fix_plugin_aws/resource/amazonq.py b/plugins/aws/fix_plugin_aws/resource/amazonq.py index 5f4c95d9ca..22efb0997f 100644 --- a/plugins/aws/fix_plugin_aws/resource/amazonq.py +++ b/plugins/aws/fix_plugin_aws/resource/amazonq.py @@ -55,7 +55,6 @@ class AwsQBusinessApplication(AmazonQTaggable, AwsResource): kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "application", "group": "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}", } reference_kinds: ClassVar[ModelReference] = { @@ -356,7 +355,6 @@ class AwsQBusinessDataSource(AmazonQTaggable, AwsResource): metadata: ClassVar[Dict[str, Any]] = {"icon": "bucket", "group": "ai"} # Collected via AwsQBusinessApplication() aws_metadata: ClassVar[Dict[str, Any]] = { - "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/amazonq/business/applications/{application_id}/indices/{indice_id}/datasources/{id}/details?region={region}", # fmt: skip "arn_tpl": "arn:{partition}:qbusiness:{region}:{account}:application/{application_id}/index/{indice_id}/data-source/{id}", "extra_args_for_arn": ["application_id", "indice_id"], } diff --git a/plugins/aws/fix_plugin_aws/resource/apigateway.py b/plugins/aws/fix_plugin_aws/resource/apigateway.py index c55708dfa5..d875634eb1 100644 --- a/plugins/aws/fix_plugin_aws/resource/apigateway.py +++ b/plugins/aws/fix_plugin_aws/resource/apigateway.py @@ -190,7 +190,7 @@ class AwsApiGatewayResource(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -255,7 +255,7 @@ class AwsApiGatewayAuthorizer(AwsResource): " 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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] = { @@ -350,7 +350,7 @@ class AwsApiGatewayStage(ApiGatewayTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -414,7 +414,7 @@ class AwsApiGatewayDeployment(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}} @@ -476,7 +476,7 @@ class AwsApiGatewayRestApi(ApiGatewayTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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" ) @@ -634,7 +634,7 @@ class AwsApiGatewayDomainName(ApiGatewayTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 31542e4ac6..477d5f9654 100644 --- a/plugins/aws/fix_plugin_aws/resource/athena.py +++ b/plugins/aws/fix_plugin_aws/resource/athena.py @@ -99,7 +99,7 @@ class AwsAthenaWorkGroup(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -216,7 +216,7 @@ class AwsAthenaDataCatalog(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 f0caaeeed3..a985408135 100644 --- a/plugins/aws/fix_plugin_aws/resource/autoscaling.py +++ b/plugins/aws/fix_plugin_aws/resource/autoscaling.py @@ -277,7 +277,7 @@ class AwsAutoScalingWarmPoolConfiguration: 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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" diff --git a/plugins/aws/fix_plugin_aws/resource/backup.py b/plugins/aws/fix_plugin_aws/resource/backup.py index 413318cb1b..893fb667fc 100644 --- a/plugins/aws/fix_plugin_aws/resource/backup.py +++ b/plugins/aws/fix_plugin_aws/resource/backup.py @@ -76,7 +76,6 @@ class AwsBackupJob(AwsResource): ) 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"]}, @@ -159,7 +158,6 @@ class AwsBackupProtectedResource(AwsResource): ) 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": { @@ -237,7 +235,7 @@ class AwsBackupPlan(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -319,7 +317,7 @@ class AwsBackupVault(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -452,7 +450,6 @@ class AwsBackupRecoveryPoint(AwsResource): ) 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"]}, } @@ -605,7 +602,7 @@ class AwsBackupReportPlan(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:backup:{region}:{account}:report-plan:{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": ["aws_backup_framework"]}, } @@ -695,7 +692,7 @@ class AwsBackupRestoreTestingPlan(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -775,7 +772,7 @@ class AwsBackupLegalHold(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -842,7 +839,6 @@ class AwsBackupRestoreJob(AwsResource): ) 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"]}, } @@ -908,7 +904,6 @@ class AwsBackupCopyJob(AwsResource): ) 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"]}, @@ -983,7 +978,7 @@ class AwsBackupFramework(BackupResourceTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 8d38e51ab4..dfbbf6b356 100644 --- a/plugins/aws/fix_plugin_aws/resource/base.py +++ b/plugins/aws/fix_plugin_aws/resource/base.py @@ -2,24 +2,22 @@ import logging import re -from urllib.parse import quote_plus as urlquote from abc import ABC from concurrent.futures import Future from datetime import datetime, timezone, timedelta from functools import lru_cache -from typing import Any, Callable, ClassVar, Dict, Iterator, List, Optional, Type, TypeVar, Tuple - from math import ceil +from typing import Any, Callable, ClassVar, Dict, Iterator, List, Optional, Type, TypeVar, Tuple from attr import evolve, field from attrs import define from boto3.exceptions import Boto3Error +from fixinventorydata.cloud import instances as cloud_instance_data, regions as cloud_region_data from fix_plugin_aws.aws_client import AwsClient from fix_plugin_aws.configuration import AwsConfig from fix_plugin_aws.resource.pricing import AwsPricingPrice from fix_plugin_aws.utils import arn_partition -from fixlib.utils import utc from fixlib.baseresources import ( BaseAccount, BaseIamPrincipal, @@ -40,7 +38,7 @@ from fixlib.proc import set_thread_name from fixlib.threading import ExecutorQueue from fixlib.types import Json -from fixinventorydata.cloud import instances as cloud_instance_data, regions as cloud_region_data +from fixlib.utils import utc log = logging.getLogger("fix.plugins.aws") @@ -274,7 +272,6 @@ class AwsAccount(BaseAccount, AwsResource, BaseIamPrincipal): " buckets, and RDS databases. It allows users to access and manage their" " resources on the Amazon Web Services platform." ) - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/billing/home?region={region}#/account"} # fmt: skip reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["aws_region"]}} account_alias: Optional[str] = "" @@ -394,7 +391,7 @@ class AwsEc2VolumeType(AwsResource, BaseVolumeType): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip class GraphBuilder: diff --git a/plugins/aws/fix_plugin_aws/resource/bedrock.py b/plugins/aws/fix_plugin_aws/resource/bedrock.py index 460917a133..27407fb85f 100644 --- a/plugins/aws/fix_plugin_aws/resource/bedrock.py +++ b/plugins/aws/fix_plugin_aws/resource/bedrock.py @@ -91,7 +91,6 @@ class AwsBedrockFoundationModel(BaseAIModel, AwsResource): "These models are pre-trained and can be used as a starting point for various machine learning tasks." ) kind_service: ClassVar[Optional[str]] = service_name - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/providers?model={id}"} # fmt: skip metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("bedrock", "list-foundation-models", "modelSummaries") mapping: ClassVar[Dict[str, Bender]] = { @@ -137,7 +136,6 @@ class AwsBedrockCustomModel(BedrockTaggable, BaseAIModel, AwsResource): "tailored to specific needs, providing flexibility in model customization for a variety of applications." ) kind_service: ClassVar[Optional[str]] = service_name - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/custom-models/{name}"} # fmt: skip metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_bedrock_model_customization_job", AwsKmsKey.kind]}, @@ -238,7 +236,6 @@ class AwsBedrockProvisionedModelThroughput(BedrockTaggable, AwsResource): "ensuring consistent performance and scalability to handle varying workloads." ) metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/provisioned-throughput/{name}"} # fmt: skip kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AwsBedrockCustomModel.kind, AwsBedrockFoundationModel.kind]}, @@ -420,7 +417,6 @@ class AwsBedrockGuardrail(BedrockTaggable, AwsResource): api_spec: ClassVar[AwsApiSpec] = AwsApiSpec( "bedrock", "list-guardrails", "guardrails", expected_errors=["AccessDeniedException"] ) - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/guardrails/guardrail/{name}/{id}"} # fmt: skip metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "ai"} kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = { @@ -537,7 +533,6 @@ class AwsBedrockModelCustomizationJob(BedrockTaggable, BaseAIJob, AwsResource): "to specific datasets and tasks, optimizing the model for unique use cases." ) kind_service: ClassVar[Optional[str]] = service_name - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/custom-models/item/?arn={arn}"} # fmt: skip metadata: ClassVar[Dict[str, Any]] = {"icon": "job", "group": "ai"} reference_kinds: ClassVar[ModelReference] = { "predecessors": { @@ -928,9 +923,6 @@ class AwsBedrockAgent(BedrockTaggable, AwsResource): "AWS Bedrock Agent is an intelligent service designed to facilitate communication with machine learning models, " "acting as a mediator between applications and model execution workflows." ) - aws_metadata: ClassVar[Dict[str, Any]] = { - "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/agents/{id}" - } metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} kind_service: ClassVar[Optional[str]] = "bedrock-agent" reference_kinds: ClassVar[ModelReference] = { @@ -1074,9 +1066,6 @@ class AwsBedrockAgentVersion(BedrockTaggable, AwsResource): "and enhancements across different versions of the agent for improved functionality." ) kind_service: ClassVar[Optional[str]] = "bedrock-agent" - aws_metadata: ClassVar[Dict[str, Any]] = { - "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/agents/{id}/versions/{version}" - } metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "ai"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AwsIamRole.kind, AwsBedrockFoundationModel.kind]}, @@ -1369,9 +1358,6 @@ class AwsBedrockAgentKnowledgeBase(BedrockTaggable, AwsResource): "to provide accurate responses and perform tasks based on learned information." ) kind_service: ClassVar[Optional[str]] = "bedrock-agent" - aws_metadata: ClassVar[Dict[str, Any]] = { - "provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/knowledge-bases/knowledge-base/{name}/{id}/0" - } metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AwsIamRole.kind]}, @@ -1539,7 +1525,6 @@ class AwsBedrockAgentPrompt(BedrockTaggable, AwsResource): ) kind_service: ClassVar[Optional[str]] = "bedrock-agent" metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/prompt-management/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "successors": {"default": [AwsBedrockCustomModel.kind, AwsKmsKey.kind]}, } @@ -1845,7 +1830,6 @@ class AwsBedrockAgentFlow(BedrockTaggable, AwsResource): ) kind_service: ClassVar[Optional[str]] = "bedrock-agent" metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "ai"} - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/prompt-flows/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AwsIamRole.kind]}, "successors": { @@ -1976,7 +1960,6 @@ class AwsBedrockAgentFlowVersion(BedrockTaggable, AwsResource): ) kind_service: ClassVar[Optional[str]] = "bedrock-agent" metadata: ClassVar[Dict[str, Any]] = {"icon": "version", "group": "ai"} - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/bedrock/home?region={region_id}#/prompt-flows/{id}/versions/{version}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"default": [AwsIamRole.kind]}, "successors": {"default": [AwsKmsKey.kind]}, diff --git a/plugins/aws/fix_plugin_aws/resource/cloudformation.py b/plugins/aws/fix_plugin_aws/resource/cloudformation.py index c534ba4650..51d6cbfc20 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudformation.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudformation.py @@ -91,7 +91,7 @@ class AwsCloudFormationStackDriftInformation: class AwsCloudFormationStack(AwsResource, BaseStack): kind: ClassVar[str] = "aws_cloudformation_stack" kind_display: ClassVar[str] = "AWS CloudFormation Stack" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cloudformation/home?region={region}#/stacks/stackinfo?stackId={id}", "arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack/{name}/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudformation:{region}:{account}:stack/{name}/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "CloudFormation Stacks are a collection of AWS resources that are created," " updated, or deleted together as a single unit." @@ -261,7 +261,7 @@ class AwsCloudFormationStackSet(AwsResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "stack", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), diff --git a/plugins/aws/fix_plugin_aws/resource/cloudfront.py b/plugins/aws/fix_plugin_aws/resource/cloudfront.py index 118c7e6acb..f62130051c 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudfront.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudfront.py @@ -588,7 +588,7 @@ class AwsCloudFrontDistribution(CloudFrontTaggable, CloudFrontResource, AwsResou ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cloudfront::{account}:distribution/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": {"delete": ["aws_lambda_function"]}, "successors": { @@ -770,7 +770,7 @@ class AwsCloudFrontFunction(CloudFrontTaggable, BaseServerlessFunction, CloudFro ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"} ) @@ -823,7 +823,7 @@ class AwsCloudFrontPublicKey(CloudFrontResource, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -887,7 +887,7 @@ class AwsCloudFrontRealtimeLogConfig(CloudFrontTaggable, CloudFrontResource, Aws ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "config", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -1124,7 +1124,7 @@ class AwsCloudFrontResponseHeadersPolicy(CloudFrontResource, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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" ) @@ -1359,7 +1359,7 @@ class AwsCloudFrontCachePolicy(CloudFrontResource, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), diff --git a/plugins/aws/fix_plugin_aws/resource/cloudtrail.py b/plugins/aws/fix_plugin_aws/resource/cloudtrail.py index 46e647f488..01878ec6c4 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudtrail.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudtrail.py @@ -142,7 +142,7 @@ class AwsCloudTrail(AwsResource): " auditing, and risk auditing of your AWS account." ) metadata: ClassVar[Dict[str, Any]] = {"icon": "log", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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]] = { diff --git a/plugins/aws/fix_plugin_aws/resource/cloudwatch.py b/plugins/aws/fix_plugin_aws/resource/cloudwatch.py index 046014eac3..f28a01ada0 100644 --- a/plugins/aws/fix_plugin_aws/resource/cloudwatch.py +++ b/plugins/aws/fix_plugin_aws/resource/cloudwatch.py @@ -240,7 +240,7 @@ class AwsCloudwatchAlarm(CloudwatchTaggable, AwsResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "alarm", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, @@ -343,7 +343,7 @@ class AwsCloudwatchLogGroup(LogsTaggable, AwsResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "group", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, @@ -414,7 +414,7 @@ class AwsCloudwatchMetricFilter(AwsResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "resource", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 6cfff439ed..7ea28cd98d 100644 --- a/plugins/aws/fix_plugin_aws/resource/cognito.py +++ b/plugins/aws/fix_plugin_aws/resource/cognito.py @@ -27,7 +27,7 @@ class AwsCognitoGroup(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]} } @@ -98,7 +98,7 @@ class AwsCognitoMFAOptionType: class AwsCognitoUser(AwsResource, BaseUser): # collection of user resources happens in AwsCognitoUserPool.collect() kind: ClassVar[str] = "aws_cognito_user" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/cognito/v2/idp/user-pools/{_pool_id}/users/details/{id}?region={region}", "arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:user/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:cognito-idp:{region}:{account}:user/{id}"} # fmt: skip kind_display: ClassVar[str] = "AWS Cognito User" kind_description: ClassVar[str] = ( @@ -213,7 +213,7 @@ class AwsCognitoUserPool(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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/dynamodb.py b/plugins/aws/fix_plugin_aws/resource/dynamodb.py index 7db467d4d3..d80f1c197a 100644 --- a/plugins/aws/fix_plugin_aws/resource/dynamodb.py +++ b/plugins/aws/fix_plugin_aws/resource/dynamodb.py @@ -366,7 +366,7 @@ class AwsDynamoDbTable(DynamoDbTaggable, AwsResource): ) 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 + 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-tables", "TableNames") reference_kinds: ClassVar[ModelReference] = { "successors": {"default": ["aws_kinesis_stream", "aws_kms_key"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/ec2.py b/plugins/aws/fix_plugin_aws/resource/ec2.py index 8db14ce0b6..e82780fb6a 100644 --- a/plugins/aws/fix_plugin_aws/resource/ec2.py +++ b/plugins/aws/fix_plugin_aws/resource/ec2.py @@ -515,7 +515,7 @@ class AwsEc2VolumeAttachment: class AwsEc2Volume(EC2Taggable, AwsResource, BaseVolume): kind: ClassVar[str] = "aws_ec2_volume" kind_display: ClassVar[str] = "AWS EC2 Volume" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#VolumeDetails:volumeId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:volume/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Volumes are block-level storage devices that can be attached to EC2" " instances in Amazon's cloud, providing additional storage for applications" @@ -736,7 +736,7 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsEc2Snapshot(EC2Taggable, AwsResource, BaseSnapshot): kind: ClassVar[str] = "aws_ec2_snapshot" kind_display: ClassVar[str] = "AWS EC2 Snapshot" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#SnapshotDetails:snapshotId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:snapshot/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:snapshot/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Snapshots are backups of Amazon Elastic Block Store (EBS)" " volumes, allowing users to capture and store point-in-time copies of their" @@ -810,7 +810,7 @@ class AwsEc2KeyPair(EC2Taggable, AwsResource, BaseKeyPair): 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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": { @@ -1246,7 +1246,7 @@ class AwsEc2PrivateDnsNameOptionsResponse: class AwsEc2Instance(EC2Taggable, AwsResource, BaseInstance): kind: ClassVar[str] = "aws_ec2_instance" kind_display: ClassVar[str] = "AWS EC2 Instance" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#InstanceDetails:instanceId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:instance/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:instance/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Instances are virtual servers in Amazon's cloud, allowing users to run" " applications on the Amazon Web Services infrastructure." @@ -1583,7 +1583,7 @@ class AwsEc2ReservedInstances(EC2Taggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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]] = { @@ -1720,7 +1720,7 @@ class AwsEc2NetworkAcl(EC2Taggable, AwsResource, BaseNetworkAcl): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, @@ -1767,7 +1767,7 @@ def called_mutator_apis(cls) -> List[AwsApiSpec]: class AwsEc2ElasticIp(EC2Taggable, AwsResource, BaseIPAddress): kind: ClassVar[str] = "aws_ec2_elastic_ip" kind_display: ClassVar[str] = "AWS EC2 Elastic IP" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#ElasticIpDetails:AllocationId={AllocationId}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:elastic-ip/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:elastic-ip/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "Elastic IP addresses are static, IPv4 addresses designed for dynamic cloud" " computing. They allow you to mask the failure or replacement of an instance" @@ -1946,7 +1946,7 @@ class AwsEc2NetworkInterface(EC2Taggable, AwsResource, BaseNetworkInterface): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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": { @@ -2113,7 +2113,7 @@ class AwsEc2VpcCidrBlockAssociation: class AwsEc2Vpc(EC2Taggable, AwsResource, BaseNetwork): kind: ClassVar[str] = "aws_vpc" kind_display: ClassVar[str] = "AWS VPC" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#VpcDetails:VpcId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS VPC stands for Amazon Virtual Private Cloud. It is a virtual network" " dedicated to your AWS account, allowing you to launch AWS resources in a" @@ -2227,7 +2227,7 @@ class AwsEc2VpcPeeringConnectionStateReason: class AwsEc2VpcPeeringConnection(EC2Taggable, AwsResource, BasePeeringConnection): kind: ClassVar[str] = "aws_vpc_peering_connection" kind_display: ClassVar[str] = "AWS VPC Peering Connection" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#PeeringConnectionDetails:vpcPeeringConnectionId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc-peering-connection/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc-peering-connection/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "VPC Peering Connection is a networking connection between two Amazon Virtual" " Private Clouds (VPCs) that enables you to route traffic between them using" @@ -2313,7 +2313,7 @@ class AwsEc2LastError: class AwsEc2VpcEndpoint(EC2Taggable, AwsResource, BaseEndpoint): kind: ClassVar[str] = "aws_vpc_endpoint" kind_display: ClassVar[str] = "AWS VPC Endpoint" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#Endpoints:vpcEndpointId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc-endpoint/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:vpc-endpoint/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "VPC Endpoints enable secure and private communication between your VPC and" " supported AWS services without using public IPs or requiring traffic to" @@ -2456,7 +2456,7 @@ class AwsEc2PrivateDnsNameOptionsOnLaunch: class AwsEc2Subnet(EC2Taggable, AwsResource, BaseSubnet): kind: ClassVar[str] = "aws_ec2_subnet" kind_display: ClassVar[str] = "AWS EC2 Subnet" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#SubnetDetails:subnetId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:subnet/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:subnet/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "An AWS EC2 Subnet is a logical subdivision of a VPC (Virtual Private Cloud)" " in Amazon's cloud, allowing users to group resources and control network" @@ -2635,7 +2635,7 @@ class AwsEc2SecurityGroup(EC2Taggable, AwsResource, BaseSecurityGroup): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, @@ -2772,7 +2772,7 @@ class AwsEc2ProvisionedBandwidth: 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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" @@ -2913,7 +2913,7 @@ class AwsEc2InternetGateway(EC2Taggable, AwsResource, BaseGateway): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, @@ -3056,7 +3056,7 @@ class AwsEc2Route: class AwsEc2RouteTable(EC2Taggable, AwsResource, BaseRoutingTable): kind: ClassVar[str] = "aws_ec2_route_table" kind_display: ClassVar[str] = "AWS EC2 Route Table" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/vpcconsole/home?region={region}#RouteTableDetails:RouteTableId={id}", "arn_tpl": "arn:{partition}:ec2:{region}:{account}:route-table/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:route-table/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EC2 Route Tables are used to determine where network traffic is directed" " within a Virtual Private Cloud (VPC) in Amazon's cloud infrastructure." @@ -3206,7 +3206,7 @@ class AwsEc2Host(EC2Taggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]} @@ -3408,7 +3408,7 @@ class AwsEc2Image(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ec2:{region}:{account}:image/{id}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = {"successors": {"default": ["aws_ec2_snapshot"]}} api_spec: ClassVar[AwsApiSpec] = AwsApiSpec("ec2", "describe-images", "Images", {"Owners": ["self"]}) mapping: ClassVar[Dict[str, Bender]] = { @@ -3977,7 +3977,7 @@ class AwsEc2LaunchTemplate(EC2Taggable, AwsResource): 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 fa0a4336e8..16b283315a 100644 --- a/plugins/aws/fix_plugin_aws/resource/ecr.py +++ b/plugins/aws/fix_plugin_aws/resource/ecr.py @@ -31,7 +31,7 @@ class AwsEcrRepository(AwsResource): 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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") mapping: ClassVar[Dict[str, Bender]] = { diff --git a/plugins/aws/fix_plugin_aws/resource/ecs.py b/plugins/aws/fix_plugin_aws/resource/ecs.py index fae9cc27b1..4478ae394d 100644 --- a/plugins/aws/fix_plugin_aws/resource/ecs.py +++ b/plugins/aws/fix_plugin_aws/resource/ecs.py @@ -433,7 +433,7 @@ class AwsEcsTask(EcsTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ecs:{region}:{account}:task/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_iam_role", "aws_ecs_task_definition"], @@ -1082,7 +1082,7 @@ class AwsEcsTaskDefinition(EcsTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"} ) @@ -1505,7 +1505,7 @@ class AwsEcsService(EcsTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"], @@ -1942,7 +1942,7 @@ class AwsEcsCluster(EcsTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 0d9b6eafac..8b79c74518 100644 --- a/plugins/aws/fix_plugin_aws/resource/efs.py +++ b/plugins/aws/fix_plugin_aws/resource/efs.py @@ -57,7 +57,7 @@ class AwsEfsMountTarget(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:efs:{region}:{account}:mount-target/{id}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("MountTargetId"), "owner_id": S("OwnerId"), @@ -80,7 +80,7 @@ def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: class AwsEfsFileSystem(EfsTaggable, AwsResource, BaseNetworkShare): kind: ClassVar[str] = "aws_efs_file_system" kind_display: ClassVar[str] = "AWS EFS File System" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/efs/home?region={region}#/file-systems/{FileSystemId}", "arn_tpl": "arn:{partition}:efs:{region}:{account}:file-system/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:efs:{region}:{account}:file-system/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "EFS (Elastic File System) provides a scalable and fully managed file storage" " service for Amazon EC2 instances." @@ -239,7 +239,7 @@ class AwsEfsAccessPoint(AwsResource, EfsTaggable): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 3c4915a7ba..9b21446877 100644 --- a/plugins/aws/fix_plugin_aws/resource/eks.py +++ b/plugins/aws/fix_plugin_aws/resource/eks.py @@ -412,7 +412,7 @@ class AwsEksCluster(EKSTaggable, BaseManagedKubernetesClusterProvider, AwsResour ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 2ae7d557e0..9d6adda824 100644 --- a/plugins/aws/fix_plugin_aws/resource/elasticache.py +++ b/plugins/aws/fix_plugin_aws/resource/elasticache.py @@ -257,7 +257,7 @@ class AwsElastiCacheCacheCluster(ElastiCacheTaggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:elasticache:{region}:{account}:cache-cluster/{name}"} # fmt: skip reference_kinds: ClassVar[ModelReference] = { "predecessors": { "default": ["aws_ec2_security_group"], diff --git a/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py b/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py index 5cbe2b777c..0b5ec0a0a2 100644 --- a/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py +++ b/plugins/aws/fix_plugin_aws/resource/elasticbeanstalk.py @@ -98,7 +98,7 @@ class AwsBeanstalkApplication(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -296,7 +296,7 @@ class AwsBeanstalkEnvironment(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 4097ea8290..040bf876bf 100644 --- a/plugins/aws/fix_plugin_aws/resource/elb.py +++ b/plugins/aws/fix_plugin_aws/resource/elb.py @@ -258,7 +258,7 @@ class AwsElb(ElbTaggable, AwsResource, BaseLoadBalancer): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 609922d157..d6ceb199f4 100644 --- a/plugins/aws/fix_plugin_aws/resource/elbv2.py +++ b/plugins/aws/fix_plugin_aws/resource/elbv2.py @@ -346,7 +346,7 @@ class AwsAlbListener: class AwsAlb(ElbV2Taggable, AwsResource, BaseLoadBalancer): kind: ClassVar[str] = "aws_alb" kind_display: ClassVar[str] = "AWS ALB" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/ec2/home?region={region}#LoadBalancer:loadBalancerArn={arn}", "arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:loadbalancer/app/{name}/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:elasticloadbalancing:{region}:{account}:loadbalancer/app/{name}/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS ALB is an Application Load Balancer that distributes incoming" " application traffic across multiple targets, such as EC2 instances, in" @@ -606,7 +606,7 @@ class AwsAlbTargetGroup(ElbV2Taggable, AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 8af3ccf495..428a23b45e 100644 --- a/plugins/aws/fix_plugin_aws/resource/glacier.py +++ b/plugins/aws/fix_plugin_aws/resource/glacier.py @@ -218,7 +218,7 @@ class AwsGlacierVault(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 35096b7443..b7117fbedb 100644 --- a/plugins/aws/fix_plugin_aws/resource/iam.py +++ b/plugins/aws/fix_plugin_aws/resource/iam.py @@ -108,7 +108,7 @@ class AwsIamRoleLastUsed: class AwsIamRole(AwsResource, BaseRole, BaseIamPrincipal): # Note: this resource is collected via AwsIamUser.collect. kind: ClassVar[str] = "aws_iam_role" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iam/home?region={region}#/roles/details/{RoleName}", "arn_tpl": "arn:{partition}:iam:{region}:{account}:role/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam:{region}:{account}:role/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS IAM Role" kind_description: ClassVar[str] = ( "IAM Roles are a way to delegate permissions to entities that you trust. IAM" @@ -315,7 +315,7 @@ def default_policy_document(policy: Json) -> Optional[AwsIamPolicyVersion]: class AwsIamPolicy(AwsResource, BasePolicy): # Note: this resource is collected via AwsIamUser.collect. kind: ClassVar[str] = "aws_iam_policy" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iamv2/home?region={region}#/policies/details/{arn}?section=permissions", "arn_tpl": "arn:{partition}:iam::{account}:policy/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam::{account}:policy/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS IAM Policy" kind_description: ClassVar[str] = ( "IAM Policies in AWS are used to define permissions and access controls for" @@ -392,7 +392,7 @@ def service_name(cls) -> str: class AwsIamGroup(AwsResource, BaseGroup): # Note: this resource is collected via AwsIamUser.collect. kind: ClassVar[str] = "aws_iam_group" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iam/home?region={region}#/groups/details/{name}", "arn_tpl": "arn:{partition}:iam::{account}:group/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam::{account}:group/{name}"} # fmt: skip kind_display: ClassVar[str] = "AWS IAM Group" kind_description: ClassVar[str] = ( "IAM Groups are collections of IAM users. They allow you to manage" @@ -494,7 +494,6 @@ class AwsIamAccessKeyLastUsed: class AwsIamAccessKey(AwsResource, BaseAccessKey): # Note: this resource is collected via AwsIamUser.collect. kind: ClassVar[str] = "aws_iam_access_key" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iam/home?region={region}#/users/{UserName}?section=security_credentials&display=access_key&accessKeyID={AccessKeyId}"} # fmt: skip kind_display: ClassVar[str] = "AWS IAM Access Key" kind_description: ClassVar[str] = ( "An AWS IAM Access Key is used to securely access AWS services and resources using API operations." @@ -649,7 +648,7 @@ class AwsRootUser(AwsResource, BaseUser, BaseIamPrincipal): class AwsIamUser(AwsResource, BaseUser, BaseIamPrincipal): kind: ClassVar[str] = "aws_iam_user" kind_display: ClassVar[str] = "AWS IAM User" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/iam/home?region={region}#/users/details/{name}", "arn_tpl": "arn:{partition}:iam::{account}:user/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:iam::{account}:user/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "IAM Users are identities created within AWS Identity and Access Management" " (IAM) that can be assigned permissions to access and manage AWS resources." diff --git a/plugins/aws/fix_plugin_aws/resource/kinesis.py b/plugins/aws/fix_plugin_aws/resource/kinesis.py index 202d955451..73681c2762 100644 --- a/plugins/aws/fix_plugin_aws/resource/kinesis.py +++ b/plugins/aws/fix_plugin_aws/resource/kinesis.py @@ -99,7 +99,7 @@ class AwsKinesisStream(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 ff0c6e8a8a..0d483d9c3c 100644 --- a/plugins/aws/fix_plugin_aws/resource/kms.py +++ b/plugins/aws/fix_plugin_aws/resource/kms.py @@ -73,7 +73,7 @@ class AwsKmsKey(AwsResource, BaseAccessKey): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "key", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 28b87a1a30..e33d4f269d 100644 --- a/plugins/aws/fix_plugin_aws/resource/lambda_.py +++ b/plugins/aws/fix_plugin_aws/resource/lambda_.py @@ -233,7 +233,7 @@ class AwsLambdaFunctionUrlConfig: class AwsLambdaFunction(AwsResource, BaseServerlessFunction): kind: ClassVar[str] = "aws_lambda_function" kind_display: ClassVar[str] = "AWS Lambda Function" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/lambda/home?region={region}#/functions/{FunctionName}", "arn_tpl": "arn:{partition}:lambda:{region}:{account}:function/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:lambda:{region}:{account}:function/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Lambda is a serverless computing service that lets you run your code" " without provisioning or managing servers. Lambda functions are the compute" diff --git a/plugins/aws/fix_plugin_aws/resource/opensearch.py b/plugins/aws/fix_plugin_aws/resource/opensearch.py index fc11fa4b9f..c8b446e6a5 100644 --- a/plugins/aws/fix_plugin_aws/resource/opensearch.py +++ b/plugins/aws/fix_plugin_aws/resource/opensearch.py @@ -259,7 +259,7 @@ class AwsOpenSearchDomain(AwsResource): "successors": {"default": [AwsCognitoUserPool.kind]}, } 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:opensearch:{region}:{account}:domain/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("DomainId"), "tags": S("Tags", default=[]) >> ToDict(), diff --git a/plugins/aws/fix_plugin_aws/resource/rds.py b/plugins/aws/fix_plugin_aws/resource/rds.py index 02f4e25158..c6f31d231e 100644 --- a/plugins/aws/fix_plugin_aws/resource/rds.py +++ b/plugins/aws/fix_plugin_aws/resource/rds.py @@ -328,7 +328,7 @@ class AwsRdsInstance(RdsTaggable, AwsResource, BaseDatabase): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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": { @@ -862,7 +862,7 @@ class AwsRdsCluster(RdsTaggable, AwsResource, BaseDatabase): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"), @@ -1067,7 +1067,7 @@ class AwsRdsSnapshot(RdsTaggable, AwsResource, BaseSnapshot): 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 reference_kinds: ClassVar[ModelReference] = {"predecessors": {"default": [AwsRdsInstance.kind, AwsEc2Vpc.kind]}} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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]] = { "id": S("DBSnapshotIdentifier"), @@ -1172,7 +1172,7 @@ class AwsRdsClusterSnapshot(AwsResource): "successors": {"default": [AwsKmsKey.kind]}, } 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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]] = { "id": S("DBClusterSnapshotIdentifier"), diff --git a/plugins/aws/fix_plugin_aws/resource/route53.py b/plugins/aws/fix_plugin_aws/resource/route53.py index 2de8b964af..41165b7f69 100644 --- a/plugins/aws/fix_plugin_aws/resource/route53.py +++ b/plugins/aws/fix_plugin_aws/resource/route53.py @@ -68,7 +68,7 @@ class AwsRoute53Zone(AwsResource, BaseDNSZone): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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": { diff --git a/plugins/aws/fix_plugin_aws/resource/s3.py b/plugins/aws/fix_plugin_aws/resource/s3.py index 8097281c3b..1e1c6d3b2c 100644 --- a/plugins/aws/fix_plugin_aws/resource/s3.py +++ b/plugins/aws/fix_plugin_aws/resource/s3.py @@ -166,7 +166,7 @@ class AwsS3Logging: class AwsS3Bucket(AwsResource, BaseBucket): kind: ClassVar[str] = "aws_s3_bucket" kind_display: ClassVar[str] = "AWS S3 Bucket" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://s3.console.aws.amazon.com/s3/buckets/{name}?region={region_id}&bucketType=general&tab=objects", "arn_tpl": "arn:{partition}:s3:{region}:{account}:bucket/{name}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:s3:{region}:{account}:bucket/{name}"} # fmt: skip kind_description: ClassVar[str] = ( "S3 buckets are simple storage containers in Amazon's cloud, offering a" " scalable storage solution for various types of data." @@ -457,7 +457,7 @@ class AwsS3AccountSettings(AwsResource, PhantomBaseResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "policy", "group": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 574c7f3ea8..c83eb43b4b 100644 --- a/plugins/aws/fix_plugin_aws/resource/sagemaker.py +++ b/plugins/aws/fix_plugin_aws/resource/sagemaker.py @@ -1380,7 +1380,7 @@ class AwsSagemakerDomain(AwsResource): ) kind_service: ClassVar[Optional[str]] = service_name metadata: ClassVar[Dict[str, Any]] = {"icon": "cluster", "group": "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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:sagemaker:{region}:{account}:domain/{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 773fbe9870..eb289be13d 100644 --- a/plugins/aws/fix_plugin_aws/resource/secretsmanager.py +++ b/plugins/aws/fix_plugin_aws/resource/secretsmanager.py @@ -35,7 +35,7 @@ class AwsSecretsManagerSecret(AwsResource): kind_service: ClassVar[Optional[str]] = service_name reference_kinds: ClassVar[ModelReference] = {"successors": {"default": [AwsKmsKey.kind]}} 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:secretsmanager:{region}:{account}:secret/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), "tags": S("Tags", default=[]) >> ToDict(), diff --git a/plugins/aws/fix_plugin_aws/resource/service_quotas.py b/plugins/aws/fix_plugin_aws/resource/service_quotas.py index bfc0b4fef5..69b9fed44c 100644 --- a/plugins/aws/fix_plugin_aws/resource/service_quotas.py +++ b/plugins/aws/fix_plugin_aws/resource/service_quotas.py @@ -66,7 +66,7 @@ class AwsQuotaErrorReason: class AwsServiceQuota(AwsResource, BaseQuota): kind: ClassVar[str] = "aws_service_quota" kind_display: ClassVar[str] = "AWS Service Quota" - aws_metadata: ClassVar[Dict[str, Any]] = {"provider_link_tpl": "https://{region_id}.console.aws.amazon.com/servicequotas/home/services/{source.ServiceCode}/quotas/{id}", "arn_tpl": "arn:{partition}:service-quotas:{region}:{account}:quotas/{id}"} # fmt: skip + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:service-quotas:{region}:{account}:quotas/{id}"} # fmt: skip kind_description: ClassVar[str] = ( "AWS Service Quota is a feature that enables you to view and manage your" " quotas (also referred to as limits) for AWS services." diff --git a/plugins/aws/fix_plugin_aws/resource/sns.py b/plugins/aws/fix_plugin_aws/resource/sns.py index 45d358a01e..38aab15409 100644 --- a/plugins/aws/fix_plugin_aws/resource/sns.py +++ b/plugins/aws/fix_plugin_aws/resource/sns.py @@ -28,7 +28,7 @@ class AwsSnsTopic(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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": { @@ -183,7 +183,7 @@ class AwsSnsSubscription(AwsResource): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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"]}, diff --git a/plugins/aws/fix_plugin_aws/resource/sqs.py b/plugins/aws/fix_plugin_aws/resource/sqs.py index e9714bb2a4..1a640245e0 100644 --- a/plugins/aws/fix_plugin_aws/resource/sqs.py +++ b/plugins/aws/fix_plugin_aws/resource/sqs.py @@ -45,7 +45,7 @@ class AwsSqsQueue(AwsResource, BaseQueue): ) 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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 960ba5f921..a0a598aa2c 100644 --- a/plugins/aws/fix_plugin_aws/resource/ssm.py +++ b/plugins/aws/fix_plugin_aws/resource/ssm.py @@ -38,7 +38,7 @@ class AwsSSMInstance(AwsResource): 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": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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] = { "successors": {"default": ["aws_ec2_instance"]}, @@ -155,7 +155,7 @@ class AwsSSMDocument(AwsResource): 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": "management"} - 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"arn_tpl": "arn:{partition}:ssm:{region}:{account}:document/{name}"} # fmt: skip mapping: ClassVar[Dict[str, Bender]] = { "id": S("Name"), "tags": S("Tags", default=[]) >> ToDict(), diff --git a/plugins/aws/fix_plugin_aws/resource/waf.py b/plugins/aws/fix_plugin_aws/resource/waf.py index 299eefe8cc..d939b5d5bb 100644 --- a/plugins/aws/fix_plugin_aws/resource/waf.py +++ b/plugins/aws/fix_plugin_aws/resource/waf.py @@ -803,7 +803,7 @@ class AwsWafWebACL(AwsResource, BaseFirewall): 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 + aws_metadata: ClassVar[Dict[str, Any]] = {"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] = { "successors": {"default": ["aws_alb", "aws_apigateway_rest_api", "aws_cognito_user_pool"]}