-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cli: when cdk.out is missing, cannot synthesize or list #5586
Comments
Adding an Before: def main():
app = App()
PrivateBalancerStack(app, MyEnv.name, env=AWS_ENV, description="Private ALB resources.") > rm -rf cdk.out cdk.context.json ; cdk ls
ENOENT: no such file or directory, open 'cdk.out/manifest.json' After: def main():
app = App()
PrivateBalancerStack(app, MyEnv.name, env=AWS_ENV, description="Private ALB resources.")
app.synth() > rm -rf cdk.out cdk.context.json ; cdk ls
private-alb-stack Perhaps I misunderstood the way synthesis works (I thought |
Worth noting: after the stuff in So maybe the issue is:
The moral of the story for me: don't remove |
@allister-db sorry I'm jumping on this a bit late, but it seems you've gone through the discovery and learning aspect of the functionality :). Resolving this, but feel free to reopen if you still have any outstanding questions. |
So, I know I am messaging on an old thread, but I recently came into this exact same situation and was curious why this ( I have a co-worker who uses typescript with aws-cdk and in his commands he doesn't have the @allister-db, did you ever figure out why this was required? |
I've independently found that |
As the matter of fact, AWS-CDK is written in TypeScript and runs on Node.js. All other aws-cdks are built on top of it. |
Sorry, I never did dig deeply enough to find the "why" of needing an explicit |
I have been unable to find an explanation as to why and it would be nice to know why. Maybe my googling isnt googling so for now it is the equivalent of DoEvents in VB. |
I had this issue, and none of the answers solved it. It seems apparent that this error can have a variety of causes. Here was mine. import {
App,
Environment,
} from 'aws-cdk-lib';
import { EcsEc2DeploymentTestStack } from '../lib/ecs-ec2-deployment-test-stack';
(async () => {
const env: Environment = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION ,
};
const application = new App();
const ecsEc2Service = new EcsEc2DeploymentTestStack(application, 'EcsEc2TestService', { env: env });
application.synth();
}); Here is the functioning code: import {
App,
Environment,
} from 'aws-cdk-lib';
import { EcsEc2DeploymentTestStack } from '../lib/ecs-ec2-deployment-test-stack';
(async () => {
const env: Environment = {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION ,
};
const application = new App();
const ecsEc2Service = new EcsEc2DeploymentTestStack(application, 'EcsEc2TestService', { env: env });
application.synth();
})(); I had forgotten to invoke the asynchronous wrapper. |
I deleted my
cdk.out/
directory hoping to freshly generate its contents next time I rancdk synth
, but instead I get a file not found error.Before I deleted cdk.out, synth, ls, and deploy were working fine.
Reproduction Steps
Error Log
Environment
Other
This seems very similar to a previous issue: #3717 but I did not find a clear resolution in the comments on issue 3717. One comment said "went away when I updated my cdk.ts" but it is not clear to me whether I can or should do that. I installed CDK by
npm install -g aws-cdk
, so I would expect all TypeScript to be "inside the black box".This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: