-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add support rootPassword property for MS SQL Server #2592
Add support rootPassword property for MS SQL Server #2592
Conversation
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs. Thanks for your contribution! A human will be with you soon. @danawillow, please review this PR or find an appropriate assignee. |
36e080b
to
63faeb3
Compare
Hi @kopachevsky, I see that you've marked this as a draft. Can you please let me know when it's ready for review, or if there's anything you'd like help figuring out? Thanks! |
@danawillow I'm currently testing it with terraform module I'm working on, regarding help - can you clarify for me requirements to switch it to review state, I did not run any kind of integration testing and didn't add any unit tests, is it required? |
Feel free to change it to the review state whenever you'd like me to take a look at it. A test would be great- you can take a look at our existing ones at https://github.com/GoogleCloudPlatform/magic-modules/blob/master/third_party/terraform/tests/resource_sql_database_instance_test.go.erb. We have some guidance on running tests at https://github.com/GoogleCloudPlatform/magic-modules#testing-your-changes. |
@danawillow ready for review |
Thanks! The code looks reasonable at a glance, but I'm going to hold off until there are tests. Sounds like that's blocked on https://github.com/GoogleCloudPlatform/magic-modules/issues/2641, so I commented there. |
@kopachevsky Will you be able to add tests to this? |
|
295f765
to
6fd9d76
Compare
@danawillow added test, it passed, ready for review again:) |
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesWARNING: The following files changed in commit 6fd9d76 may need corresponding changes in third_party/validator:
No diff detected in terraform-google-conversion. New Pull RequestsI built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kopachevsky! Just a few comments.
{ | ||
ResourceName: "google_sql_database_instance.instance", | ||
ImportState: true, | ||
// ImportStateVerify check disabled as long root_password property not stored in state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend using an ImportStateVerifyIgnore
instead of ImportStateVerify: false
so we can at least check the other fields. I'd also mention that the field isn't returned from the API (since it is stored in state)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, done
@@ -212,6 +212,8 @@ The following arguments are supported: | |||
|
|||
* `replica_configuration` - (Optional) The configuration for replication. The | |||
configuration is detailed below. | |||
|
|||
* `root_password` - (Optional) Required for MS SQL Server, ignored MySQL and PostgreSQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `root_password` - (Optional) Required for MS SQL Server, ignored MySQL and PostgreSQL. | |
* `root_password` - (Optional) Initial root password. Required for MS SQL Server, ignored by MySQL and PostgreSQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, added (Optional, Beta)
@@ -325,6 +325,13 @@ func resourceSqlDatabaseInstance() *schema.Resource { | |||
ForceNew: true, | |||
}, | |||
|
|||
"root_password": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since SQL server in GCP is still in beta, I think we should put this property only in the beta provider. If you agree, then you'll want to change the file extension to .go.erb
and add tags like the ones you'll find in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/third_party/terraform/resources/resource_compute_network_peering.go.erb for example. Same thing applies for the test, and then you'll want to say that it's beta in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, sure
@@ -212,6 +212,8 @@ The following arguments are supported: | |||
|
|||
* `replica_configuration` - (Optional) The configuration for replication. The | |||
configuration is detailed below. | |||
|
|||
* `root_password` - (Optional) Required for MS SQL Server, ignored MySQL and PostgreSQL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also mention in database_version
what the accepted MSSQL versions are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll take those from discovery document
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
392e9d0
to
8d3cd8f
Compare
@danawillow thanks for review, applied changes to all comments, feel free to re-review |
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesterraform-provider-google-beta already has an open PR. New Pull RequestsI didn't open any new pull requests because of this PR. |
… SQL Server Added root_password parameter required MS SQL Server instance creation, ignored MySQL and PostgreSQL. Fix added both to beta and ga providers. Fixes #hashicorp/terraform-provider-google/issues/4776
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
1064818
to
b54223e
Compare
As this is no longer beta, can we get this merged into the non beta google provider please? I'm using provider version |
@goobysnack can you please file a new issue for that? That's the best way to get things on our team's radar. https://github.com/terraform-providers/terraform-provider-google/issues/new?template=enhancement.md |
For what it's worth, any new features we add (adding a beta field to the GA provider counts as a new feature) will be in the 3.X series, so it would be worth it for you to upgrade so you can get new features and bugfixes. |
Still happening on 3.11.0.
....resource "google_sql_database_instance" "master": |
Looks like you're using the |
Added root_password parameter required MS SQL Server instance creation, ignored MySQL and PostgreSQL
Fixes hashicorp/terraform-provider-google/issues/4776