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

New Resource: azurerm_cosmosdb_postgresql_cluster #21090

Merged
merged 35 commits into from
Apr 26, 2023

Conversation

neil-yechenwei
Copy link
Contributor

@neil-yechenwei neil-yechenwei commented Mar 23, 2023

fixes #19375

image

@tombuildsstuff tombuildsstuff added waiting-response upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR labels Mar 27, 2023
@neil-yechenwei
Copy link
Contributor Author

neil-yechenwei commented Apr 21, 2023

@katbyte , thanks for your comment. I updated PR. Please take another look. Thanks.
image

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @neil-yechenwei. Thanks for this PR. It looks mostly good but there are a few potential crashes and some code we should shrink down if we can.

}

if props := model.Properties; props != nil {
state.AdministratorLoginPassword = metadata.ResourceData.Get("administrator_login_password").(string)
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't need to set these values in state if the api isn't returning them

Copy link
Contributor Author

@neil-yechenwei neil-yechenwei Apr 26, 2023

Choose a reason for hiding this comment

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

TF would fail with below error after it's removed. I remember the colleague from your team previously suggested me to read it from tf file. So I assume we need to keep it.

=== RUN   TestAccCosmosDbPostgreSQLCluster_basic
=== PAUSE TestAccCosmosDbPostgreSQLCluster_basic
=== CONT  TestAccCosmosDbPostgreSQLCluster_basic
    testcase.go:110: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
                
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        
        Terraform will perform the following actions:
        
          # azurerm_cosmosdb_postgresql_cluster.test will be updated in-place
          ~ resource "azurerm_cosmosdb_postgresql_cluster" "test" {
              + administrator_login_password         = (sensitive value)
                id                                   = "/subscriptions/xx-xx-xxx-xx/resourceGroups/acctestRG-pshsc-230426160316468761/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/acctestcluster230426160316468761"
                name                                 = "acctestcluster230426160316468761"
                # (15 unchanged attributes hidden)
            }
        
        Plan: 0 to add, 1 to change, 0 to destroy.

Copy link
Member

Choose a reason for hiding this comment

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

Oh. That's interesting. I haven't seen that before. I wonder whats going on there. But no worries, we can keep it that way!


if props := model.Properties; props != nil {
state.AdministratorLoginPassword = metadata.ResourceData.Get("administrator_login_password").(string)
state.SourceResourceId = metadata.ResourceData.Get("source_resource_id").(string)
Copy link
Member

Choose a reason for hiding this comment

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

And here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above reason

Copy link
Contributor

Choose a reason for hiding this comment

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

@neil-yechenwei this is returned from the API - is this coming back as nil / is this an API bug?

@neil-yechenwei
Copy link
Contributor Author

@mbfrahry , thanks for your comments. I updated PR. Please take another look. Thanks.

--- PASS: TestAccCosmosDbPostgreSQLCluster_basic (1008.82s)
--- PASS: TestAccCosmosDbPostgreSQLCluster_requiresImport (1110.25s)
--- PASS: TestAccCosmosDbPostgreSQLCluster_withSourceCluster (2897.53s)
--- PASS: TestAccCosmosDbPostgreSQLCluster_update (2622.03s)
--- PASS: TestAccCosmosDbPostgreSQLCluster_complete (974.04s)

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for those changes @neil-yechenwei

@mbfrahry mbfrahry added this to the v3.54.0 milestone Apr 26, 2023
@mbfrahry mbfrahry merged commit f966ed0 into hashicorp:main Apr 26, 2023
mbfrahry added a commit that referenced this pull request Apr 26, 2023
tombuildsstuff pushed a commit that referenced this pull request Apr 27, 2023
@github-actions
Copy link

This functionality has been released in v3.54.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

github-actions bot commented Jun 1, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Azure Cosmos for Postgres
4 participants