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

[rds] invalid default username when using Aurora PostgresSql #10579

Closed
shivlaks opened this issue Sep 28, 2020 · 2 comments · Fixed by #10597
Closed

[rds] invalid default username when using Aurora PostgresSql #10579

shivlaks opened this issue Sep 28, 2020 · 2 comments · Fixed by #10597
Assignees
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Milestone

Comments

@shivlaks
Copy link
Contributor

We recently added a property credentials to represent the master username and password.
It's an optional property with a default value of admin for the username.

Reproduction Steps

const cluster = new rds.DatabaseCluster(this, 'Database', {
      engine: rds.DatabaseClusterEngine.AURORA_POSTGRESQL,
      instanceProps: {
        instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM),
        vpc,
        vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE },
      },
      defaultDatabaseName: 'database123',
      parameterGroup: rds.ParameterGroup.fromParameterGroupName(this, 'ParameterGroup', 'default.aurora-postgresql11'),
      instances: 1,
      s3ImportBuckets: [importBucket], 
    });

What did you expect to happen?

Successful deployment when using default property for master username and password.
Specifying

What actually happened?

MasterUsername admin cannot be used as it is a reserved word used by the engine
(Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 37defeec-5b54-4541-ac05-6b5e92412ab2; Proxy: null)

Environment

  • CLI Version : 1.63.0
  • Framework Version:
  • Node.js Version: v14.8.0
  • OS : Mac OS 10.15.6
  • Language (Version): TypeScript (3.8.3)

Other


This is 🐛 Bug Report

@shivlaks shivlaks added bug This issue is a bug. p1 effort/small Small work item – less than a day of effort needs-triage This issue or PR still needs to be triaged. labels Sep 28, 2020
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Sep 28, 2020
@skinny85 skinny85 added this to the [GA] RDS milestone Sep 28, 2020
@jogold
Copy link
Contributor

jogold commented Sep 29, 2020

Already discussed here #5076

@skinny85
Copy link
Contributor

Thanks @jogold , sometimes we don't learn 😉.

I'll be working on a fix for this today.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Sep 29, 2020
skinny85 added a commit to skinny85/aws-cdk that referenced this issue Sep 29, 2020
In aws#10458, we started to default the master user name to 'admin'.
As it turns out, that actually doesn't work with PostgreSQL,
as 'admin' is a reserved word there.
Add a new optional property to IEngine called defaultUsername
that allows overriding the global 'admin' default on a per-Engine basis.
Set it to 'adminuser' for the Aurora Postgres Cluster engine and the Instance engine.

Fixes aws#10579
@mergify mergify bot closed this as completed in #10597 Sep 30, 2020
mergify bot pushed a commit that referenced this issue Sep 30, 2020
In #10458, we started to default the master user name to 'admin'.
As it turns out, that actually doesn't work with PostgreSQL,
as 'admin' is a reserved word there.
Add a new optional property to IEngine called defaultUsername
that allows overriding the global 'admin' default on a per-Engine basis.
Set it to 'adminuser' for the Aurora Postgres Cluster engine and the Postgres Instance engine.

Fixes #10579

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants