<- All Blueprints
Customizable templates for deploying cloud infrastructure

Azure Managed Disk

This blueprint creates an Azure Managed Disk with best practices in mind, such as defaulting the storage account type to "Standard_LRS" for cost-effectiveness and setting the create option to "Empty" for a new disk. It encourages the use of tags for better resource identification and management. Advanced configurations like specifying the OS type and source URI are available for more experienced users, and variables are organized into logical groups to assist users—including those who may not be cloud infrastructure experts—in configuring essential and advanced settings easily.

Define and customize Blueprints to set what infrastructure configuration options are available to developers.

---
constants:
  __name: "{{ name }}_{{ __guid }}"
variables:
  name:
    desc: "Name of the managed disk."
    required: true
    group: Managed Disk Details
  resource_group_name:
    desc: "Name of the resource group."
    required: true
    group: Managed Disk Details
    links_to: resource.azurerm_resource_group.name
  location:
    desc: "Azure region where the managed disk will be created."
    required: true
    group: Managed Disk Details
    default: "eastus"
  storage_account_type:
    desc: "Type of storage account to use for the managed disk."
    required: false
    group: Storage Settings
    default: "Standard_LRS"
    suggested: "Standard_LRS"
  create_option:
    desc: "Specifies how the disk should be created."
    required: true
    group: Creation Options
    default: "Empty"
    suggested: "Empty"
  disk_size_gb:
    desc: "Size of the disk in GB."
    required: true
    group: Disk Size
    default: 30
  os_type:
    desc: "Operating system type of the disk ('Windows' or 'Linux')."
    required: false
    group: Advanced
    advanced: true
  source_uri:
    desc: "URI to the source from which to create the disk."
    required: false
    group: Advanced
    advanced: true
  tags:
    group: Tags
    required: false
groups:
  Managed Disk Details:
    order: 1
    desc: "Basic settings for the managed disk."
  Storage Settings:
    order: 2
    desc: "Storage configuration for the managed disk."
  Creation Options:
    order: 3
    desc: "Options for creating the managed disk."
  Disk Size:
    order: 4
    desc: "Size configuration for the managed disk."
  Advanced:
    order: 5
    desc: "Advanced settings for the managed disk."
  Tags:
    order: 6
    desc: "Tags to assign to the managed disk."
---

resource "azurerm_managed_disk" "__name" {
  name                = {{ name }}
  location            = {{ location }}
  resource_group_name = {{ resource_group_name }}
  storage_account_type = {{ storage_account_type }}
  create_option       = {{ create_option }}
  disk_size_gb        = {{ disk_size_gb }}

  os_type   = {{ os_type | required: false | advanced: true }}
  source_uri = {{ source_uri | required: false | advanced: true }}

  tags = {
    Name = {{ name }}
    {{# tags }}
      {{ tags.key | required: false }} = {{ tags.value | required: false }}
    {{/ tags }}
  }
}

# Provides options to create a managed disk with secure and cost-effective defaults.
# Encourages the use of tagging for resource identification and management.
# Advanced options allow specifying OS type and source URI if needed.
//
A form is created automatically that accepts inputs that you defined in the Blueprint.
After filling out the Blueprint form, Terraform is generated and a PR is automatically submitted.
What am I looking at?

Talk to a Human

See Resourcely in action and learn how it can help you secure and manage your cloud infrastructure today!