terraform-aws-rds icon indicating copy to clipboard operation
terraform-aws-rds copied to clipboard

In database names hyphen is not allowed

Open stratos-fasly opened this issue 3 years ago β€’ 1 comments

From this terraform module not allowed to give DB name with hyphen (-), but its allowed with to create database with hyphen from AWS console.

Error: Error creating DB Instance: InvalidParameterValue: DBName must begin with a letter and contain only alphanumeric characters. β”‚ status code: 400, request id: 11199d72-a991-4824-8c32-349c021a2e80, { β”‚ AllocatedStorage: 20, β”‚ AutoMinorVersionUpgrade: true, β”‚ BackupRetentionPeriod: 5, β”‚ CopyTagsToSnapshot: false, β”‚ DBInstanceClass: "db.t4g.large", β”‚ DBInstanceIdentifier: "db-uw2-augst-postgre", β”‚ DBName: "db-uw2-augst-postgre", β”‚ DBParameterGroupName: "db-uw2-augst-postgre-20220802133332704100000001", β”‚ DBSubnetGroupName: "db-uw2-augst-postgre", β”‚ DeletionProtection: false, β”‚ Engine: "postgres", β”‚ EngineVersion: "14.1", β”‚ MasterUserPassword: "********", β”‚ MasterUsername: "master", β”‚ MaxAllocatedStorage: 100, β”‚ Port: 3306, β”‚ PubliclyAccessible: false, β”‚ StorageEncrypted: true, β”‚ Tags: [{ β”‚ Key: "DB-Name", β”‚ Value: "db-uw2-augst-postgre" β”‚ }] β”‚ }

stratos-fasly avatar Aug 02 '22 14:08 stratos-fasly

It looks like an answer from AWS API, not the module issue.

cuyk avatar Aug 05 '22 17:08 cuyk

Hello @stratos-fasly, I think this question deserves a more detailed answer. What @cuyk said is true, the error is an AWS error and I don't think it is a good idea to manage all exceptions through Terraform. We should let AWS handles errors.

However, I would like to comment on your first sentence. It is not possible to create a RDS with a database name containing hyphens. However, it is possible that the identifier of the RDS contains hyphens. Therefore, in your example, you should rename the DBName, but you can keep the DBInstanceIdentifier as you want.

I hope my answer was clear enough. Don't hesitate to tell me you need more information.

SolidSly avatar Aug 15 '22 13:08 SolidSly

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Sep 15 '22 00:09 github-actions[bot]

This issue was automatically closed because of stale in 10 days

github-actions[bot] avatar Sep 25 '22 00:09 github-actions[bot]

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Nov 13 '22 02:11 github-actions[bot]