File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ ```release-note:none
2+
3+ ```
Original file line number Diff line number Diff line change @@ -116,6 +116,59 @@ resource "google_storage_bucket" "default" {
116116` , context )
117117}
118118
119+ func TestAccCGCSnippet_spotInstanceBasicExample (t * testing.T ) {
120+ t .Parallel ()
121+
122+ context := map [string ]interface {}{
123+ "random_suffix" : randString (t , 10 ),
124+ }
125+
126+ vcrTest (t , resource.TestCase {
127+ PreCheck : func () { testAccPreCheck (t ) },
128+ Providers : testAccProviders ,
129+ Steps : []resource.TestStep {
130+ {
131+ Config : testAccCGCSnippet_spotInstanceBasicExample (context ),
132+ },
133+ {
134+ ResourceName : "google_compute_instance.spot_vm_instance" ,
135+ ImportState : true ,
136+ ImportStateVerify : true ,
137+ },
138+ },
139+ })
140+ }
141+
142+ func testAccCGCSnippet_spotInstanceBasicExample (context map [string ]interface {}) string {
143+ return Nprintf (`
144+
145+ resource "google_compute_instance" "spot_vm_instance" {
146+ name = "tf-test-spot-instance-name%{random_suffix}"
147+ machine_type = "f1-micro"
148+
149+ boot_disk {
150+ initialize_params {
151+ image = "debian-cloud/debian-9"
152+ }
153+ }
154+
155+ scheduling {
156+ preemptible = true
157+ automatic_restart = false
158+ provisioning_model = "SPOT"
159+ }
160+
161+ network_interface {
162+ # A default network is created for all GCP projects
163+ network = "default"
164+ access_config {
165+ }
166+ }
167+ }
168+
169+ ` , context )
170+ }
171+
119172func TestAccCGCSnippet_sqlDatabaseInstanceSqlserverExample (t * testing.T ) {
120173 t .Parallel ()
121174
You can’t perform that action at this time.
0 commit comments