Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression: app reports unknown-account/unknown-region to toolkit if stack doesn't have explicit env #2853

Closed
eladb opened this issue Jun 13, 2019 · 1 comment · Fixed by #2867
Assignees
Labels
bug This issue is a bug.

Comments

@eladb
Copy link
Contributor

eladb commented Jun 13, 2019

The current (unreleased) version of the CDK (in master) has a regression caused by #2728, where the app reports this environment: aws://unknown-account/unknown-region to the cli.

@eladb eladb self-assigned this Jun 13, 2019
@eladb eladb added the bug This issue is a bug. label Jun 13, 2019
eladb pushed a commit that referenced this issue Jun 13, 2019
The PR #2728 caused a regression on how the framework behaves when a
stack's environment (account and/or region) are not specified.

The behavior is: if account and/or region are not specified at the stack
level (or set to Aws.accountId and Aws.region, respectively), the cloud
assembly manifest of this stack will have an environment specification
based on the defaults passed in from the CLI.

This is a temporary solution which fixes #2853 but doesn't fully implement
the behavior we eventually want (which is documented in #2866).
shivlaks pushed a commit that referenced this issue Jun 13, 2019
…ed (#2867)

The PR #2728 caused a regression on how the framework behaves when a
stack's environment (account and/or region) are not specified.

The behavior is: if account and/or region are not specified at the stack
level (or set to Aws.accountId and Aws.region, respectively), the cloud
assembly manifest of this stack will have an environment specification
based on the defaults passed in from the CLI.

This is a temporary solution which fixes #2853 but doesn't fully implement
the behavior we eventually want (which is documented in #2866).
@coderbyheart
Copy link
Contributor

I see this issue still in 1.2.0. I run CDK in CodeBuild and it complains about the CDKToolkit stack not found (but it exists):

[Container] 2019/07/31 07:11:19 Running command npx cdk deploy --trace -v --require-approval never '*' 
CDK toolkit version: 1.2.0 (build 6b763b7) 
Command line arguments: { _: [ 'deploy' ], 
  'ignore-errors': false, 
  ignoreErrors: false, 
  json: false, 
  j: false, 
  verbose: true, 
  v: true, 
  ec2creds: undefined, 
  i: undefined, 
  'version-reporting': undefined, 
  versionReporting: undefined, 
  'path-metadata': true, 
  pathMetadata: true, 
  'asset-metadata': true, 
  assetMetadata: true, 
  staging: true, 
  ci: false, 
  trace: true, 
  'require-approval': 'never', 
  requireApproval: 'never', 
  'role-arn': undefined, 
  r: undefined, 
  roleArn: undefined, 
  'build-exclude': [], 
  E: [], 
  buildExclude: [], 
  '$0': 'node_modules/.bin/cdk', 
  STACKS: [ '*' ], 
  stacks: [ '*' ] } 
cdk.json: { 
  "app": "node dist/cdk/cloudformation.js" 
} 
merged settings: { versionReporting: true, 
  pathMetadata: true, 
  output: 'cdk.out', 
  app: 'node dist/cdk/cloudformation.js', 
  context: {}, 
  tags: [], 
  assetMetadata: true, 
  requireApproval: 'never', 
  staging: true } 
Setting "CDK_DEFAULT_REGION" environment variable to eu-central-1 
Resolving default credentials 
Looking up default account ID from STS 
Default account ID: 77XXXXXXXX 
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 77XXXXXXXX 
context: { 'aws:cdk:enable-path-metadata': true, 
  'aws:cdk:enable-asset-metadata': true } 
outdir: cdk.out 
env: { CDK_DEFAULT_REGION: 'eu-central-1', 
  CDK_DEFAULT_ACCOUNT: '77XXXXXXXX', 
  CDK_CONTEXT_JSON: 
   '{"aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true}', 
  CDK_OUTDIR: 'cdk.out' } 
bifravst: deploying... 
Using default AWS SDK credentials for account 77XXXXXXXX 
Waiting for stack CDKToolkit to finish creating or updating... 
Stack CDKToolkit does not exist 
The environment aws://unknown-account/unknown-region doesn't have the CDK toolkit stack (CDKToolkit) installed. Use cdk bootstrap "aws://unknown-account/unknown-region" to setup your environment for use with the toolkit. 
Using default AWS SDK credentials for account 77XXXXXXXX 
Attempting to create ChangeSet CDK-fd4ead4f-3271-4059-b941-eb8d9d39f956 to update stack bifravst 
bifravst: creating CloudFormation changeset... 

This was referenced Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants