github.com/erriapo/terraform@v0.6.12-0.20160203182612-0340ea72354f/website/source/docs/providers/azurerm/r/storage_blob.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_storage_blob"
     4  sidebar_current: "docs-azurerm-resource-storage-blob"
     5  description: |-
     6    Create a Azure Storage Blob.
     7  ---
     8  
     9  # azurerm\_storage\_blob
    10  
    11  Create an Azure Storage Blob.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "azurerm_resource_group" "test" {
    17      name = "acctestrg-%d"
    18      location = "westus"
    19  }
    20  
    21  resource "azurerm_storage_account" "test" {
    22      name = "acctestacc%s"
    23      resource_group_name = "${azurerm_resource_group.test.name}"
    24      location = "westus"
    25      account_type = "Standard_LRS"
    26  }
    27  
    28  resource "azurerm_storage_container" "test" {
    29      name = "vhds"
    30      resource_group_name = "${azurerm_resource_group.test.name}"
    31      storage_account_name = "${azurerm_storage_account.test.name}"
    32      container_access_type = "private"
    33  }
    34  
    35  resource "azurerm_storage_blob" "testsb" {
    36      name = "sample.vhd"
    37  
    38      resource_group_name = "${azurerm_resource_group.test.name}"
    39      storage_account_name = "${azurerm_storage_account.test.name}"
    40      storage_container_name = "${azurerm_storage_container.test.name}"
    41  
    42      type = "page"
    43      size = 5120
    44  }
    45  ```
    46  
    47  ## Argument Reference
    48  
    49  The following arguments are supported:
    50  
    51  * `name` - (Required) The name of the storage blob. Must be unique within the storage container the blob is located.
    52  
    53  * `resource_group_name` - (Required) The name of the resource group in which to
    54      create the storage container. Changing this forces a new resource to be created.
    55  
    56  * `storage_account_name` - (Required) Specifies the storage account in which to create the storage container.
    57   Changing this forces a new resource to be created.
    58  
    59  * `storage_container_name` - (Required) The name of the storage container in which this blob should be created.
    60  
    61  * `type` - (Required) The type of the storage blob to be created. One of either `block` or `page`.
    62  
    63  * `size` - (Optional) Used only for `page` blobs to specify the size in bytes of the blob to be created. Must be a multiple of 512. Defaults to 0. 
    64  
    65  ## Attributes Reference
    66  
    67  The following attributes are exported in addition to the arguments listed above:
    68  
    69  * `id` - The storage blob Resource ID.
    70  * `url` - The URL of the blob