-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Resource:
azurerm_virtual_machine_data_disk_attachment
(#1207)
* New Resource: `azurerm_virtual_machine_data_disk_attachment` * Disclaimers about not using both resources at the same time * Fixing an incorrect assignment * Documentation fixes * Fixing some broken tests * Removing the `create_option` field * Moving to support only managed disks * Refactoring to switch back to how it was * Explaining why we're deliberately ignoring an error * Adding missing validation for the create_option * Required -> Optional * Fixing issues identified in PR Review
- Loading branch information
1 parent
ad765f4
commit 10af28f
Showing
9 changed files
with
979 additions
and
125 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
azurerm/import_arm_virtual_machine_data_disk_attachment_test.go
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 @@ | ||
package azurerm | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform/helper/acctest" | ||
"github.com/hashicorp/terraform/helper/resource" | ||
) | ||
|
||
func TestAccAzureRMVirtualMachineDataDiskAttachment_importBasic(t *testing.T) { | ||
resourceName := "azurerm_virtual_machine_data_disk_attachment.test" | ||
ri := acctest.RandInt() | ||
location := testLocation() | ||
config := testAccAzureRMVirtualMachineDataDiskAttachment_basic(ri, location) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMVirtualMachineDataDiskAttachmentDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: resourceName, | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAzureRMVirtualMachineDataDiskAttachment_importMultipleDisks(t *testing.T) { | ||
ri := acctest.RandInt() | ||
location := testLocation() | ||
config := testAccAzureRMVirtualMachineDataDiskAttachment_multipleDisks(ri, location) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testCheckAzureRMVirtualMachineDataDiskAttachmentDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: config, | ||
}, | ||
{ | ||
ResourceName: "azurerm_virtual_machine_data_disk_attachment.first", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
{ | ||
ResourceName: "azurerm_virtual_machine_data_disk_attachment.second", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
}, | ||
}, | ||
}) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.