-
Notifications
You must be signed in to change notification settings - Fork 4.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
Upgrade CosmosDB SDK to 2019-08-01 from 2015-04-08 #6253
Conversation
@@ -386,14 +388,18 @@ func resourceArmCosmosDbGremlinGraphRead(d *schema.ResourceData, meta interface{ | |||
d.Set("throughput", nil) | |||
} | |||
} else { | |||
d.Set("throughput", throughputResp.Throughput) | |||
if props := throughputResp.ThroughputSettingsGetProperties; props != nil { |
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 this is used in almost every resource I am wondering if we should pull this out to a helper function? Thoughts would be appreciated
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 could see the benefit of a helper here, returning a default value for this field 👍
I will move all of the functions from ./azurerm/helpers/azure/cosmos.go to the respective ./azurerm/internal/services/cosmos/parse/**.go folder, most of the tests above are failing. |
Looks like the parse functions need to be updated as the resource IDs have changed:
i think we'll have to handle the IDs changing for existing resources 🤔 |
- Move parse functionality from /helpers/azure/cosmos.go to individual helper functions.
I've added handling for the new and existing ID parsing so that we can still support parsing existing resources. Not sure if there is something else we should be changing in addition to this? TestAccAzureRMCosmosDbCassandraKeyspace_basic test is passing with latest parse changes. I've kicked off the remainder basic tests locally as well. I am updating their status in the top level PR Comment
|
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.
hey @Brunhil
Thanks for this splitting this out 😃
I've taken a look through and left some comments inline, but this is off to a good start; if we can add the state migrations to update the ID (which'll update the ID in the Statefile for existing users, meaning we can assume everyone's using the updated ID format going forward, as is shown in the documentation) then this should otherwise be good 👍
Thanks!
azurerm/internal/services/cosmos/parse/cassandra_keyspace_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/parse/gremlin_database_test.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_collection.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_database.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_container.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_database.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/cosmos/resource_arm_cosmosdb_table.go
Outdated
Show resolved
Hide resolved
@tombuildsstuff , I've added the state migration changes, but I do believe something is wrong with them. The acceptance test for Cassandra is now failing after the latest changes. I can't seem to find where I've done something wrong, I'm hoping a second set of eyes will make it clear!
|
I've noticed issues with normal provision behavior, creating DB accounts can take > 10 mins in many cases; this may be the source of test lengths. |
This has been released in version 2.18.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.18.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Upgrade CosmosDB SDK to 2019-08-01 from 2015-04-08 to address @tombuildsstuff comments in PR 6189 about upgrading the remaining resources.
Below is the basic acceptance test results for each resource that was modified:
--- PASS: TestAccAzureRMCosmosDBAccount_basic_global_boundedStaleness (1043.38s)
--- PASS: TestAccAzureRMCosmosDbCassandraKeyspace_basic (1301.73s)
--- PASS: TestAccAzureRMCosmosGremlinDatabase_basic (1254.89s)
--- PASS: TestAccAzureRMCosmosDbGremlinGraph_basic (1371.48s)
--- PASS: TestAccAzureRMCosmosDbMongoCollection_basic (1338.83s)
--- PASS: TestAccAzureRMCosmosDbMongoDatabase_basic (1285.84s)
--- PASS: TestAccAzureRMCosmosDbSqlContainer_basic (1382.01s)
--- PASS: TestAccAzureRMCosmosDbSqlDatabase_basic (1284.77s)
--- PASS: TestAccAzureRMCosmosDbTable_basic (1314.77s)