Rule's cloudformation support for updates (#3043)

* add support to update stack using cloudformation

* blacked test file
This commit is contained in:
Guilherme Martins Crocetti 2020-06-03 02:54:01 -03:00 committed by GitHub
commit 149e307bc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 0 deletions

View file

@ -80,6 +80,15 @@ class Rule(BaseModel):
event_name = properties.get("Name") or resource_name
return event_backend.put_rule(name=event_name, **properties)
@classmethod
def update_from_cloudformation_json(
cls, original_resource, new_resource_name, cloudformation_json, region_name
):
original_resource.delete(region_name)
return cls.create_from_cloudformation_json(
new_resource_name, cloudformation_json, region_name
)
@classmethod
def delete_from_cloudformation_json(
cls, resource_name, cloudformation_json, region_name