Skip to content

Commit 891703d

Browse files
committed
Adding resource importer
1 parent b3ca9a7 commit 891703d

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

cloudstack/resource_cloudstack_zone.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ func resourceCloudStackZone() *schema.Resource {
3333
Read: resourceCloudStackZoneRead,
3434
Update: resourceCloudStackZoneUpdate,
3535
Delete: resourceCloudStackZoneDelete,
36+
Importer: &schema.ResourceImporter{
37+
State: schema.ImportStatePassthrough,
38+
},
3639
Schema: map[string]*schema.Schema{
3740
"allocationstate": {
3841
Type: schema.TypeString,

cloudstack/resource_cloudstack_zone_test.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,27 @@ func TestAccCloudStackZone_basic(t *testing.T) {
4545

4646
const testAccCloudStackZone_basic = `
4747
resource "cloudstack_zone" "test" {
48-
name = "acctest"
49-
dns1 = "8.8.8.8"
50-
dns2 = "8.8.8.8"
51-
internal_dns1 = "8.8.4.4"
52-
internal_dns2 = "8.8.4.4"
53-
network_type = "Advanced"
54-
domain = "foo.cloudstack.com"
55-
48+
name = "acctest"
49+
dns1 = "8.8.8.8"
50+
dns2 = "8.8.8.8"
51+
internal_dns1 = "8.8.4.4"
52+
internal_dns2 = "8.8.4.4"
53+
network_type = "Advanced"
54+
domain = "cloudstack.apache.org"
5655
}
5756
`
5857

5958
// guestcidraddress = "172.29.1.0/20"
6059

6160
const testAccCloudStackZone_update = `
6261
resource "cloudstack_zone" "test" {
63-
name = "acctestupdated"
64-
dns1 = "8.8.4.4"
65-
dns2 = "8.8.4.4"
66-
internal_dns1 = "8.8.8.8"
67-
internal_dns2 = "8.8.8.8"
68-
network_type = "Advanced"
69-
domain = "foo.cloudstack.com"
62+
name = "acctestupdated"
63+
dns1 = "8.8.4.4"
64+
dns2 = "8.8.4.4"
65+
internal_dns1 = "8.8.8.8"
66+
internal_dns2 = "8.8.8.8"
67+
network_type = "Advanced"
68+
domain = "cloudstack.apache.org"
7069
guestcidraddress = "172.29.2.0/20"
7170
}
7271
`

0 commit comments

Comments
 (0)