Skip to content

Commit

Permalink
Use Terraform notation to improve visibility of this attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
manicminer committed Apr 23, 2020
1 parent ef3c5a8 commit 05e6882
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,15 @@ func testCheckAzureRMSharedImageExists(resourceName string) resource.TestCheckFu
}

func testAccAzureRMSharedImage_basic(data acceptance.TestData, hyperVGen string) string {
hyperVGenAttr := ""
if hyperVGen != "" {
hyperVGenAttr = fmt.Sprintf(`hyper_v_generation = "%s"`, hyperVGen)
}

return fmt.Sprintf(`
provider "azurerm" {
features {}
}
variable "hyper_v_generation" {
default = "%s"
}
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
Expand All @@ -183,16 +182,15 @@ resource "azurerm_shared_image" "test" {
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
os_type = "Linux"
%s
hyper_v_generation = var.hyper_v_generation != "" ? var.hyper_v_generation : null
identifier {
publisher = "AccTesPublisher%d"
offer = "AccTesOffer%d"
sku = "AccTesSku%d"
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, hyperVGenAttr, data.RandomInteger, data.RandomInteger, data.RandomInteger)
`, hyperVGen, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger)
}

func testAccAzureRMSharedImage_requiresImport(data acceptance.TestData) string {
Expand Down

0 comments on commit 05e6882

Please sign in to comment.