diff --git a/moto/logs/models.py b/moto/logs/models.py index 92638925e..3f244b060 100644 --- a/moto/logs/models.py +++ b/moto/logs/models.py @@ -420,11 +420,13 @@ class LogGroup(CloudFormationModel): resource_name, tags, **properties ) + def delete(self, account_id: str, region_name: str) -> None: + backend = logs_backends[account_id][region_name] + backend.delete_log_group(self.name) + @classmethod def has_cfn_attr(cls, attr: str) -> bool: - return attr in [ - "Arn", - ] + return attr in ["Arn"] def get_cfn_attribute(self, attribute_name: str) -> str: from moto.cloudformation.exceptions import UnformattedGetAttTemplateException diff --git a/tests/test_logs/test_logs_cloudformation.py b/tests/test_logs/test_logs_cloudformation.py index 2edb8f9ef..ab39d682e 100644 --- a/tests/test_logs/test_logs_cloudformation.py +++ b/tests/test_logs/test_logs_cloudformation.py @@ -28,3 +28,6 @@ def test_tagging(): arn = logs_client.describe_log_groups()["logGroups"][0]["arn"] tags = logs_client.list_tags_for_resource(resourceArn=arn)["tags"] assert tags == {"foo": "bar"} + + cf_client.delete_stack(StackName="test_stack") + assert logs_client.describe_log_groups()["logGroups"] == []