awscloud/secure-instance: log error code comparisons

We're seeing some behaviour where create fleet is not retried and
subsequently the SI cleanup fails due to the security group already
being tied to an existing instance. There is no error that an instance
was launched anyway.
This commit is contained in:
Sanne Raymaekers 2024-11-22 15:27:00 +01:00 committed by Ondřej Budai
parent 7f2766793d
commit 7a166cd356

View file

@ -639,6 +639,7 @@ func doCreateFleetRetry(cfOutput *ec2.CreateFleetOutput) (bool, []string) {
msg := []string{}
retry := false
for _, err := range cfOutput.Errors {
logrus.Infof("Checking to retry fleet create on error %s (msg: %s)", *err.ErrorCode, *err.ErrorMessage)
if slices.Contains(retryCodes, *err.ErrorCode) {
retry = true
}