Merge pull request #4240 from hashicorp/b-aws-catch-sg-name-id-error

provider/aws: Trap Instance error from mismatched SG IDs and Names
This commit is contained in:
Clint 2016-01-13 11:57:58 -06:00
commit c9231a73ec
1 changed files with 7 additions and 0 deletions

View File

@ -369,6 +369,13 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
time.Sleep(2 * time.Second)
continue
}
// Warn if the AWS Error involves group ids, to help identify situation
// where a user uses group ids in security_groups for the Default VPC.
// See https://github.com/hashicorp/terraform/issues/3798
if awsErr.Code() == "InvalidParameterValue" && strings.Contains(awsErr.Message(), "groupId is invalid") {
return fmt.Errorf("Error launching instance, possible mismatch of Security Group IDs and Names. See AWS Instance docs here: %s.\n\n\tAWS Error: %s", "https://terraform.io/docs/providers/aws/r/instance.html", awsErr.Message())
}
}
break
}