Posts

Showing posts from 2023

DevOps(Day-97): Meta-Arguments in Terraform

Image
  TABLE OF CONTENTS Write about meta-arguments and their use in Terraform. Task-01: Meta-Arguments HandsOn Count for-each When you define a resource block in Terraform, by default, this specifies one resource that will be created. To manage several of the same resources, you can use either count or for_each, which removes the need to write a separate block of code for each one. Using these options reduces overhead and makes your code neater. count is what is known as a ‘meta-argument’ defined by the Terraform language. Meta-arguments help achieve certain requirements within the resource block. Write about meta-arguments and their use in Terraform. Meta-arguments in Terraform refer to a set of special arguments that can be used to define how a particular resource or module behaves within a Terraform configuration. These arguments provide additional configuration options and enable fine-grained control over the behaviour of resources or modules. Meta-arguments are prefixed with the  meta

DevOps(Day-95): Auto Scaling with Terraform

Image
  TABLE OF CONTENTS Understanding Scaling Pre-requisites Task 1: Create an Auto Scaling Group Task 2: Test Scaling Yesterday, we learned how to AWS S3 Bucket with Terraform. Today, we will see how to scale our infrastructure with Terraform. Understanding Scaling Scaling is the process of adding or removing resources to match the changing demands of your application. As your application grows, you will need to add more resources to handle the increased load. And as the load decreases, you can remove the extra resources to save costs. Terraform makes it easy to scale your infrastructure by providing a declarative way to define your resources. You can define the number of resources you need and Terraform will automatically create or destroy the resources as needed. Pre-requisites Create a  terraform.tf  file declaring the providers to be installed in the system according to the resources required. Create a  provider.tf  file to declare the region. Create a  vpc.tf  file to create VPC for