Merge pull request #104 from justinsb/fix_35

More tweaks to the IAM async creation tolerance
This commit is contained in:
Justin Santa Barbara 2016-07-09 13:49:15 -04:00 committed by GitHub
commit fdfe710c92
1 changed files with 7 additions and 3 deletions

View File

@ -253,10 +253,14 @@ func (_ *LaunchConfiguration) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *La
_, err = t.Cloud.Autoscaling.CreateLaunchConfiguration(request)
if err != nil {
if awsup.AWSErrorCode(err) == "ValidationError" && strings.Contains(awsup.AWSErrorMessage(err), "Invalid IamInstanceProfile") {
// IAM instance profile creation is notoriously async
return fmt.Errorf("IAM instance profile %q not yet created/propagated", err)
if awsup.AWSErrorCode(err) == "ValidationError" {
message := awsup.AWSErrorMessage(err)
if strings.Contains(message, "not authorized") || strings.Contains(message, "Invalid IamInstance") {
// IAM instance profile creation is notoriously async
return fmt.Errorf("IAM instance profile not yet created/propagated")
}
}
glog.V(4).Infof("ErrorCode=%q, Message=%q", awsup.AWSErrorCode(err), awsup.AWSErrorMessage(err))
return fmt.Errorf("error creating AutoscalingLaunchConfiguration: %v", err)
}