diff --git a/command/hcl2_upgrade.go b/command/hcl2_upgrade.go index c292c8815..2923d91fa 100644 --- a/command/hcl2_upgrade.go +++ b/command/hcl2_upgrade.go @@ -981,6 +981,9 @@ func writeProvisioner(typeName string, provisioner *template.Provisioner) []byte if provisioner.Timeout > 0 { cfg["timeout"] = provisioner.Timeout.String() } + if provisioner.PauseBefore > 0 { + cfg["pause_before"] = provisioner.PauseBefore.String() + } body.AppendNewline() jsonBodyToHCL2Body(block.Body(), cfg) return provisionerContent.Bytes() diff --git a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl index 19349db12..7cf8d558c 100644 --- a/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl +++ b/command/test-fixtures/hcl2_upgrade/complete/expected.pkr.hcl @@ -241,9 +241,10 @@ build { } provisioner "shell-local" { - inline = ["sleep 100000"] - only = ["amazon-ebs"] - timeout = "5s" + inline = ["sleep 100000"] + only = ["amazon-ebs"] + pause_before = "5s" + timeout = "5s" } post-processor "amazon-import" { diff --git a/command/test-fixtures/hcl2_upgrade/complete/input.json b/command/test-fixtures/hcl2_upgrade/complete/input.json index 1b4eb5dec..5efa2c419 100644 --- a/command/test-fixtures/hcl2_upgrade/complete/input.json +++ b/command/test-fixtures/hcl2_upgrade/complete/input.json @@ -189,6 +189,7 @@ "amazon-ebs" ], "timeout": "5s", + "pause_before": "5s", "inline": [ "sleep 100000" ]