From 5d39d027bd657e06b1535f1b8285d8483ee7df37 Mon Sep 17 00:00:00 2001 From: Matthias Veit Date: Mon, 23 Sep 2024 12:15:38 +0200 Subject: [PATCH] [azure][fix] Ignore props for history (#2201) --- .../fix_plugin_azure/resource/authorization.py | 18 +++++++++--------- .../fix_plugin_azure/resource/cosmosdb.py | 2 +- plugins/gcp/fix_plugin_gcp/resources/base.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/azure/fix_plugin_azure/resource/authorization.py b/plugins/azure/fix_plugin_azure/resource/authorization.py index 8f7999b932..58f90221e8 100644 --- a/plugins/azure/fix_plugin_azure/resource/authorization.py +++ b/plugins/azure/fix_plugin_azure/resource/authorization.py @@ -100,7 +100,7 @@ class AzureAuthorizationDenyAssignment(MicrosoftResource): condition: Optional[str] = field(default=None, metadata={'description': 'The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase foo_storage_container '}) # fmt: skip condition_version: Optional[str] = field(default=None, metadata={"description": "Version of the condition."}) created_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who created the assignment'}) # fmt: skip - created_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was created"}) + created_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was created"}) # fmt: skip deny_assignment_name: Optional[str] = field(default=None, metadata={'description': 'The display name of the deny assignment.'}) # fmt: skip description: Optional[str] = field(default=None, metadata={'description': 'The description of the deny assignment.'}) # fmt: skip do_not_apply_to_child_scopes: Optional[bool] = field(default=None, metadata={'description': 'Determines if the deny assignment applies to child scopes. Default value is false.'}) # fmt: skip @@ -109,8 +109,8 @@ class AzureAuthorizationDenyAssignment(MicrosoftResource): permissions: Optional[List[AzureDenyAssignmentPermission]] = field(default=None, metadata={'description': 'An array of permissions that are denied by the deny assignment.'}) # fmt: skip principals: Optional[List[AzurePrincipal]] = field(default=None, metadata={'description': 'Array of principals to which the deny assignment applies.'}) # fmt: skip scope: Optional[str] = field(default=None, metadata={"description": "The deny assignment scope."}) - updated_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who updated the assignment'}) # fmt: skip - updated_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was updated"}) + updated_by: Optional[str] = field(default=None, metadata={"ignore_history": True, 'description': 'Id of the user who updated the assignment'}) # fmt: skip + updated_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was updated"}) # fmt: skip @define(eq=False, slots=False) @@ -173,15 +173,15 @@ class AzureAuthorizationRoleAssignment(MicrosoftResource): condition: Optional[str] = field(default=None, metadata={'description': 'The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase foo_storage_container '}) # fmt: skip condition_version: Optional[str] = field(default=None, metadata={'description': 'Version of the condition. Currently the only accepted value is 2.0 '}) # fmt: skip created_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who created the assignment'}) # fmt: skip - created_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was created"}) + created_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was created"}) # fmt: skip delegated_managed_identity_resource_id: Optional[str] = field(default=None, metadata={'description': 'Id of the delegated managed identity resource'}) # fmt: skip description: Optional[str] = field(default=None, metadata={"description": "Description of role assignment"}) principal_id: Optional[str] = field(default=None, metadata={"description": "The principal ID."}) principal_type: Optional[str] = field(default=None, metadata={'description': 'The principal type of the assigned principal ID.'}) # fmt: skip role_definition_id: Optional[str] = field(default=None, metadata={"description": "The role definition ID."}) scope: Optional[str] = field(default=None, metadata={"description": "The role assignment scope."}) - updated_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who updated the assignment'}) # fmt: skip - updated_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was updated"}) + updated_by: Optional[str] = field(default=None, metadata={"ignore_history": True, 'description': 'Id of the user who updated the assignment'}) # fmt: skip + updated_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was updated"}) # fmt: skip def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None: # role definition @@ -251,12 +251,12 @@ class AzureAuthorizationRoleDefinition(MicrosoftResource, BaseRole): } assignable_scopes: Optional[List[str]] = field(default=None, metadata={'description': 'Role definition assignable scopes.'}) # fmt: skip created_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who created the assignment'}) # fmt: skip - created_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was created"}) + created_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was created"}) # fmt: skip description: Optional[str] = field(default=None, metadata={"description": "The role definition description."}) azure_role_permissions: Optional[List[AzurePermission]] = field(default=None, metadata={'description': 'Role definition permissions.'}) # fmt: skip role_name: Optional[str] = field(default=None, metadata={"description": "The role name."}) - updated_by: Optional[str] = field(default=None, metadata={'description': 'Id of the user who updated the assignment'}) # fmt: skip - updated_on: Optional[datetime] = field(default=None, metadata={"description": "Time it was updated"}) + updated_by: Optional[str] = field(default=None, metadata={"ignore_history": True, 'description': 'Id of the user who updated the assignment'}) # fmt: skip + updated_on: Optional[datetime] = field(default=None, metadata={"ignore_history": True, "description": "Time it was updated"}) # fmt: skip @define(eq=False, slots=False) diff --git a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py index 4bcd33e63a..a18d72e671 100644 --- a/plugins/azure/fix_plugin_azure/resource/cosmosdb.py +++ b/plugins/azure/fix_plugin_azure/resource/cosmosdb.py @@ -1572,7 +1572,7 @@ class AzureCosmosDBRestorableAccount(MicrosoftResource): api_type: Optional[str] = field(default=None, metadata={'description': 'Enum to indicate the API type of the restorable database account.'}) # fmt: skip creation_time: Optional[datetime] = field(default=None, metadata={'description': 'The creation time of the restorable database account (ISO-8601 format).'}) # fmt: skip deletion_time: Optional[datetime] = field(default=None, metadata={'description': 'The time at which the restorable database account has been deleted (ISO-8601 format).'}) # fmt: skip - oldest_restorable_time: Optional[datetime] = field(default=None, metadata={'description': 'The least recent time at which the database account can be restored to (ISO-8601 format).'}) # fmt: skip + oldest_restorable_time: Optional[datetime] = field(default=None, metadata={"ignore_history": True, 'description': 'The least recent time at which the database account can be restored to (ISO-8601 format).'}) # fmt: skip restorable_locations: Optional[List[AzureRestorableLocationResource]] = field(default=None, metadata={'description': 'List of regions where the of the database account can be restored from.'}) # fmt: skip def _collect_items( diff --git a/plugins/gcp/fix_plugin_gcp/resources/base.py b/plugins/gcp/fix_plugin_gcp/resources/base.py index 9a90ca21d8..936140de14 100644 --- a/plugins/gcp/fix_plugin_gcp/resources/base.py +++ b/plugins/gcp/fix_plugin_gcp/resources/base.py @@ -517,7 +517,7 @@ class GcpRegionQuota(GcpResource): "description": S("description"), "quotas": S("quotas", default=[]) >> MapDict(S("metric") >> F(lambda x: x.lower()), Bend(GcpLimit.mapping)), } - quotas: Optional[Dict[str, GcpLimit]] = field(default=None) + quotas: Optional[Dict[str, GcpLimit]] = field(default=None, metadata=dict(ignore_history=True)) @define(eq=False, slots=False)