DEMO: CDK for Terraform: programming infrastructure in high-level languages
Pulumi and CDK for Terraform: programming infrastructure in high-level languages
Nowadays Terraform is leading among IaC solutions where its own configuration language HCL (HashiCorp Configuration Language) is widely used. Although this language is pretty simple, it has its own specifics, different types of variables and approach to cycles which is not always evident. Thus, DevOps and developers have to spend time on figuring out its subtleties and opportunities. In their talk the speakers would like to present other way of working with IaC, using different programming languages with Pulumi and cdktf as the example. So, the developers and DevOps may use familiar tools and IDE while working with infrastructure
There are few examples to demonstrate deploy infrastructure like code software without DSL and YAML.
├── ec2-nginx
│ ├── cdktf.json
│ ├── main.ts
│ ├── package.json
│ ├── package-lock.json
│ ├── provision.sh
│ └── tsconfig.json
├── ec2-nginx-terraform
│ ├── main.tf
│ ├── output.tf
│ ├── provider.tf
│ └── provision.sh
├── README.md
└── sh
├── cdktf_duration.sh
└── tf_duration.sh
It's a simple example to deploy via CDKTF (typescript)
- Deploy EC2 instance
- Allow I/O traffic
- Setup nginx web-server
- Change welcome page
Same as ec2-nginx
- Deploy EC2 instance
- Allow I/O traffic
- Setup nginx web-server
- Change welcome page
There are few scripts to measure time deploy Cloud Development Kit for Terraform vs native Terraform
- Install requirements
- Terraform v1+
- CDK for Terraform 0.6.4 ( The 0.7.0 CDKTF works unstable )
- Node.js v16
npm install -g typescript
- an AWS account and AWS Access Credentials
- Move to
ec2-nginx
and runcdktf deploy