diff --git a/azurestack/data_source_storage_account.go b/azurestack/data_source_storage_account.go index 805d61edb..47291c197 100644 --- a/azurestack/data_source_storage_account.go +++ b/azurestack/data_source_storage_account.go @@ -36,11 +36,11 @@ func dataSourceArmStorageAccount() *schema.Resource { Type: schema.TypeString, Computed: true, }, - - "access_tier": { - Type: schema.TypeString, - Computed: true, - }, + // currently not supported on Azure Stack + // "access_tier": { + // Type: schema.TypeString, + // Computed: true, + // }, "account_encryption_source": { Type: schema.TypeString, @@ -197,7 +197,8 @@ func dataSourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) e } if props := resp.AccountProperties; props != nil { - d.Set("access_tier", props.AccessTier) + // Currently not supported on Azure Stack + // d.Set("access_tier", props.AccessTier) // Not supported for 2017-03-09 profile // d.Set("enable_https_traffic_only", props.EnableHTTPSTrafficOnly) diff --git a/azurestack/resource_arm_storage_account.go b/azurestack/resource_arm_storage_account.go index e413d2653..35ce8a78c 100644 --- a/azurestack/resource_arm_storage_account.go +++ b/azurestack/resource_arm_storage_account.go @@ -82,15 +82,17 @@ func resourceArmStorageAccount() *schema.Resource { }, // Only valid for BlobStorage accounts, defaults to "Hot" in create function - "access_tier": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - string(storage.Cool), - string(storage.Hot), - }, true), - }, + // Currently not supported in Azure Stack to create anything but "Storage" v1 + // This type does not allow you to select Hot or Cold storage options + // "access_tier": { + // Type: schema.TypeString, + // Optional: true, + // Computed: true, + // ValidateFunc: validation.StringInSlice([]string{ + // string(storage.Cool), + // string(storage.Hot), + // }, true), + // }, // Constants not in 2017-03-09 profile "account_encryption_source": { @@ -351,22 +353,22 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e d.SetPartial("account_replication_type") } - if d.HasChange("access_tier") { - accessTier := d.Get("access_tier").(string) + // if d.HasChange("access_tier") { + // accessTier := d.Get("access_tier").(string) - opts := storage.AccountUpdateParameters{ - AccountPropertiesUpdateParameters: &storage.AccountPropertiesUpdateParameters{ - AccessTier: storage.AccessTier(accessTier), - }, - } + // opts := storage.AccountUpdateParameters{ + // AccountPropertiesUpdateParameters: &storage.AccountPropertiesUpdateParameters{ + // AccessTier: storage.AccessTier(accessTier), + // }, + // } - _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) - if err != nil { - return fmt.Errorf("Error updating Azure Storage Account access_tier %q: %+v", storageAccountName, err) - } + // _, err := client.Update(ctx, resourceGroupName, storageAccountName, opts) + // if err != nil { + // return fmt.Errorf("Error updating Azure Storage Account access_tier %q: %+v", storageAccountName, err) + // } - d.SetPartial("access_tier") - } + // d.SetPartial("access_tier") + // } if d.HasChange("tags") { tags := d.Get("tags").(map[string]interface{}) @@ -468,7 +470,8 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err } if props := resp.AccountProperties; props != nil { - d.Set("access_tier", props.AccessTier) + // Currently not supported on Azure Stack + // d.Set("access_tier", props.AccessTier) if customDomain := props.CustomDomain; customDomain != nil { if err := d.Set("custom_domain", flattenStorageAccountCustomDomain(customDomain)); err != nil { diff --git a/azurestack/resource_arm_storage_account_test.go b/azurestack/resource_arm_storage_account_test.go index bf2aad33f..dfc3b89fb 100644 --- a/azurestack/resource_arm_storage_account_test.go +++ b/azurestack/resource_arm_storage_account_test.go @@ -291,7 +291,7 @@ func TestAccAzureStackStorageAccount_blobStorageWithUpdate(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureStackStorageAccountExists("azurestack_storage_account.testsa"), resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "account_kind", "BlobStorage"), - resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Hot"), + // resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Hot"), ), }, @@ -299,7 +299,7 @@ func TestAccAzureStackStorageAccount_blobStorageWithUpdate(t *testing.T) { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureStackStorageAccountExists("azurestack_storage_account.testsa"), - resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Cool"), + // resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Cool"), ), }, }, @@ -327,7 +327,7 @@ func TestAccAzureStackStorageAccount_storageV2WithUpdate(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureStackStorageAccountExists("azurestack_storage_account.testsa"), resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "account_kind", "StorageV2"), - resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Hot"), + // resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Hot"), ), }, @@ -335,7 +335,7 @@ func TestAccAzureStackStorageAccount_storageV2WithUpdate(t *testing.T) { Config: postConfig, Check: resource.ComposeTestCheckFunc( testCheckAzureStackStorageAccountExists("azurestack_storage_account.testsa"), - resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Cool"), + // resource.TestCheckResourceAttr("azurestack_storage_account.testsa", "access_tier", "Cool"), ), }, }, @@ -687,7 +687,6 @@ resource "azurestack_storage_account" "testsa" { account_kind = "BlobStorage" account_tier = "Standard" account_replication_type = "LRS" - access_tier = "Cool" tags { environment = "production" @@ -734,7 +733,6 @@ resource "azurestack_storage_account" "testsa" { account_kind = "StorageV2" account_tier = "Standard" account_replication_type = "LRS" - access_tier = "Cool" tags { environment = "production" diff --git a/website/docs/d/storage_account.html.markdown b/website/docs/d/storage_account.html.markdown index 8884d8e58..d5df1961b 100644 --- a/website/docs/d/storage_account.html.markdown +++ b/website/docs/d/storage_account.html.markdown @@ -34,13 +34,17 @@ output "storage_account_tier" { * `location` - The Azure location where the Storage Account exists -* `account_kind` - Defines the Kind of account, either `BlobStorage` or `Storage`. +* `account_kind` - (Optional) Defines the Kind of account. Valid option is `Storage`. + . Changing this forces a new resource to be created. + Defaults to `Storage` currently as per [Azure Stack Storage Differences](https://docs.microsoft.com/en-us/azure/azure-stack/user/azure-stack-acs-differences) * `account_tier` - Defines the Tier of this storage account. * `account_replication_type` - Defines the type of replication used for this storage account. -* `access_tier` - Defines the access tier for `BlobStorage` accounts. +* `access_tier` - (Required for `BlobStorage` accounts) Defines the access tier + for `BlobStorage` accounts. Valid options are `Hot` and `Cold`, defaults to + `Hot`. - **`Currently Not Supported on Azure Stack`** * `account_encryption_source` - The Encryption Source for this Storage Account. diff --git a/website/docs/r/storage_account.html.markdown b/website/docs/r/storage_account.html.markdown index 5af2e6836..adac55273 100644 --- a/website/docs/r/storage_account.html.markdown +++ b/website/docs/r/storage_account.html.markdown @@ -23,7 +23,7 @@ resource "azurestack_storage_account" "testsa" { resource_group_name = "${azurestack_resource_group.testrg.name}" location = "westus" account_tier = "Standard" - account_replication_type = "GRS" + account_replication_type = "LRS" tags { environment = "staging" @@ -45,17 +45,17 @@ The following arguments are supported: * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -* `account_kind` - (Optional) Defines the Kind of account. Valid options are `Storage`, - `StorageV2` and `BlobStorage`. Changing this forces a new resource to be created. - Defaults to `Storage`. +* `account_kind` - (Optional) Defines the Kind of account. Valid option is `Storage`. + . Changing this forces a new resource to be created. + Defaults to `Storage` currently as per [Azure Stack Storage Differences](https://docs.microsoft.com/en-us/azure/azure-stack/user/azure-stack-acs-differences) -* `account_tier` - (Required) Defines the Tier to use for this storage account. Valid options are `Standard` and `Premium`. Changing this forces a new resource to be created +* `account_tier` - (Required) Defines the Tier to use for this storage account. Valid options are `Standard` and `Premium`. Changing this forces a new resource to be created - **`Can be provisioned, but no performance limit or guarantee.`** -* `account_replication_type` - (Required) Defines the type of replication to use for this storage account. Valid options are `LRS`, `GRS`, `RAGRS` and `ZRS`. +* `account_replication_type` - (Required) Defines the type of replication to use for this storage account. Valid option is `LRS` currently as per [Azure Stack Storage Differences](https://docs.microsoft.com/en-us/azure/azure-stack/user/azure-stack-acs-differences) * `access_tier` - (Required for `BlobStorage` accounts) Defines the access tier for `BlobStorage` accounts. Valid options are `Hot` and `Cold`, defaults to - `Hot`. + `Hot`. - **`Currently Not Supported on Azure Stack`** * `account_encryption_source` - (Optional) The Encryption Source for this Storage Account. Possible values are `Microsoft.Keyvault` and `Microsoft.Storage`. Defaults to `Microsoft.Storage`.