provider-sql icon indicating copy to clipboard operation
provider-sql copied to clipboard

Support RDS IAM authentication

Open dudicoco opened this issue 3 years ago • 3 comments
trafficstars

Hi,

It seems that currently RDS IAM authentication for mysql/postgresql users is not possible with the provider.

Here are the official docs: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html

For mysql it is necessary to set AWSAuthenticationPlugin when creating the user.

For postgresql the user must be granted the rds_iam role.

This possible with the Terraform providers: https://registry.terraform.io/providers/bangau1/mysql/latest/docs/resources/user https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/postgresql_grant_role

dudicoco avatar Oct 15 '22 09:10 dudicoco

The rds_iam role could not be referenced because of the unauthorized charater _ in the metadata.name so impossible to grant the rds_iam membership to a new role.

apiVersion: postgresql.sql.crossplane.io/v1alpha1
kind: Role
metadata:
  name: rds_iam
spec:
  forProvider:
    privileges:
      login: false
      inherit: true

will fail with error

Role.postgresql.sql.crossplane.io "rds_iam" is invalid: metadata.name: Invalid value: "rds_iam": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

ntdt avatar Feb 01 '23 18:02 ntdt

Hi, I want to add the AWSAuthenticationPlugin to MySQL.

Would someone be able to point me to / guide me? I'm good with GO but didn't contribute here yet :)

AdamRussak avatar May 17 '23 10:05 AdamRussak