Category Terraform

Custom Metrics in AWS with Lambda and CloudWatch Alarms

AWS CloudWatch is a powerful service for monitoring resources and applications. While AWS automatically provides metrics for most services, sometimes you need to create custom metrics that CloudWatch do not provide by default. For example, to track whether your data…

Terraform governing with OPA

When managing infrastructure with Terraform, enforcing standards across teams and environments could be essential. When working alone or in small team I can say these policies might not be needed but as soon as it became hard to manage all…

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…