-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Azure Storage Accounts and basic storage resources
- Loading branch information
1 parent
9273784
commit e6b2b53
Showing
31 changed files
with
566 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Summary: An copy Azure Managed Disk created form another Azure Managed Disk | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_copy_managed_disk_resource_group" { | ||
name = "changeme-copy-storage-table-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Managed Disk in the Resource Group | ||
# Explanation: Managed Disks are housed in a managed Storage Account that can not be otherwise accessed | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_disk | ||
resource "azurerm_managed_disk" "changeme_copy_managed_disk_template_managed_disk" { | ||
name = "changeme-copy-managed-disk-template-managed-disk-name" | ||
location = "West US" | ||
|
||
disk_size_gb = "1" | ||
|
||
create_option = "Empty" | ||
resource_group_name = azurerm_resource_group.changeme_copy_managed_disk_resource_group.name | ||
storage_account_type = "Standard_LRS" | ||
} | ||
|
||
# Managed Disk copied from another Managed Disk in the same Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_disk | ||
resource "azurerm_managed_disk" "changeme_copy_managed_disk" { | ||
name = "changeme-copy-managed-disk-name" | ||
location = "West US" | ||
|
||
source_resource_id = azurerm_managed_disk.changeme_copy_managed_disk_template_managed_disk.id | ||
|
||
create_option = "Copy" | ||
resource_group_name = azurerm_resource_group.changeme_copy_managed_disk_resource_group.name | ||
storage_account_type = "Standard_LRS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Summary: An empty Azure Managed Disk | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_empty_managed_disk_resource_group" { | ||
name = "changeme-empty-storage-table-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Managed Disk in the Storage Account | ||
# Explanation: Managed Disks are housed in a managed Storage Account that can not be otherwise accessed | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/managed_disk | ||
resource "azurerm_managed_disk" "changeme_empty_managed_disk" { | ||
name = "changeme-empty-managed-disk-name" | ||
location = "West US" | ||
|
||
disk_size_gb = "1" | ||
|
||
create_option = "Empty" | ||
resource_group_name = azurerm_resource_group.changeme_empty_managed_disk_resource_group.name | ||
storage_account_type = "Standard_LRS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Summary: A simple Azure Storage Account | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_simple_storage_account_resource_group" { | ||
name = "changeme-simple-storage-account-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Storage Account within the Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account | ||
resource "azurerm_storage_account" "changeme_simple_storage_account" { | ||
name = "changemesimplesaname" | ||
resource_group_name = azurerm_resource_group.changeme_simple_storage_account_resource_group.name | ||
location = azurerm_resource_group.changeme_simple_storage_account_resource_group.location | ||
account_tier = "Standard" | ||
account_replication_type = "LRS" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Summary: An Azure Storage Blob using Append Block storage | ||
# Explanation: Append Blocks are block storage optimized for append operations | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_append_storage_blob_resource_group" { | ||
name = "changeme-append-storage-blob-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Storage Account within the Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account | ||
resource "azurerm_storage_account" "changeme_append_storage_blob_storage_account" { | ||
name = "changemeappendbsaname" | ||
resource_group_name = azurerm_resource_group.changeme_append_storage_blob_resource_group.name | ||
location = azurerm_resource_group.changeme_append_storage_blob_resource_group.location | ||
account_tier = "Standard" | ||
account_replication_type = "LRS" | ||
} | ||
|
||
# Storage Container in the Storage Account | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container | ||
resource "azurerm_storage_container" "changeme_append_storage_blob_storage_container" { | ||
name = "changemeappendbsacname" | ||
storage_account_name = azurerm_storage_account.changeme_append_storage_blob_storage_account.name | ||
} | ||
|
||
# Append Block Storage Blob in the Storage Container | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_blob | ||
resource "azurerm_storage_blob" "changeme_append_storage_blob" { | ||
name = "changemeappendblobname" | ||
storage_account_name = azurerm_storage_account.changeme_append_storage_blob_storage_account.name | ||
storage_container_name = azurerm_storage_container.changeme_append_storage_blob_storage_container.name | ||
type = "Append" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Summary: An Azure Storage Blob using Block storage | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_block_storage_blob_resource_group" { | ||
name = "changeme-block-storage-blob-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Storage Account within the Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account | ||
resource "azurerm_storage_account" "changeme_block_storage_blob_storage_account" { | ||
name = "changemeblockbsaname" | ||
resource_group_name = azurerm_resource_group.changeme_block_storage_blob_resource_group.name | ||
location = azurerm_resource_group.changeme_block_storage_blob_resource_group.location | ||
account_tier = "Standard" | ||
account_replication_type = "LRS" | ||
} | ||
|
||
# Storage Container in the Storage Account | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container | ||
resource "azurerm_storage_container" "changeme_block_storage_blob_storage_container" { | ||
name = "changemeblockbsacname" | ||
storage_account_name = azurerm_storage_account.changeme_block_storage_blob_storage_account.name | ||
} | ||
|
||
# Block Storage Blob in the Storage Container | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_blob | ||
resource "azurerm_storage_blob" "changeme_block_storage_blob" { | ||
name = "changemeblockblobname" | ||
storage_account_name = azurerm_storage_account.changeme_block_storage_blob_storage_account.name | ||
storage_container_name = azurerm_storage_container.changeme_block_storage_blob_storage_container.name | ||
type = "Block" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Summary: An Azure Storage Blob using Page storage | ||
|
||
# Documentation: https://www.terraform.io/docs/language/settings/index.html | ||
terraform { | ||
required_version = ">= 0.14.0" | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "~> 2.0" | ||
} | ||
} | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/values/variables.html | ||
variable "azure_subscription_id" { | ||
type = string | ||
} | ||
|
||
# Documentation: https://www.terraform.io/docs/language/providers/requirements.html | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs | ||
provider "azurerm" { | ||
features {} | ||
|
||
subscription_id = var.azure_subscription_id | ||
} | ||
|
||
# Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group | ||
resource "azurerm_resource_group" "changeme_page_storage_blob_resource_group" { | ||
name = "changeme-page-storage-blob-resource-group" | ||
location = "West Europe" | ||
} | ||
|
||
# Storage Account within the Resource Group | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account | ||
resource "azurerm_storage_account" "changeme_page_storage_blob_storage_account" { | ||
name = "changemepagebsaname" | ||
resource_group_name = azurerm_resource_group.changeme_page_storage_blob_resource_group.name | ||
location = azurerm_resource_group.changeme_page_storage_blob_resource_group.location | ||
account_tier = "Standard" | ||
account_replication_type = "LRS" | ||
} | ||
|
||
# Storage Container in the Storage Account | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_container | ||
resource "azurerm_storage_container" "changeme_page_storage_blob_storage_container" { | ||
name = "changemepagebsacname" | ||
storage_account_name = azurerm_storage_account.changeme_page_storage_blob_storage_account.name | ||
} | ||
|
||
# Page Storage Blob in the Storage Container | ||
# Documentation: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_blob | ||
resource "azurerm_storage_blob" "changeme_page_storage_blob" { | ||
name = "changemepageblobname" | ||
storage_account_name = azurerm_storage_account.changeme_page_storage_blob_storage_account.name | ||
storage_container_name = azurerm_storage_container.changeme_page_storage_blob_storage_container.name | ||
type = "Page" | ||
size = 512 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/apply.sh azurerm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
../../../bin/destroy.sh azurerm |
Oops, something went wrong.