Skip to content

Commit

Permalink
fix: don't set stack policy while something is in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jul 2, 2024
1 parent fc3cccd commit 1106e89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/deployCloudFormationStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ export default async function deployCloudFormationStack<
'ROLLBACK_COMPLETE',
'ROLLBACK_IN_PROGRESS',
].includes(StackStatus || '')
if (StackPolicy && !createFailed) {
if (
StackPolicy &&
!createFailed &&
!StackStatus?.endsWith('_IN_PROGRESS')
) {
process.stderr.write(`Setting policy on stack ${StackName}...\n`)
await cloudformation.send(
new SetStackPolicyCommand({
Expand Down Expand Up @@ -424,7 +428,7 @@ export default async function deployCloudFormationStack<
} else {
process.stderr.write(`Stack ${StackName} is already in the desired state\n`)
}
if (StackPolicy && !ExistingStack) {
if (StackPolicy) {
await cloudformation.send(
new SetStackPolicyCommand({
StackName,
Expand Down

0 comments on commit 1106e89

Please sign in to comment.