DEV Community

Discussion on: What is Infrastructure as Code?

Collapse
 
leewynne profile image
Lee Wynne

Great article! How’s about testing? What do you recommend for building testing and passing in isolation before deploying infra changes to prod?

Collapse
 
jennapederson profile image
Jenna Pederson

Thanks Lee!

Excellent question. I've been digging into Chef InSpec, which allows you to write and run tests using a DSL on remote systems like servers, containers, and cloud resources. It can be used on any machine or resource regardless of whether it's managed by Chef, AWS CloudFormation, AWS CDK, Terraform, etc. or even manually by a human. Then, you can integrate these tests into your build pipeline, to verify your infrastructure in each environment and deploy, just like you would your application code. There are some other tools out there like Terratest.

Collapse
 
leewynne profile image
Lee Wynne

Thanks for the reply 😎 Terratest looks interesting. Do you find that that IaC test and validation isn’t usually as widely adopted as app level TDD?

Thread Thread
 
jennapederson profile image
Jenna Pederson

I don't have a sense of that quite yet but I think it will absolutely depend on your needs, just like where and when you integrate in automated testing at the application level.