ansible-collections / ansible-collections/google.cloud

gcp_sql_user module: add Cloud IAM users to the instances

Open
#649 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
105
Forks
144
Avg merge
5d 10h
Merged PRs (30d)
4

Description

##### 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

Contributor guide

Open the contributing guide

Research direction

Start with the google.cloud.gcp_sql_user module and read the linked Cloud SQL IAM-users and community.mysql.mysql_user documentation. Compare the module's current built-in MySQL user behavior with the requested IAM principal, authentication, and privilege options. Done means the requested IAM-user and privilege-management behavior is supported and covered by the module's existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, google-cloud, python
Domain
cloud, database, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.