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

gcp_sql_user module: add Cloud IAM users to the instances #649

Open
iungoron opened this issue Sep 12, 2024 · 0 comments
Open

gcp_sql_user module: add Cloud IAM users to the instances #649

iungoron opened this issue Sep 12, 2024 · 0 comments

Comments

@iungoron
Copy link

iungoron commented Sep 12, 2024

SUMMARY

Ability to add an existing IAM principal as user on the Cloud SQL instances.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

google.cloud.gcp_sql_user module

ADDITIONAL INFORMATION

Actually only standard MySQL users with built-in authentication can be created.
There should be the possibility to add a Cloud IAM principal for the authentication to the MySQL user
And also add the possibility to assign privileges ad the community.mysql.mysql_user module does with the priv parameter

For example:

  • allow principal email as name of the user
  • specify the type of authentication
  • assign privileges
- name: create a user
     google.cloud.gcp_sql_user:
       name: test-user@test_project.iam.gserviceaccount.com
       authentication: builtin / iam
       host: x.x.x.x
       password: secret-password
       instance: "{{ instance }}"
       project: test_project
       auth_kind: serviceaccount
       service_account_file: "/tmp/auth.pem"
       priv:
         'mydb1.*': 'ALL'
         'mydb2.*': 'SELECT'
       state: present
References:

https://docs.ansible.com/ansible/latest/collections/google/cloud/gcp_sql_user_module.html
https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_user_module.html#ansible-collections-community-mysql-mysql-user-module
https://cloud.google.com/sql/docs/mysql/add-manage-iam-users
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant