From 7f6c9cb1deafb280fe7fcc7551c38e397f11a706 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sun, 18 Feb 2024 22:20:46 +0000 Subject: [PATCH] Techdebt: Update Cloudformation Coverage (to use mock_aws) (#7362) --- docs/docs/services/cf.rst | 18 +++++++----------- scripts/cloudformation_coverage.py | 13 ++++++++++--- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/docs/docs/services/cf.rst b/docs/docs/services/cf.rst index 11af8d1af..b3e227189 100644 --- a/docs/docs/services/cf.rst +++ b/docs/docs/services/cf.rst @@ -29,11 +29,7 @@ Please let us know if you'd like support for a resource not yet listed here. +---------------------------------------+--------+--------+--------+----------------------------------------+ |AWS::Batch::ComputeEnvironment | x | | | - [ ] ComputeEnvironmentArn | +---------------------------------------+--------+--------+--------+----------------------------------------+ - |AWS::Batch::JobDefinition | x | | | - [ ] Status | - +---------------------------------------+--------+--------+--------+ - [ ] Revision | - | | | | | - [ ] JobDefinitionArn | - +---------------------------------------+--------+--------+--------+ - [ ] ContainerOrchestrationType | - | | | | | | + |AWS::Batch::JobDefinition | x | | | | +---------------------------------------+--------+--------+--------+----------------------------------------+ |AWS::Batch::JobQueue | x | | | - [ ] JobQueueArn | +---------------------------------------+--------+--------+--------+----------------------------------------+ @@ -73,7 +69,7 @@ Please let us know if you'd like support for a resource not yet listed here. +---------------------------------------+--------+--------+--------+ - [ ] VpcId | | | | | | | +---------------------------------------+--------+--------+--------+----------------------------------------+ - |AWS::EC2::SecurityGroupIngress | x | | | | + |AWS::EC2::SecurityGroupIngress | x | | | - [ ] Id | +---------------------------------------+--------+--------+--------+----------------------------------------+ |AWS::EC2::Subnet | x | | x | - [ ] VpcId | +---------------------------------------+--------+--------+--------+ - [ ] NetworkAclAssociationId | @@ -167,11 +163,11 @@ Please let us know if you'd like support for a resource not yet listed here. +---------------------------------------+--------+--------+--------+----------------------------------------+ |AWS::RDS::DBParameterGroup | x | | | - [ ] DBParameterGroupName | +---------------------------------------+--------+--------+--------+----------------------------------------+ - |AWS::Redshift::Cluster | x | | | - [x] Endpoint.Address | - +---------------------------------------+--------+--------+--------+ - [x] Endpoint.Port | - | | | | | - [ ] Id | - +---------------------------------------+--------+--------+--------+ - [ ] DeferMaintenanceIdentifier | - | | | | | | + |AWS::Redshift::Cluster | x | | | - [ ] MasterPasswordSecretArn | + +---------------------------------------+--------+--------+--------+ - [x] Endpoint.Address | + | | | | | - [x] Endpoint.Port | + +---------------------------------------+--------+--------+--------+ - [ ] ClusterNamespaceArn | + | | | | | - [ ] DeferMaintenanceIdentifier | +---------------------------------------+--------+--------+--------+----------------------------------------+ |AWS::Route53::HealthCheck | x | | | - [ ] HealthCheckId | +---------------------------------------+--------+--------+--------+----------------------------------------+ diff --git a/scripts/cloudformation_coverage.py b/scripts/cloudformation_coverage.py index df61bfc25..89a4ae005 100755 --- a/scripts/cloudformation_coverage.py +++ b/scripts/cloudformation_coverage.py @@ -4,10 +4,15 @@ import requests import os import moto +from moto.backends import get_backend, list_of_moto_modules + # Populate CloudFormationModel.__subclasses__() -moto.mock_all() - +for service_name in list_of_moto_modules(): + try: + get_backend(service_name) + except AttributeError: + pass script_dir = os.path.dirname(os.path.abspath(__file__)) @@ -59,7 +64,9 @@ class CloudFormationChecklist: @property def moto_model(self): - for subclass in moto.core.common_models.CloudFormationModel.__subclasses__(): + from moto.core.common_models import CloudFormationModel + + for subclass in CloudFormationModel.__subclasses__(): subclass_service = subclass.__module__.split(".")[1] subclass_model = subclass.__name__