Infrastructure as Code

Benefits of infrastructure as code

Repeatablity

  • Build the same complex environments over and over again, each identical to the last

  • No need to do anything other than build the same stack in CloudFormation

cloud.vn

Reusability

In some cases, you may want environments that aren’t totally identical but are still similar to others.

For example, you will likely want your test environment to be configured identically to your production environment, but you don’t need all the extra things like scaling that production environments need.

In these cases, you can make your templates dependent upon conditions, so when the template is launched into the test VPC, it uses the version designed for the test environment rather than the one designed for production.

cloud.vn

Simplified updating

If you need to push out a change to all of the resources in a stack, you don’t need to take the whole stack down, modify the template, and relaunch it. All you need to do is perform a direct update to the template, and CloudFormation will push out the updates automatically.

It may have to make some resources temporarily unavailable as the changes are being deployed, but it’s a lot easier than doing it manually.

cloud.vn


Best Practices

Deploy your infrastructure in groups, not all at once. This provides helpful operational isolation in case an incorrect change is pushed and to ensure the entire infrastructure isn’t affected when a stack needs to be taken down.

cloud.vn

One example of how some customers deploy their infrastructure in groups