Skip to content

Commit

Permalink
fix(deployCloudFormationStack): fix invalid type of StackPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Jun 5, 2024
1 parent 4481427 commit a485434
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/deployCloudFormationStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type DeployCloudFormationStackInput<
TemplateFile?: string
TemplateBody?: string | Buffer | (() => Readable)
BlanketDeletionPolicy?: 'Delete' | 'Retain'
StackPolicy?: SetStackPolicyCommandInput['StackPolicyBody']
StackPolicy?: SetStackPolicyCommandInput['StackPolicyBody'] | object
Parameters?: CloudFormationTemplateParameterValues<Template> | Parameter[]
Capabilities?: Capability[]
RoleARN?: string | undefined
Expand Down Expand Up @@ -372,7 +372,10 @@ export default async function deployCloudFormationStack<
await cloudformation.send(
new SetStackPolicyCommand({
StackName,
StackPolicyBody: JSON.stringify(StackPolicy, null, 2),
StackPolicyBody:
typeof StackPolicy === 'string'
? StackPolicy
: JSON.stringify(StackPolicy, null, 2),
})
)
}
Expand Down

0 comments on commit a485434

Please sign in to comment.