File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
localstack-core/localstack/services/cloudformation/engine/v2 Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 77
88from typing_extensions import TypeVar
99
10+ from localstack .aws .api .cloudformation import ChangeAction
1011from localstack .utils .strings import camel_to_snake_case
1112
1213T = TypeVar ("T" )
@@ -109,6 +110,14 @@ class ChangeType(enum.Enum):
109110 def __str__ (self ):
110111 return self .value
111112
113+ def to_change_action (self ) -> ChangeAction :
114+ # Convert this change type into the change action used throughout the CFn API
115+ return {
116+ ChangeType .CREATED : ChangeAction .Add ,
117+ ChangeType .MODIFIED : ChangeAction .Modify ,
118+ ChangeType .REMOVED : ChangeAction .Remove ,
119+ }.get (self , ChangeAction .Add )
120+
112121
113122class ChangeSetEntity (abc .ABC ):
114123 scope : Final [Scope ]
Original file line number Diff line number Diff line change @@ -180,9 +180,8 @@ def visit_node_resource(
180180 try :
181181 delta = super ().visit_node_resource (node_resource = node_resource )
182182 except Exception as e :
183- # TODO: change action may not match the change type
184183 self ._process_event (
185- ChangeAction . Modify ,
184+ node_resource . change_type . to_change_action () ,
186185 node_resource .name ,
187186 OperationStatus .FAILED ,
188187 reason = str (e ),
You can’t perform that action at this time.
0 commit comments