Category Terraform

S3 Lifecycle rules with Terraform

Typically, when working with Terraform, there are multiple ways to achieve the same result, which can be particularly useful with more complex AWS configurations. In this blog post, I will show different approaches to defining S3 bucket lifecycle rules with…

Integrate API Gateway with Cognito and Lambda

AWS API Gateway integrated with Cognito is perfect approach for exposing Lambda or other computing services. It offers a secure and scalable solution also for serverless applications. In this blog post, we will explore how to integrate API Gateway with…

How to use Terraform count, length, element and tolist

When working with Terraform often you need to manage dynamic infrastructure across multiple availability zones or resources and that requires looping. In order to do this effectively you need to learn how to use Terraform count, length, element and tolist.…

Terraform Lifecycle Policies

Sometimes when deploying infrastructure the default behaviour when creating, destroying or even updating resources isn’t ideal. In order to successfully manage this you can utilize Terraform Lifecycle Policies. In this blog post we will explore various policies and how to…

Resource recreation with Terraform replace

There are specific situations in Terraform when you need to manually recreate resource even nothing in the code has changed such as incomplete script, resource drift, provisioner failed etc. When resources changed outside of Terraform management of the state file…

Terraform provisioners local-exec vs remote-exec vs file

There are some situations when deploying infrastructure that Terraform doesn’t handle everything automatically. For example if you need to run a script or copy a file provisioners comes to the story because they let you run commands or transfer files…

Access Control in Terraform: IAM Permissions & Workspaces

In large Terraform ecosystems the risk that someone might accidentally (or intentionally 🙂 ) change something grows. Access control in Terraform is always the first line of defense and it’s not just about IAM roles, but also how to structure…