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

deno run -A npm:aws-cdk destroy throws process is not defined #18198

Closed
misterjoshua opened this issue Mar 14, 2023 · 1 comment
Closed

deno run -A npm:aws-cdk destroy throws process is not defined #18198

misterjoshua opened this issue Mar 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working correctly node compat

Comments

@misterjoshua
Copy link

misterjoshua commented Mar 14, 2023

Hi. For the following AWS CDK app, I get an error when running deno run -A npm:aws-cdk destroy --app "deno run -A app.ts":

app.ts:

import cdk from 'npm:aws-cdk-lib';

const app = new cdk.App();

new cdk.Stack(app, 'my-stack');

Here's the output:

$ deno run -A npm:aws-cdk destroy --app "deno run -A app.ts"
not implemented: ClientRequest.setTimeout

process is not defined
<hangs here indefinitely>

Versions:

$ deno --version
deno 1.31.2 (release, x86_64-unknown-linux-gnu)
v8 11.0.226.19
typescript 4.9.4

$ deno run -A npm:aws-cdk --version
2.69.0 (build 60a5b2a)

Notes:

  • Broadly speaking, the synth and deploy commands work.
  • The cdk deploy command is very noisy about ClientRequest.setTimeout not being implemented, but it deploys the CloudFormation stack nonetheless.
  • This "process is not defined" error only happens during the cdk destroy command.
@misterjoshua misterjoshua changed the title deno run -A npm:aws-cdk --app "deno run -A app.ts" destroy throws process is not defined deno run -A npm:aws-cdk destroy throws process is not defined Mar 14, 2023
@bartlomieju bartlomieju added bug Something isn't working correctly node compat labels Mar 15, 2023
@bartlomieju bartlomieju self-assigned this Mar 27, 2023
@bartlomieju
Copy link
Member

@misterjoshua I just tested this on latest Deno (v1.34.1) and I get this error:

$ deno run -A npm:aws-cdk destroy --app "deno run -A app.ts"
Are you sure you want to delete: my-stack (y/n)? y
my-stack: destroying... [1/1]

 ❌  my-stack: destroy failed Error: Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment
    at SdkProvider.resolveEnvironment (file:///Users/ib/Library/Caches/deno/npm/registry.npmjs.org/aws-cdk/2.70.0/lib/index.js:284:46682)
    at eventLoopTick (ext:core/01_core.js:182:11)
    at async CloudFormationDeployments.prepareSdkFor (file:///Users/ib/Library/Caches/deno/npm/registry.npmjs.org/aws-cdk/2.70.0/lib/index.js:372:86165)
    at async CloudFormationDeployments.destroyStack (file:///Users/ib/Library/Caches/deno/npm/registry.npmjs.org/aws-cdk/2.70.0/lib/index.js:372:85288)
    at async CdkToolkit.destroy (file:///Users/ib/Library/Caches/deno/npm/registry.npmjs.org/aws-cdk/2.70.0/lib/index.js:374:152953)
    at async exec4 (file:///Users/ib/Library/Caches/deno/npm/registry.npmjs.org/aws-cdk/2.70.0/lib/index.js:429:51795)
****************************************************
*** Newer version of CDK is available [2.81.0]   ***
*** Upgrade recommended (npm install -g aws-cdk) ***
****************************************************

Unable to resolve AWS account to use. It must be either configured when you define your CDK Stack, or through the environment

Which appears to be correct since I didn't have this stack before. I consider this is now fixed, let me know if you hit any more problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

2 participants