Skip to content

Commit c23f2d9

Browse files
committed
Fix with lifecycle
1 parent bd8afbe commit c23f2d9

File tree

2 files changed

+262
-759
lines changed

2 files changed

+262
-759
lines changed

internal/services/instance/action_server_action_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@ func TestAccActionServerReboot_Basic(t *testing.T) {
2121
name = "test-terraform-datasource-private-nic"
2222
type = "DEV1-S"
2323
image = "ubuntu_jammy"
24-
}`,
25-
},
26-
{
27-
Config: `
28-
resource "scaleway_instance_server" "main" {
29-
name = "test-terraform-datasource-private-nic"
30-
type = "DEV1-S"
31-
image = "ubuntu_jammy"
24+
25+
lifecycle {
26+
action_trigger {
27+
events = [after_create]
28+
actions = [action.scaleway_instance_server_action.main]
29+
}
30+
}
3231
}
3332
34-
action "scaleway_instance_server_reboot" "main" {
35-
server_id = scaleway_instance_server.main.id
33+
action "scaleway_instance_server_action" "main" {
34+
config {
35+
server_id = scaleway_instance_server.main.id
36+
}
3637
}
3738
`,
3839
Check: resource.ComposeTestCheckFunc(),

0 commit comments

Comments
 (0)