CloudFormation: Support deletion of AWS::LOGS::LogGroup (#7443)
This commit is contained in:
parent
b2ff3d98f6
commit
b13e493823
@ -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
|
||||
|
@ -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"] == []
|
||||
|
Loading…
Reference in New Issue
Block a user