mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-04 17:51:11 +00:00
50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
package google
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccMonitoringNotificationChannel_update(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testAccCheckMonitoringNotificationChannelDestroy,
|
|
Steps: []resource.TestStep{
|
|
{
|
|
Config: testAccMonitoringNotificationChannel_update("email", `email_address = "fake_email@blahblah.com"`),
|
|
},
|
|
{
|
|
ResourceName: "google_monitoring_notification_channel.update",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
{
|
|
Config: testAccMonitoringNotificationChannel_update("sms", `number = "+15555379009"`),
|
|
},
|
|
{
|
|
ResourceName: "google_monitoring_notification_channel.update",
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
func testAccMonitoringNotificationChannel_update(channel, labels string) string {
|
|
return fmt.Sprintf(`
|
|
resource "google_monitoring_notification_channel" "update" {
|
|
display_name = "IntTest Notification Channel"
|
|
type = "%s"
|
|
labels = {
|
|
%s
|
|
}
|
|
}
|
|
`, channel, labels,
|
|
)
|
|
}
|