Skip to content

Commit

Permalink
r/media_service_account: temporarily removing support for Tags due to…
Browse files Browse the repository at this point in the history
… an API bug

```
$ acctests-proxy azurerm TestAccAzureRMMediaServicesAccount_basic
=== RUN   TestAccAzureRMMediaServicesAccount_basic
=== PAUSE TestAccAzureRMMediaServicesAccount_basic
=== CONT  TestAccAzureRMMediaServicesAccount_basic
--- FAIL: TestAccAzureRMMediaServicesAccount_basic (128.02s)
    testing.go:538: Step 0 error: After applying this step, the plan was not empty:

        DIFF:

        UPDATE: azurerm_media_services_account.test
          tags.%: "" => "<computed>"

        STATE:

        azurerm_media_services_account.test:
          ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Media/mediaservices/acctestmsarfshu
          provider = provider.azurerm
          location = westeurope
          name = acctestmsarfshu
          resource_group_name = 190222174721721594
          storage_account.# = 1
          storage_account.318018769.id = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Storage/storageAccounts/acctestsa1rfshu
          storage_account.318018769.is_primary = true

          Dependencies:
            azurerm_resource_group.test
            azurerm_storage_account.first
        azurerm_resource_group.test:
          ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594
          provider = provider.azurerm
          location = westeurope
          name = 190222174721721594
          tags.% = 0
        azurerm_storage_account.first:
          ID = /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/190222174721721594/providers/Microsoft.Storage/storageAccounts/acctestsa1rfshu
          provider = provider.azurerm
          access_tier =
          account_encryption_source = Microsoft.Storage
          account_kind = Storage
          account_replication_type = GRS
          account_tier = Standard
          account_type = Standard_GRS
          enable_blob_encryption = true
          enable_file_encryption = true
          enable_https_traffic_only = false
          identity.# = 0
          location = westeurope
          name = acctestsa1rfshu
          network_rules.# = 0
          primary_access_key = 2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ==
          primary_blob_connection_string = DefaultEndpointsProtocol=https;BlobEndpoint=https://acctestsa1rfshu.blob.core.windows.net/;AccountName=acctestsa1rfshu;AccountKey=2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ==
          primary_blob_endpoint = https://acctestsa1rfshu.blob.core.windows.net/
          primary_connection_string = DefaultEndpointsProtocol=https;AccountName=acctestsa1rfshu;AccountKey=2De66EJdd5Am14XG8hYjkgpEf8PJLF0QEvY2QOLaaBzHApo32GWGBKrC5zXyQllegPNI5ex17Sgg0BI+jeYrHQ==;EndpointSuffix=core.windows.net
          primary_file_endpoint = https://acctestsa1rfshu.file.core.windows.net/
          primary_location = westeurope
          primary_queue_endpoint = https://acctestsa1rfshu.queue.core.windows.net/
          primary_table_endpoint = https://acctestsa1rfshu.table.core.windows.net/
          resource_group_name = 190222174721721594
          secondary_access_key = cT0gpMIavYw5zuG/DAxyaKHXpTyzglMfvRO0kAQFagWBuZIejsz0j4jZKWW6ct8/IvcMwp5Ers0C2pwJCvdGCw==
          secondary_connection_string = DefaultEndpointsProtocol=https;AccountName=acctestsa1rfshu;AccountKey=cT0gpMIavYw5zuG/DAxyaKHXpTyzglMfvRO0kAQFagWBuZIejsz0j4jZKWW6ct8/IvcMwp5Ers0C2pwJCvdGCw==;EndpointSuffix=core.windows.net
          secondary_location = northeurope
          tags.% = 0

          Dependencies:
            azurerm_resource_group.test
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	128.566s
```
  • Loading branch information
tombuildsstuff committed Feb 22, 2019
1 parent f2619da commit e0af2a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 63 deletions.
8 changes: 4 additions & 4 deletions azurerm/resource_arm_media_services_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func resourceArmMediaServicesAccount() *schema.Resource {
},
},

"tags": tagsSchema(),
// TODO: support Tags when this bug is fixed:
// https://github.com/Azure/azure-rest-api-specs/issues/5249
//"tags": tagsSchema(),
},
}
}
Expand All @@ -69,7 +71,6 @@ func resourceArmMediaServicesAccountCreateUpdate(d *schema.ResourceData, meta in

accountName := d.Get("name").(string)
location := azureRMNormalizeLocation(d.Get("location").(string))
tags := d.Get("tags").(map[string]interface{})
resourceGroup := d.Get("resource_group_name").(string)

storageAccountsRaw := d.Get("storage_account").(*schema.Set).List()
Expand All @@ -83,7 +84,6 @@ func resourceArmMediaServicesAccountCreateUpdate(d *schema.ResourceData, meta in
StorageAccounts: storageAccounts,
},
Location: utils.String(location),
Tags: expandTags(tags),
}

if _, e := client.CreateOrUpdate(ctx, resourceGroup, accountName, parameters); e != nil {
Expand Down Expand Up @@ -135,7 +135,7 @@ func resourceArmMediaServicesAccountRead(d *schema.ResourceData, meta interface{
}
}

flattenAndSetTags(d, resp.Tags)
//flattenAndSetTags(d, resp.Tags)

return nil
}
Expand Down
57 changes: 0 additions & 57 deletions azurerm/resource_arm_media_services_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,6 @@ func TestAccAzureRMMediaServicesAccount_basic(t *testing.T) {
})
}

func TestAccAzureRMMediaServicesAccount_complete(t *testing.T) {
resourceName := "azurerm_media_services_account.test"
ri := tf.AccRandTimeInt()
rs := acctest.RandString(5)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMMediaServicesAccountDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMMediaServicesAccount_complete(ri, rs, testLocation()),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "storage_account.#", "1"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMMediaServicesAccount_multipleAccounts(t *testing.T) {
resourceName := "azurerm_media_services_account.test"
ri := tf.AccRandTimeInt()
Expand All @@ -79,7 +53,6 @@ func TestAccAzureRMMediaServicesAccount_multipleAccounts(t *testing.T) {
Check: resource.ComposeAggregateTestCheckFunc(
testCheckAzureRMMediaServicesAccountExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "storage_account.#", "2"),
resource.TestCheckResourceAttr(resourceName, "tags.%", "1"),
),
},
{
Expand Down Expand Up @@ -186,28 +159,6 @@ resource "azurerm_media_services_account" "test" {
`, template, rString)
}

func testAccAzureRMMediaServicesAccount_complete(rInt int, rString, location string) string {
template := testAccAzureRMMediaServicesAccount_template(rInt, rString, location)
return fmt.Sprintf(`
%s
resource "azurerm_media_services_account" "test" {
name = "acctestmsa%s"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
storage_account {
id = "${azurerm_storage_account.first.id}"
is_primary = true
}
tags {
"Hello" = "World"
}
}
`, template, rString)
}

func testAccAzureRMMediaServicesAccount_multipleAccounts(rInt int, rString, location string) string {
template := testAccAzureRMMediaServicesAccount_template(rInt, rString, location)
return fmt.Sprintf(`
Expand Down Expand Up @@ -235,10 +186,6 @@ resource "azurerm_media_services_account" "test" {
id = "${azurerm_storage_account.second.id}"
is_primary = false
}
tags {
"Hello" = "World"
}
}
`, template, rString, rString)
}
Expand Down Expand Up @@ -270,10 +217,6 @@ resource "azurerm_media_services_account" "test" {
id = "${azurerm_storage_account.first.id}"
is_primary = true
}
tags {
"Hello" = "World"
}
}
`, template, rString, rString)
}
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/media_services_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ The following arguments are supported:

* `storage_account` - (Required) One or more `storage_account` blocks as defined below.

* `tags` - (Optional) A mapping of tags to assign to the resource.

---

A `storage_account` block supports the following:
Expand Down

0 comments on commit e0af2a8

Please sign in to comment.