DevOps Classroomnotes 20/Oct/2022

Blocks in terraform

To use provider with specific version

  • To find provider browse them in terraform registry Refer Here
  • Every provider will have documentation
  • Every provider will have many versions to use a specific version of the provider an additional syntax is required
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.0"
    }
  }
}
  • Lets try to understand ~>

Using count to create multiple subnets in AWS for ntier-architecture

  • For the template developed in the class Refer Here
  • Terraform has built in functions Refer Here
  • We have used the length function to find the length of subnets from variables this helped in setting the count based on list size. Refer Here
  • Refer Here for the changes
  • We have used cidrsubnet function to dynamically create subnet cidr’s Refer Here for the change set. Refer Here for the function documentation.
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Customized Social Media Icons from Acurax Digital Marketing Agency

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%