@@ -21,61 +21,61 @@ func TestAccCloudStackVPNCustomerGateway_basic(t *testing.T) {
2121 Config : testAccCloudStackVPNCustomerGateway_basic ,
2222 Check : resource .ComposeTestCheckFunc (
2323 testAccCheckCloudStackVPNCustomerGatewayExists (
24- "cloudstack_vpn_connection .foo" , & vpnCustomerGateway ),
24+ "cloudstack_vpn_customer_gateway .foo" , & vpnCustomerGateway ),
2525 testAccCheckCloudStackVPNCustomerGatewayAttributes (& vpnCustomerGateway ),
2626 resource .TestCheckResourceAttr (
27- "cloudstack_vpn_connection .foo" , "name" , "terraform-foo" ),
27+ "cloudstack_vpn_customer_gateway .foo" , "name" , "terraform-foo" ),
2828 resource .TestCheckResourceAttr (
29- "cloudstack_vpn_connection .bar" , "name" , "terraform-bar" ),
29+ "cloudstack_vpn_customer_gateway .bar" , "name" , "terraform-bar" ),
3030 resource .TestCheckResourceAttr (
31- "cloudstack_vpn_connection .foo" , "ike_policy" , "aes256-sha1" ),
31+ "cloudstack_vpn_customer_gateway .foo" , "ike_policy" , "aes256-sha1" ),
3232 resource .TestCheckResourceAttr (
33- "cloudstack_vpn_connection .bar" , "esp_policy" , "aes256-sha1" ),
33+ "cloudstack_vpn_customer_gateway .bar" , "esp_policy" , "aes256-sha1" ),
3434 ),
3535 },
3636 },
3737 })
3838}
3939
4040func TestAccCloudStackVPNCustomerGateway_update (t * testing.T ) {
41- var nic cloudstack.Nic
41+ var vpnCustomerGateway cloudstack.VpnCustomerGateway
4242
4343 resource .Test (t , resource.TestCase {
4444 PreCheck : func () { testAccPreCheck (t ) },
4545 Providers : testAccProviders ,
46- CheckDestroy : testAccCheckCloudStackNICDestroy ,
46+ CheckDestroy : testAccCheckCloudStackVPNCustomerGatewayDestroy ,
4747 Steps : []resource.TestStep {
4848 resource.TestStep {
49- Config : TestAccCloudStackVPNCustomerGateway_basic ,
49+ Config : testAccCloudStackVPNCustomerGateway_basic ,
5050 Check : resource .ComposeTestCheckFunc (
5151 testAccCheckCloudStackVPNCustomerGatewayExists (
52- "cloudstack_vpn_connection .foo" , & vpnCustomerGateway ),
52+ "cloudstack_vpn_customer_gateway .foo" , & vpnCustomerGateway ),
5353 testAccCheckCloudStackVPNCustomerGatewayAttributes (& vpnCustomerGateway ),
5454 resource .TestCheckResourceAttr (
55- "cloudstack_vpn_connection .foo" , "name" , "terraform-foo" ),
55+ "cloudstack_vpn_customer_gateway .foo" , "name" , "terraform-foo" ),
5656 resource .TestCheckResourceAttr (
57- "cloudstack_vpn_connection .bar" , "name" , "terraform-bar" ),
57+ "cloudstack_vpn_customer_gateway .bar" , "name" , "terraform-bar" ),
5858 resource .TestCheckResourceAttr (
59- "cloudstack_vpn_connection .foo" , "ike_policy" , "aes256-sha1" ),
59+ "cloudstack_vpn_customer_gateway .foo" , "ike_policy" , "aes256-sha1" ),
6060 resource .TestCheckResourceAttr (
61- "cloudstack_vpn_connection .bar" , "esp_policy" , "aes256-sha1" ),
61+ "cloudstack_vpn_customer_gateway .bar" , "esp_policy" , "aes256-sha1" ),
6262 ),
6363 },
6464
6565 resource.TestStep {
66- Config : TestAccCloudStackVPNCustomerGateway_update ,
66+ Config : testAccCloudStackVPNCustomerGateway_update ,
6767 Check : resource .ComposeTestCheckFunc (
6868 testAccCheckCloudStackVPNCustomerGatewayExists (
69- "cloudstack_vpn_connection .foo" , & vpnCustomerGateway ),
69+ "cloudstack_vpn_customer_gateway .foo" , & vpnCustomerGateway ),
7070 testAccCheckCloudStackVPNCustomerGatewayAttributes (& vpnCustomerGateway ),
7171 resource .TestCheckResourceAttr (
72- "cloudstack_vpn_connection .foo" , "name" , "terraform-foo-bar" ),
72+ "cloudstack_vpn_customer_gateway .foo" , "name" , "terraform-foo-bar" ),
7373 resource .TestCheckResourceAttr (
74- "cloudstack_vpn_connection .bar" , "name" , "terraform-bar-foo" ),
74+ "cloudstack_vpn_customer_gateway .bar" , "name" , "terraform-bar-foo" ),
7575 resource .TestCheckResourceAttr (
76- "cloudstack_vpn_connection .foo" , "ike_policy" , "3des-md5" ),
76+ "cloudstack_vpn_customer_gateway .foo" , "ike_policy" , "3des-md5" ),
7777 resource .TestCheckResourceAttr (
78- "cloudstack_vpn_connection .bar" , "esp_policy" , "3des-md5" ),
78+ "cloudstack_vpn_customer_gateway .bar" , "esp_policy" , "3des-md5" ),
7979 ),
8080 },
8181 },
@@ -135,7 +135,7 @@ func testAccCheckCloudStackVPNCustomerGatewayDestroy(s *terraform.State) error {
135135 cs := testAccProvider .Meta ().(* cloudstack.CloudStackClient )
136136
137137 for _ , rs := range s .RootModule ().Resources {
138- if rs .Type != "cloudstack_vpn_connection " {
138+ if rs .Type != "cloudstack_vpn_customer_gateway " {
139139 continue
140140 }
141141
@@ -158,16 +158,14 @@ func testAccCheckCloudStackVPNCustomerGatewayDestroy(s *terraform.State) error {
158158
159159var testAccCloudStackVPNCustomerGateway_basic = fmt .Sprintf (`
160160resource "cloudstack_vpc" "foo" {
161- name = "terraform-vpc"
162- display_text = "terraform-vpc-text"
161+ name = "terraform-vpc-foo"
163162 cidr = "%s"
164163 vpc_offering = "%s"
165164 zone = "%s"
166165}
167166
168167resource "cloudstack_vpc" "bar" {
169- name = "terraform-vpc"
170- display_text = "terraform-vpc-text"
168+ name = "terraform-vpc-bar"
171169 cidr = "%s"
172170 vpc_offering = "%s"
173171 zone = "%s"
@@ -185,7 +183,7 @@ resource "cloudstack_vpn_customer_gateway" "foo" {
185183 name = "terraform-foo"
186184 cidr = "${cloudstack_vpc.foo.cidr}"
187185 esp_policy = "aes256-sha1"
188- gateway = "${cloudstack_vpn_gateway.foo.publicip }"
186+ gateway = "${cloudstack_vpn_gateway.foo.public_ip }"
189187 ike_policy = "aes256-sha1"
190188 ipsec_psk = "terraform"
191189}
@@ -194,7 +192,7 @@ resource "cloudstack_vpn_customer_gateway" "bar" {
194192 name = "terraform-bar"
195193 cidr = "${cloudstack_vpc.bar.cidr}"
196194 esp_policy = "aes256-sha1"
197- gateway = "${cloudstack_vpn_gateway.bar.publicip }"
195+ gateway = "${cloudstack_vpn_gateway.bar.public_ip }"
198196 ike_policy = "aes256-sha1"
199197 ipsec_psk = "terraform"
200198}` ,
@@ -210,7 +208,7 @@ resource "cloudstack_vpn_customer_gateway" "foo" {
210208 name = "terraform-foo-bar"
211209 cidr = "${cloudstack_vpc.foo.cidr}"
212210 esp_policy = "3des-md5"
213- gateway = "${cloudstack_vpn_gateway.foo.publicip }"
211+ gateway = "${cloudstack_vpn_gateway.foo.public_ip }"
214212 ike_policy = "3des-md5"
215213 ipsec_psk = "terraform"
216214}
@@ -219,7 +217,7 @@ resource "cloudstack_vpn_customer_gateway" "bar" {
219217 name = "terraform-bar-foo"
220218 cidr = "${cloudstack_vpc.bar.cidr}"
221219 esp_policy = "3des-md5"
222- gateway = "${cloudstack_vpn_gateway.bar.publicip }"
220+ gateway = "${cloudstack_vpn_gateway.bar.public_ip }"
223221 ike_policy = "3des-md5"
224222 ipsec_psk = "terraform"
225223}` )
0 commit comments