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

fix: port iam_users from postgresql module #467

Conversation

johnjelinek
Copy link
Contributor

@johnjelinek johnjelinek commented May 3, 2023

Fixes #463. Adds iam_users variable to add service accounts and IAM users to a CloudSQL database running MySQL.

Signed-off-by: John Jelinek <john.jelinek@liveramp.com>
@johnjelinek johnjelinek force-pushed the feature/issue-463/add-iam-users-to-msyql branch from 5e3495a to fc04174 Compare May 3, 2023 15:51
Signed-off-by: John Jelinek <john.jelinek@liveramp.com>
@johnjelinek johnjelinek force-pushed the feature/issue-463/add-iam-users-to-msyql branch from fc04174 to 4e7f5f6 Compare May 3, 2023 15:52
@johnjelinek
Copy link
Contributor Author

johnjelinek commented May 3, 2023

@g-awmalik: please let me know if anything is missing. I'm not sure why the conventionalcommits check failed. Are you able to run the check again?

@apeabody apeabody changed the title [Fix #463] Port iam_users from postgresql module fix(#463): Port iam_users from postgresql module May 3, 2023
@johnjelinek
Copy link
Contributor Author

johnjelinek commented May 3, 2023

OH! I have been updating my commits to follow the convention, I didn't realize it also wanted that for the PR subject too. Thanks @apeabody!

@apeabody
Copy link
Contributor

apeabody commented May 3, 2023

OH! I have been updating my commits to follow the convention, I didn't realize it also wanted that for the PR subject too. Thanks @apeabody!

Sure thing, it's probably not clear in the check status, but for this repo only the PR's title is considered.

@g-awmalik g-awmalik changed the title fix(#463): Port iam_users from postgresql module fix: port iam_users from postgresql module May 3, 2023
@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

/gcbrun

@johnjelinek
Copy link
Contributor Author

I can't see where it broke the build.

@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

I can't see where it broke the build.

The example points to v5.6 for mysql which does not support IAM users. I just updated that to 8.0.

@johnjelinek
Copy link
Contributor Author

Good catch!

@g-awmalik
Copy link
Contributor

@johnjelinek - now it's complaining about the format of the service account:

"Error: Error, failed to insert user cloudsql-mysql-sa-01@ci-sql-db-c902.iam into instance example-mysql-private-ad63128b: googleapi: Error 400: Invalid request: Database user cannot be created. Provided Cloud IAM service account "cloudsql-mysql-sa-01@ci-sql-db-c902.iam" is not in valid format. Please specify full service account email address Eg: serviceaccount@projectid.iam.gserviceaccount.com."

Can you please check the logic?

Copy link
Contributor Author

@johnjelinek johnjelinek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the code to leverage the service account established in the test fixture.

test/fixtures/mysql-private/variables.tf Outdated Show resolved Hide resolved
test/fixtures/mysql-private/main.tf Show resolved Hide resolved
@g-awmalik
Copy link
Contributor

/gcbrun

Signed-off-by: John Jelinek <john.jelinek@liveramp.com>
Signed-off-by: John Jelinek <john.jelinek@liveramp.com>
@johnjelinek johnjelinek force-pushed the feature/issue-463/add-iam-users-to-msyql branch from 792366a to 39f62d8 Compare May 4, 2023 23:57
@johnjelinek
Copy link
Contributor Author

@g-awmalik: try again, I had forgotten to sign the last commits.

@g-awmalik
Copy link
Contributor

/gcbrun

@johnjelinek
Copy link
Contributor Author

I'm not sure what the build is upset about this time.

@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik
Copy link
Contributor

/gcbrun

1 similar comment
@g-awmalik
Copy link
Contributor

/gcbrun

@g-awmalik g-awmalik merged commit 5732125 into terraform-google-modules:master May 6, 2023
@johnjelinek johnjelinek deleted the feature/issue-463/add-iam-users-to-msyql branch May 6, 2023 22:45
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

Successfully merging this pull request may close these issues.

safer_mysql Invalid request: For IAM users, password or hostname should not be specified.
3 participants