From 5a8088109b7faedefd13bc8c64518f4d1b65a1f5 Mon Sep 17 00:00:00 2001 From: David Przybilla Date: Sun, 10 Jun 2018 22:29:22 +0900 Subject: [PATCH] aws db instance: displaying invalid parameter in error --- aws/resource_aws_db_instance.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_db_instance.go b/aws/resource_aws_db_instance.go index 8ce9c7ad06c..f06ad81e79d 100644 --- a/aws/resource_aws_db_instance.go +++ b/aws/resource_aws_db_instance.go @@ -908,7 +908,13 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error return nil }) if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "InvalidParameterValue" { + return fmt.Errorf("Error creating DB Instance: %s, %+v", err, opts) + } + } return fmt.Errorf("Error creating DB Instance: %s", err) + } }