# How to deploy cdktf using typescript code

**URL:** <https://discuss.hashicorp.com/t/how-to-deploy-cdktf-using-typescript-code/47360>\
**Category:** CDK for Terraform\
**Created:** [November 27, 2022, 4:01pm UTC](https://discuss.hashicorp.com/t/how-to-deploy-cdktf-using-typescript-code/47360 "2022-11-27T16:01:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew-antony](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/andrew-antony/32/32251_2.png) [@andrew-antony](https://discuss.hashicorp.com/u/andrew-antony)\
**Post date:** [November 27, 2022, 4:01pm UTC](https://discuss.hashicorp.com/t/how-to-deploy-cdktf-using-typescript-code/47360/1 "2022-11-27T16:01:48Z")

</div>

I am working on a typescript/node project that I eventually want to make into a package (that is placed in an npm registry). Within this package there is a `cdktf` directory that contains infrastructure I want deployed into AWS. If I `cd` to this directory and run `cdktf deploy` in the terminal I am able to deploy the infrastructure. However, is there any way I can write code in this package (say in another file called `deploy.ts`) that will deploy the cdktf using typescript only (and no bash/shell commands - I do not want to use the standard `cdktf deploy` command as this is bash/shell). I have tried installing the npm package for `cdktf` but upon inspecting the relevant github repo at [GitHub - hashicorp/terraform-cdk: Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform](https://github.com/hashicorp/terraform-cdk) I have found no typescript examples of being able to deploy cdktf (basically I want to know the typescript equivalent of `cdktf deploy`). The following code snippet also shows what I am trying to achieve:

```auto
import * as cdktf from 'cdktf';
cdktf.deploy // right now deploy is not a function available in cdktf

```

---

<div class="post-metadata">

**Author:** ![jsteinich](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jsteinich/32/9502_2.png) [@jsteinich](https://discuss.hashicorp.com/u/jsteinich)\
**Post date:** [November 27, 2022, 8:44pm UTC](https://discuss.hashicorp.com/t/how-to-deploy-cdktf-using-typescript-code/47360/2 "2022-11-27T20:44:32Z")

</div>

There isn’t currently a public api available. [Public API for Terraform CLI / TF Cloud exec code · Issue #804 · hashicorp/terraform-cdk · GitHub](https://github.com/hashicorp/terraform-cdk/issues/804) is an issue tracking the request.
