localstack-core 4.4.1.dev60__py3-none-any.whl → 4.4.1.dev65__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- localstack/aws/api/ec2/__init__.py +70 -2
- localstack/aws/api/s3/__init__.py +2 -0
- localstack/services/cloudformation/engine/v2/change_set_model.py +106 -144
- localstack/services/cloudformation/engine/v2/change_set_model_describer.py +9 -7
- localstack/services/cloudformation/engine/v2/change_set_model_executor.py +7 -6
- localstack/services/cloudformation/engine/v2/change_set_model_preproc.py +223 -114
- localstack/services/cloudformation/engine/v2/change_set_model_visitor.py +10 -0
- localstack/services/s3/provider.py +3 -2
- localstack/services/sns/provider.py +27 -9
- localstack/version.py +2 -2
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/METADATA +3 -3
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/RECORD +20 -20
- localstack_core-4.4.1.dev65.dist-info/plux.json +1 -0
- localstack_core-4.4.1.dev60.dist-info/plux.json +0 -1
- {localstack_core-4.4.1.dev60.data → localstack_core-4.4.1.dev65.data}/scripts/localstack +0 -0
- {localstack_core-4.4.1.dev60.data → localstack_core-4.4.1.dev65.data}/scripts/localstack-supervisor +0 -0
- {localstack_core-4.4.1.dev60.data → localstack_core-4.4.1.dev65.data}/scripts/localstack.bat +0 -0
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/WHEEL +0 -0
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/entry_points.txt +0 -0
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/licenses/LICENSE.txt +0 -0
- {localstack_core-4.4.1.dev60.dist-info → localstack_core-4.4.1.dev65.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,9 @@ from localstack.services.cloudformation.engine.v2.change_set_model import (
|
|
8
8
|
NodeIntrinsicFunction,
|
9
9
|
NodeProperty,
|
10
10
|
NodeResource,
|
11
|
+
Nothing,
|
11
12
|
PropertiesKey,
|
13
|
+
is_nothing,
|
12
14
|
)
|
13
15
|
from localstack.services.cloudformation.engine.v2.change_set_model_preproc import (
|
14
16
|
ChangeSetModelPreproc,
|
@@ -53,8 +55,8 @@ class ChangeSetModelDescriber(ChangeSetModelPreproc):
|
|
53
55
|
if isinstance(after_argument, str):
|
54
56
|
after_argument = after_argument.split(".")
|
55
57
|
|
56
|
-
before =
|
57
|
-
if before_argument:
|
58
|
+
before = Nothing
|
59
|
+
if not is_nothing(before_argument):
|
58
60
|
before_logical_name_of_resource = before_argument[0]
|
59
61
|
before_attribute_name = before_argument[1]
|
60
62
|
before_node_resource = self._get_node_resource_for(
|
@@ -72,8 +74,8 @@ class ChangeSetModelDescriber(ChangeSetModelPreproc):
|
|
72
74
|
property_name=before_attribute_name,
|
73
75
|
)
|
74
76
|
|
75
|
-
after =
|
76
|
-
if after_argument:
|
77
|
+
after = Nothing
|
78
|
+
if not is_nothing(after_argument):
|
77
79
|
after_logical_name_of_resource = after_argument[0]
|
78
80
|
after_attribute_name = after_argument[1]
|
79
81
|
after_node_resource = self._get_node_resource_for(
|
@@ -154,7 +156,7 @@ class ChangeSetModelDescriber(ChangeSetModelPreproc):
|
|
154
156
|
if before == after:
|
155
157
|
# unchanged: nothing to do.
|
156
158
|
return
|
157
|
-
if
|
159
|
+
if not is_nothing(before) and not is_nothing(after):
|
158
160
|
# Case: change on same type.
|
159
161
|
if before.resource_type == after.resource_type:
|
160
162
|
# Register a Modified if changed.
|
@@ -184,7 +186,7 @@ class ChangeSetModelDescriber(ChangeSetModelPreproc):
|
|
184
186
|
before_properties=None,
|
185
187
|
after_properties=after.properties,
|
186
188
|
)
|
187
|
-
elif
|
189
|
+
elif not is_nothing(before):
|
188
190
|
# Case: removal
|
189
191
|
self._register_resource_change(
|
190
192
|
logical_id=name,
|
@@ -193,7 +195,7 @@ class ChangeSetModelDescriber(ChangeSetModelPreproc):
|
|
193
195
|
before_properties=before.properties,
|
194
196
|
after_properties=None,
|
195
197
|
)
|
196
|
-
elif
|
198
|
+
elif not is_nothing(after):
|
197
199
|
# Case: addition
|
198
200
|
self._register_resource_change(
|
199
201
|
logical_id=name,
|
@@ -11,6 +11,7 @@ from localstack.services.cloudformation.engine.v2.change_set_model import (
|
|
11
11
|
NodeOutput,
|
12
12
|
NodeParameter,
|
13
13
|
NodeResource,
|
14
|
+
is_nothing,
|
14
15
|
)
|
15
16
|
from localstack.services.cloudformation.engine.v2.change_set_model_preproc import (
|
16
17
|
ChangeSetModelPreproc,
|
@@ -113,13 +114,13 @@ class ChangeSetModelExecutor(ChangeSetModelPreproc):
|
|
113
114
|
# There are no updates for this resource; iff the resource was previously
|
114
115
|
# deployed, then the resolved details are copied in the current state for
|
115
116
|
# references or other downstream operations.
|
116
|
-
if
|
117
|
+
if not is_nothing(before):
|
117
118
|
before_logical_id = delta.before.logical_id
|
118
119
|
before_resource = self._before_resolved_resources.get(before_logical_id, dict())
|
119
120
|
self.resources[before_logical_id] = before_resource
|
120
121
|
|
121
122
|
# Update the latest version of this resource for downstream references.
|
122
|
-
if
|
123
|
+
if not is_nothing(after):
|
123
124
|
after_logical_id = after.logical_id
|
124
125
|
after_physical_id: str = self._after_resource_physical_id(
|
125
126
|
resource_logical_id=after_logical_id
|
@@ -132,7 +133,7 @@ class ChangeSetModelExecutor(ChangeSetModelPreproc):
|
|
132
133
|
) -> PreprocEntityDelta[PreprocOutput, PreprocOutput]:
|
133
134
|
delta = super().visit_node_output(node_output=node_output)
|
134
135
|
after = delta.after
|
135
|
-
if after
|
136
|
+
if is_nothing(after) or (isinstance(after, PreprocOutput) and after.condition is False):
|
136
137
|
return delta
|
137
138
|
self.outputs[delta.after.name] = delta.after.value
|
138
139
|
return delta
|
@@ -142,7 +143,7 @@ class ChangeSetModelExecutor(ChangeSetModelPreproc):
|
|
142
143
|
) -> None:
|
143
144
|
# Changes are to be made about this resource.
|
144
145
|
# TODO: this logic is a POC and should be revised.
|
145
|
-
if
|
146
|
+
if not is_nothing(before) and not is_nothing(after):
|
146
147
|
# Case: change on same type.
|
147
148
|
if before.resource_type == after.resource_type:
|
148
149
|
# Register a Modified if changed.
|
@@ -177,7 +178,7 @@ class ChangeSetModelExecutor(ChangeSetModelPreproc):
|
|
177
178
|
before_properties=None,
|
178
179
|
after_properties=after.properties,
|
179
180
|
)
|
180
|
-
elif
|
181
|
+
elif not is_nothing(before):
|
181
182
|
# Case: removal
|
182
183
|
# XXX hacky, stick the previous resources' properties into the payload
|
183
184
|
# XXX hacky, stick the previous resources' properties into the payload
|
@@ -190,7 +191,7 @@ class ChangeSetModelExecutor(ChangeSetModelPreproc):
|
|
190
191
|
before_properties=before_properties,
|
191
192
|
after_properties=None,
|
192
193
|
)
|
193
|
-
elif
|
194
|
+
elif not is_nothing(after):
|
194
195
|
# Case: addition
|
195
196
|
self._execute_resource_action(
|
196
197
|
action=ChangeAction.Add,
|