Skip to content

Commit

Permalink
correctly iterate over stackArgs.UsePreviousValueParameters and updat…
Browse files Browse the repository at this point in the history
…es input.Parameters correctly
  • Loading branch information
dannosaur authored and tavisrudd committed Dec 6, 2019
1 parent 4ad2750 commit d41db46
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/cfn/stackArgsToX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ export type CFNInputsSupportingUsePreviousValue =
export function _normalizeUsePreviousTemplateOrParamValues(stackArgs: StackArgs, input: CFNInputsSupportingUsePreviousValue): void {
input.UsePreviousTemplate = stackArgs.UsePreviousTemplate;
if (stackArgs.UsePreviousValueParameters && input.Parameters) {
for (const paramName in stackArgs.UsePreviousValueParameters) {
input.Parameters[paramName].UsePreviousValue = true;
delete input.Parameters[paramName].ParameterValue;
}
stackArgs.UsePreviousValueParameters.forEach((paramName, index) => {
input.Parameters!.forEach((inputParam, iindex) => {
if (inputParam.ParameterKey == paramName) {
inputParam.UsePreviousValue = true;
delete inputParam.ParameterValue;
}
})
});
}
}

Expand Down

0 comments on commit d41db46

Please sign in to comment.