Monday, 26 October 2020

Data Sources for availability zone

 Data sources do is your make an API request to get information for the availability zone.


provider "aws" {
  region     = "ap-southeast-1"
  access_key = "AK"
  secret_key = "vb"
}


resource "aws_instance" "db" {
   ami = "ami-063e3af9d2cc7fe94"
   instance_type = "t2.micro"

   tags = {
    Name = "DB_Server"
  }
  
}


data "aws_instance" "dbsearch" {
  filter {
    name = "tag:Name"
    values = ["DB_Server"]
  }
}

output "dbserver" {
  value  = data.aws_instance.dbsearch.availability_zone
}

2 comments:

  1. The general art of planning, arranging and building how inhabitants and guests will best access assets and versatility choices on a regional level. Central Ohio Mobile Mechanic

    ReplyDelete
  2. The general art of planning, arranging and building how inhabitants and guests will best access assets and versatility choices on a regional level. Cypress Mobile Truck Repair

    ReplyDelete

Configure EKS Persistent Static Storage With Elastic File System Using Terraform

  checkout :https://youtu.be/QuUIgQWBBZM