Cdktf deploy problem with Azure dev ops pipeline

Hi,

I’m trying to set up a basic pipeline in Azure dev Ops services that uses cdktf to deploy my infrastructure.

In my repo I put all the structure of a very basic project initialized with cdktf (cdktf init):

Here is the content of my main.ts file :

The steps of this pipeline are :

  • npm install --global cdktf-cli@latest
  • npm install @cdktf/provider-azurerm
  • cdktf synth
  • cdktf deploy

Please note that the agent running all those steps is a Ubuntu agent from Microsoft, it comes with Terraform installed, but no cdktf.

The cdktf deploy step gives a strange error :

Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on GitHub - vadimdemedes/ink: 🌈 React for interactive command-line apps

Is there a solution for this problem ? I don’t have this issue on my local machine using the same steps.

Have a nice day

Before you run cdktf synth/deploy, you’ll need run the build command to compile ts files. Also are you missing the stackName in the synth/deploy command?
To remove the interactive mode you can pass in a cli argument.

Here’s what I think you may need after the npm install steps

cdktf get
tsc
cdktf synth MyStack (assuming this is the name defined in main.ts)
cdktf deploy MyStack --auto-approve

In main.ts after your constructor do you have something like this?

const app = new App();
new MyStack(app, "MyStack");
app.synth();

HTH

Got it, I simply changed

cdktf deploy

to

cdktf deploy --auto-approve

in the last step of the pipeline.

Fyi @sandeepantony yes my main.ts has the above code

I didnt have to use cdktf get and tsc for it to work, and without the stack name cdktf synth and deploy works fine too, but I’ll definately use the stack name for more complex infrastructure.

Thank you,
F.

1 Like