awscloud/secure-instance: retry for 10 minutes

retry for 10 x 60sec. and don't log retries twice
This commit is contained in:
Florian Schüller 2024-11-21 19:48:52 +01:00 committed by Florian Schüller
parent 4ec8894244
commit 446e8448e3

View file

@ -229,7 +229,7 @@ func (a *AWS) TerminateSecureInstance(si *SecureInstance) error {
func (a *AWS) terminatePreviousSI(hostInstanceID string) (string, error) {
var retryCount int
const maxRetries = 3
const maxRetries = 10
descrInstancesOutput, err := a.ec2.DescribeInstances(
context.Background(),
@ -292,7 +292,7 @@ func (a *AWS) terminatePreviousSI(hostInstanceID string) (string, error) {
TerminatedWaiterOptions := func(o *ec2.InstanceTerminatedWaiterOptions) {
o.Retryable = retryFunction
o.LogWaitAttempts = true
o.MinDelay = 60 * time.Second
}
instTermWaiter := ec2.NewInstanceTerminatedWaiter(a.ec2)