Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Terraform Project – Assignment – Exercise – Lab#4: Datasource

How to submit Assignment?

Please submit assignment @https://www.debug.school/ and POST url share in the comments of this post.


Using Datasource, list out following info

  • List of Images By Resource Group & Platform Image & Shared Image
  • List of Availability sets
  • List of Subnet in one network

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 AI Data Integration Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI data integration tools are pivotal for businesses navigating the complexities of modern data ecosystems. These tools combine artificial intelligence with data integration processes…

Read More

Top 10 Fleet Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, the logistics and transportation industries are evolving rapidly, and managing a fleet of vehicles has never been more complex. Fleet management software has become…

Read More

Top 10 AI Academic Plagiarism Checkers Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI academic plagiarism checkers have become indispensable tools for students, educators, researchers, and institutions striving to uphold academic integrity. With the rise of AI-generated…

Read More

Top 10 Travel Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, travel management software (TMS) has become a crucial tool for businesses, travel agencies, and frequent travelers. These tools automate the booking, tracking, and management…

Read More

Top 10 No-Code Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, no-code platforms have become essential for businesses and individuals looking to build powerful applications, websites, and automations without the need for programming knowledge. These…

Read More

Top 10 AI Training Data Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI training data platforms have become the backbone of successful machine learning (ML) and artificial intelligence (AI) projects. These platforms streamline the process of…

Read More
Subscribe
Notify of
guest
10 Comments
Newest
Oldest Most Voted
Anand
Anand
3 years ago
data "azurerm_platform_image" "example" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}


output "id" {
  value = data.azurerm_platform_image.example.id
}




data "azurerm_shared_image" "example" {
  name = "mysharedimage"
  resource_group_name = "ksaazurevmrg"
  gallery_name = "mygallery"
}


output "idshared" {
  value = data.azurerm_shared_image.example.id
}


data "azurerm_images" "example" {
  resource_group_name = "ksaazurevmrg"
}


output "idimage" {
  value = data.azurerm_images.example.id
}


data "azurerm_subnet" "test" {


  resource_group_name  = "ksaazurevmrg"
  virtual_network_name = "ksaazurevmvnet"
  name = "ksaazurevmsubnet"
}


output "subnet" {
  
  value = data.azurerm_subnet.test.id
}



data "azurerm_availability_set" "example" {
  name = "ksaazurevmas"
  resource_group_name = "ksaazurermrg"
  }



output "availability_set_id" {
  value = data.azurerm_availability_set.example.id
}
Anand
Anand
3 years ago

Gane Kameswar Rao
Gane Kameswar Rao
3 years ago
terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      version = "3.12.0"
    }
  }
}


provider "azurerm" {

}



#to get list of existing images from azure with sku "16.04-LTS"
data "azurerm_platform_image" "platform_img" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}


#To get list of shared images from organisation image gallery created by the user.
data "azurerm_shared_image" "shared_img" {
  name                = "my-image"
  gallery_name        = "testgallery"
  resource_group_name = "example-resources"
}


#to get images created within resource group
data "azurerm_images" "rg_img" {
  resource_group_name = "example-resources"
}


output "id" {
  value = data.azurerm_platform_image.platform_img.id
}


#to get list of availability set from a Resource-group
data "azurerm_availability_set" "avset" {
  name                = "tf-asg"
  resource_group_name = "day04terraform-rg"
}


output "availability_set_id" {
  value = data.azurerm_availability_set.avset.id
}


#to get list of subnets from Vnet
#===============================


data "azurerm_virtual_network" "azvnetlist" {
  name                = "day04terraform-rg-vnet"
  resource_group_name = "day04terraform-rg"
}


output "virtual_network_snetlist" {
  value = data.azurerm_virtual_network.azvnetlist.subnets
}


Last edited 3 years ago by Gane Kameswar Rao
Indu
Indu
3 years ago
data "azurerm_platform_image" "search" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}


output "id" {
  value = data.azurerm_platform_image.search.id
}


data "azurerm_subnet" "Subnet" {
  name                 = "Subnet"
  virtual_network_name = "MyVNET"
  resource_group_name  = "ind.0"
}


output "subnet_id" {
  value = data.azurerm_subnet.Subnet.id
}


data "azurerm_availability_set" "AS1" {
  name                = "AS-one"
  resource_group_name = "ind.0"
}


output "availability_set_id" {
  value = data.azurerm_availability_set.AS1.id
}
Aniruddha Laha
Aniruddha Laha
3 years ago
data "azurerm_platform_image" "example" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}

output "id" {
  value = data.azurerm_platform_image.example.id
}



data "azurerm_availability_set" "example1" {
  name                = "tf-avset"
  resource_group_name = "testvmss-resources"
}

output "availability_set_id1" {
  value = data.azurerm_availability_set.example1.id
}

data "azurerm_subnet" "example" {
  name                 = "vmss-subnet2"
  virtual_network_name = "vmssnetwork"
  resource_group_name  = "testvmss-resources"
}

output "subnet_id" {
  value = data.azurerm_subnet.example.id
}

data "azurerm_shared_image" "example" {
  name                = "myimage"
  gallery_name        = "myimagegallery"
  resource_group_name = "example-resources"
}
output "id1" {
  value = data.azurerm_shared_image.example.id
}
Hans Bhardwaj
Hans Bhardwaj
3 years ago
## List of Subnet in one network ##


data "azurerm_subnet" "subnet_training" {
  name                 = "mySubnet"
  virtual_network_name = "myVnet"
  resource_group_name  = "IBM_Training_Day21"
}


output "subnet_id" {
  value = data.azurerm_subnet.subnet_training.id
}




## List of Image in Azure Mumbai region ##


data "azurerm_platform_image" "image_training" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}


output "id" {
  value = data.azurerm_platform_image.image_training.id
}


## Availability set in Azure resource group ##


data "azurerm_availability_set" "availability_set_training" {
  name                = "availability_set"
  resource_group_name = "IBM_Training_Day21"
}


output "availability_set_id" {
  value = data.azurerm_availability_set.availability_set_training.id
}
Sudhendu tripathi
Sudhendu tripathi
3 years ago
data "azurerm_platform_image" "testday4" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}

output "id" {
  value = data.azurerm_platform_image.testday4.id
}

data "azurerm_availability_set" "sudheAvset" {
  name                = "tf-appsecuritygroup"
  resource_group_name = "demo"
}

output "availability_set_id" {
  value = data.azurerm_availability_set.sudheAvset.id
}
Akhil Kumar
Akhil Kumar
3 years ago
resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West India"
}


resource "azurerm_shared_image_gallery" "example" {
  name                = "example_image_gallery"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  description         = "Shared images and things."


  tags = {
    Hello = "There"
    World = "Example"
  }
}


data "azurerm_shared_image_gallery" "example" {
  name                = "example_image_gallery"
  resource_group_name = "example-resources"
}


data "azurerm_subnet" "example" {
  name                 = "backend"
  virtual_network_name = "production"
  resource_group_name  = "example-resources"
}


output "subnet_id" {
  value = data.azurerm_subnet.example.id
}


data "azurerm_availability_set" "example" {
  name                = "tf-appsecuritygroup"
  resource_group_name = "example-resources"
}


output "availability_set_id" {
  value = data.azurerm_availability_set.example.id
}
Anand
Anand
3 years ago
data "azurerm_platform_image" "example" {
  location  = "West India"
  publisher = "Canonical"
  offer     = "UbuntuServer"
  sku       = "16.04-LTS"
}


output "id" {
  value = data.azurerm_platform_image.example.id
}




data "azurerm_shared_image" "example" {
  name = "mysharedimage"
  resource_group_name = "ksaazurevmrg"
  gallery_name = "mygallery"
}


output "idshared" {
  value = data.azurerm_shared_image.example.id
}


data "azurerm_images" "example" {
  resource_group_name = "ksaazurevmrg"
}


output "idimage" {
  value = data.azurerm_images.example.id
}
Akhil Kumar
Akhil Kumar
3 years ago

10
0
Would love your thoughts, please comment.x
()
x