provider/aws: Trap Instance error from mismatched SG IDs and Names

This commit is contained in:
clint shryock 2015-12-09 15:59:36 -06:00
parent 981add77a3
commit 5c60f7f2c1
1 changed files with 7 additions and 0 deletions

View File

@ -364,6 +364,13 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error {
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
continue 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 break
} }