Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Add retries for Packer builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brikis98 committed Oct 15, 2020
1 parent a85a17d commit 0045407
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/terratest_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package test

import (
"testing"
"time"

"github.com/gruntwork-io/terratest/modules/packer"
)
Expand All @@ -20,6 +21,11 @@ func buildAmi(t *testing.T, packerTemplatePath string, packerBuildName string, a
Env: map[string]string{
CONSUL_AMI_TEMPLATE_VAR_DOWNLOAD_URL: downloadUrl,
},
RetryableErrors: map[string]string{
"Error waiting for AMI: Failed with ResourceNotReady error": "https://www.packer.io/docs/builders/amazon.html#resourcenotready-error",
},
MaxRetries: 3,
TimeBetweenRetries: 10 * time.Second,
}

return packer.BuildAmi(t, options)
Expand Down

0 comments on commit 0045407

Please sign in to comment.