One of the most popular languages for infrastructure-as-code is becoming ... Typescript. AWS CDK, Hashicorp CDK, Pulumi and more support Typescript as a first-class citizen. How did we go from writing frontend components to cloud development kits? A technical look at the requirements of infrastructure-as-code languages.

AWS has over 200 different services and plenty of options for each. A strongly typed language helps developers catch wrong configurations before deploying ("compile time"). Despite being one of the most popular languages, we don't see as much Python used anymore for infrastructure-as-code. Ansible ran scripts with Python, but was heavily configured in YAML.

Type systems can be structural vs. nominal. Nominal typing means that two variables are type-compatible if-and-only-if their declarations name the same types. Some examples are C, C++, Java, and Rust. Nominal type systems provide more type-safety at the cost of flexibility. On the other hand, structural typing means than two variables are type compatible if each feature in one variable corresponds to an identical feature int he second. You might know structural typing as 'duck typing' (the term doesn't deal with type equivalence, but .

if it looks like a duck, quacks like a duck, and swims like a duck, then it is probably a duck.

If a goose looks like a duck, quacks like a duck, and swims like a duck, then a goose is a duck. Typescript is a structurally typed language. These two types are equivalent in Typescript.

interface Dog {
  name: string;
}

interface Cat {
  name: string;
}

Historically infrastructure tooling has been in interpreted languages. Bash and Ruby ("interpreted" depends on implementation) were the lingua franca of the last generation of infrastructure-as-code.  The applications aren't long-running and don't require complex runtime dependencies (that would be nice to statically link).