Skip to content

Commit b96f31a

Browse files
committed
Fix change set not applying if no resource changed
1 parent 0fd5445 commit b96f31a

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
These can be used by donut.system's built-in
1010
validation plugin.
1111
- Allow nil values for optional keys in template config-schema.
12+
- Fix change sets not being applied if they did not change any
13+
resources but did change an output.
14+
- Add `:execution-status` to change set instance to support this.
1215

1316
## v0.29.1 (2025-06-17)
1417

src/salmon/cloudformation.clj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,13 @@
365365
:StackName StackId}}))
366366
(update-stack! cloudformation-client request StackId)))))
367367

368-
(defn- execute-change-set! [cloudformation-client stack-name {:keys [changes id]}]
369-
(when (seq changes)
370-
; This op only returns {}
371-
(aws/invoke cloudformation-client
372-
{:op :ExecuteChangeSet
373-
:request
374-
{:ChangeSetName id
375-
:StackName stack-name}})))
368+
(defn- execute-change-set! [cloudformation-client stack-name {:keys [id]}]
369+
; This op only returns {}
370+
(aws/invoke cloudformation-client
371+
{:op :ExecuteChangeSet
372+
:request
373+
{:ChangeSetName id
374+
:StackName stack-name}}))
376375

377376
(defn- outputs-map-raw [outputs-seq]
378377
(reduce
@@ -456,10 +455,10 @@
456455
(let [signal (update signal ::ds/config init-cloudformation-client)
457456
{::ds/keys [config]} signal
458457
{:keys [cloudformation-client]} config
459-
{:keys [changes stack-id]} change-set
458+
{:keys [changes execution-status stack-id]} change-set
460459
ex! (if change-set
461460
(fn []
462-
(if (seq changes)
461+
(if (or (seq changes) (= "AVAILABLE" execution-status))
463462
(let [r (execute-change-set! cloudformation-client name change-set)]
464463
(if (u/anomaly? r)
465464
[stack-id false]
@@ -750,12 +749,13 @@
750749
{:keys [cloudformation-client]} config
751750
{:keys [Id StackId]}
752751
#__ (create-change-set! cloudformation-client signal (template-data config :template template :validate? false))
753-
{:keys [Changes]}
752+
{:keys [Changes ExecutionStatus]}
754753
#__ (wait-until-complete-change-set! Id StackId cloudformation-client
755754
:fail-on-no-changes? fail-on-no-changes?)]
756755
{:changes Changes
757756
:client cloudformation-client
758757
:cloudformation-client cloudformation-client
758+
:execution-status ExecutionStatus
759759
:id Id
760760
:name name
761761
:stack-id StackId

0 commit comments

Comments
 (0)