Skip to content

AWS.RDS.signer + TypeORM #1116

@cdavis21

Description

@cdavis21

Hi,

I was wondering if you could provide some guidance. I'm using TypeORM and I'm trying to connect to an RDS Aurora MySQL instance using IAM authentication. I'm not sure if I have the correct syntax in the authPlugins object. I'm getting the following error:

Access denied for user 'xxxxxxxxxx'@'yyyyyyyyyyy' (using password: YES)

Aurora MySQL engine is 5.7.mysql_aurora.2.04.5

    const signer = new AWS.RDS.Signer({
      region,
      username,
      hostname,
      port: 3306
    });

createConnection({
      host,
      username,
      database,
      entities: [..., ....],
      ssl: 'Amazon RDS',
      extra: {
        authPlugins: {
          mysql_clear_password: () => () =>
            signer.getAuthToken({
              username,
              region,
              hostname,
              port: 3306
            })
        }
      }
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions