Merge pull request #13846 from hashicorp/b-update-opc-instance-docs
provider/opc: Fix Instance Label / Update Docs
This commit is contained in:
commit
a7ccf1c76b
|
@ -80,6 +80,7 @@ func resourceInstance() *schema.Resource {
|
|||
"label": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
|
|
|
@ -136,6 +136,27 @@ func TestAccOPCInstance_storage(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestAccOPCInstance_emptyLabel(t *testing.T) {
|
||||
resName := "opc_compute_instance.test"
|
||||
rInt := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccOPCCheckInstanceDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
{
|
||||
Config: testAccInstanceEmptyLabel(rInt),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccOPCCheckInstanceExists,
|
||||
resource.TestCheckResourceAttr(resName, "name", fmt.Sprintf("acc-test-instance-%d", rInt)),
|
||||
resource.TestCheckResourceAttrSet(resName, "label"),
|
||||
),
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func testAccOPCCheckInstanceExists(s *terraform.State) error {
|
||||
client := testAccProvider.Meta().(*compute.Client).Instances()
|
||||
|
||||
|
@ -271,3 +292,17 @@ resource "opc_compute_instance" "test" {
|
|||
}
|
||||
}`, rInt, rInt, rInt)
|
||||
}
|
||||
|
||||
func testAccInstanceEmptyLabel(rInt int) string {
|
||||
return fmt.Sprintf(`
|
||||
resource "opc_compute_instance" "test" {
|
||||
name = "acc-test-instance-%d"
|
||||
shape = "oc3"
|
||||
image_list = "/oracle/public/oel_6.7_apaas_16.4.5_1610211300"
|
||||
instance_attributes = <<JSON
|
||||
{
|
||||
"foo": "bar"
|
||||
}
|
||||
JSON
|
||||
}`, rInt)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ description: |-
|
|||
Creates and manages a security list in an OPC identity domain.
|
||||
---
|
||||
|
||||
# opc\_compute\_ip\_reservation
|
||||
# opc\_compute\_security\_list
|
||||
|
||||
The ``opc_compute_security_list`` resource creates and manages a security list in an OPC identity domain.
|
||||
|
||||
|
|
Loading…
Reference in New Issue