Skip to content

Commit

Permalink
fix(cli): unable to upgrade new style bootstrap to version (#10030)
Browse files Browse the repository at this point in the history
We were reading the wrong key when reading version source for template
resources. This prevented upgrade of bootstrap as the new version was
being incorrectly returned as `0`.

Fixes #10016

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
shivlaks authored and RomainMuller committed Aug 28, 2020
1 parent 72e6727 commit 8d3e422
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as fs from 'fs-extra';
import { Mode, SdkProvider } from '../aws-auth';
import { deployStack, DeployStackResult } from '../deploy-stack';
import { DEFAULT_TOOLKIT_STACK_NAME, ToolkitInfo } from '../toolkit-info';
import { BOOTSTRAP_VERSION_OUTPUT, BootstrapEnvironmentOptions } from './bootstrap-props';
import { BOOTSTRAP_VERSION_OUTPUT, BootstrapEnvironmentOptions, BOOTSTRAP_VERSION_RESOURCE } from './bootstrap-props';

/**
* Perform the actual deployment of a bootstrap stack, given a template and some parameters
Expand Down Expand Up @@ -61,7 +61,7 @@ export async function deployBootstrapStack(
function bootstrapVersionFromTemplate(template: any): number {
const versionSources = [
template.Outputs?.[BOOTSTRAP_VERSION_OUTPUT]?.Value,
template.Resources?.[BOOTSTRAP_VERSION_OUTPUT]?.Properties?.Value,
template.Resources?.[BOOTSTRAP_VERSION_RESOURCE]?.Properties?.Value,
];

for (const vs of versionSources) {
Expand Down

0 comments on commit 8d3e422

Please sign in to comment.