Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws db instance: displaying invalid parameter in error #4803

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aws/resource_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,13 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
return nil
})
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick: we have a helper function to simplify this logic (and normally prefer to use SDK provided constants but looks like the rds package doesn't have one here 😉 )

if isAWSErr(err, "InvalidParameterValue", "") {

if awsErr.Code() == "InvalidParameterValue" {
return fmt.Errorf("Error creating DB Instance: %s, %+v", err, opts)
}
}
return fmt.Errorf("Error creating DB Instance: %s", err)

}
}

Expand Down