Back to articles
CDKTF Has a Free API: Write Terraform Infrastructure with TypeScript Instead of HCL
How-ToDevOps

CDKTF Has a Free API: Write Terraform Infrastructure with TypeScript Instead of HCL

via Dev.to TutorialAlex Spinov

What is CDKTF? CDKTF (Cloud Development Kit for Terraform) lets you write Terraform infrastructure using TypeScript, Python, Go, C#, or Java instead of HCL. You get the full Terraform ecosystem — thousands of providers — with real programming language features. Quick Start npm install -g cdktf-cli cdktf init --template = typescript --providers = aws cdktf deploy Define Infrastructure import { Construct } from " constructs " ; import { App , TerraformStack , TerraformOutput } from " cdktf " ; import { AwsProvider } from " @cdktf/provider-aws/lib/provider " ; import { S3Bucket } from " @cdktf/provider-aws/lib/s3-bucket " ; import { Instance } from " @cdktf/provider-aws/lib/instance " ; import { SecurityGroup } from " @cdktf/provider-aws/lib/security-group " ; class MyStack extends TerraformStack { constructor ( scope : Construct , id : string ) { super ( scope , id ); new AwsProvider ( this , " aws " , { region : " us-east-1 " }); // S3 bucket const bucket = new S3Bucket ( this , " my-bu

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles