azurerm_cosmosdb_account - support new version of mongo_server_version#27763
azurerm_cosmosdb_account - support new version of mongo_server_version#27763stephybun merged 3 commits intohashicorp:mainfrom
azurerm_cosmosdb_account - support new version of mongo_server_version#27763Conversation
|
@katbyte Hi! Thank you for earlier work in this repository. Can you please review this pull request? :) |
| func (CosmosDBAccountResource) basicMongoDBVersion50(data acceptance.TestData, consistency cosmosdb.DefaultConsistencyLevel) string { | ||
| return fmt.Sprintf(` | ||
| provider "azurerm" { | ||
| features {} | ||
| } | ||
|
|
||
| resource "azurerm_resource_group" "test" { | ||
| name = "acctestRG-cosmos-%d" | ||
| location = "%s" | ||
| } | ||
|
|
||
| resource "azurerm_cosmosdb_account" "test" { | ||
| name = "acctest-ca-%d" | ||
| location = azurerm_resource_group.test.location | ||
| resource_group_name = azurerm_resource_group.test.name | ||
| offer_type = "Standard" | ||
| kind = "MongoDB" | ||
| mongo_server_version = "5.0" | ||
|
|
||
| capabilities { | ||
| name = "EnableMongo" | ||
| } | ||
|
|
||
| consistency_policy { | ||
| consistency_level = "%s" | ||
| } | ||
|
|
||
| geo_location { | ||
| location = azurerm_resource_group.test.location | ||
| failover_priority = 0 | ||
| } | ||
| } | ||
| `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, string(consistency)) | ||
| } | ||
|
|
||
| func (CosmosDBAccountResource) basicMongoDBVersion60(data acceptance.TestData, consistency cosmosdb.DefaultConsistencyLevel) string { | ||
| return fmt.Sprintf(` | ||
| provider "azurerm" { | ||
| features {} | ||
| } | ||
|
|
||
| resource "azurerm_resource_group" "test" { | ||
| name = "acctestRG-cosmos-%d" | ||
| location = "%s" | ||
| } | ||
|
|
||
| resource "azurerm_cosmosdb_account" "test" { | ||
| name = "acctest-ca-%d" | ||
| location = azurerm_resource_group.test.location | ||
| resource_group_name = azurerm_resource_group.test.name | ||
| offer_type = "Standard" | ||
| kind = "MongoDB" | ||
| mongo_server_version = "6.0" | ||
|
|
||
| capabilities { | ||
| name = "EnableMongo" | ||
| } | ||
|
|
||
| consistency_policy { | ||
| consistency_level = "%s" | ||
| } | ||
|
|
||
| geo_location { | ||
| location = azurerm_resource_group.test.location | ||
| failover_priority = 0 | ||
| } | ||
| } | ||
| `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, string(consistency)) | ||
| } | ||
|
|
||
| func (CosmosDBAccountResource) basicMongoDBVersion70(data acceptance.TestData, consistency cosmosdb.DefaultConsistencyLevel) string { | ||
| return fmt.Sprintf(` | ||
| provider "azurerm" { | ||
| features {} | ||
| } | ||
|
|
||
| resource "azurerm_resource_group" "test" { | ||
| name = "acctestRG-cosmos-%d" | ||
| location = "%s" | ||
| } | ||
|
|
||
| resource "azurerm_cosmosdb_account" "test" { | ||
| name = "acctest-ca-%d" | ||
| location = azurerm_resource_group.test.location | ||
| resource_group_name = azurerm_resource_group.test.name | ||
| offer_type = "Standard" | ||
| kind = "MongoDB" | ||
| mongo_server_version = "7.0" | ||
|
|
||
| capabilities { | ||
| name = "EnableMongo" | ||
| } | ||
|
|
||
| consistency_policy { | ||
| consistency_level = "%s" | ||
| } | ||
|
|
||
| geo_location { | ||
| location = azurerm_resource_group.test.location | ||
| failover_priority = 0 | ||
| } | ||
| } | ||
| `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, string(consistency)) | ||
| } |
There was a problem hiding this comment.
These test configs are all identical except for the mongo server version. Can you please parameterize this test so we can avoid the duplication and pass the mongo server version in as an argument.
There was a problem hiding this comment.
Hi @stephybun thanks for your time and feedback. Sure, I have parameterized the test. Could you please take another look? Thanks.
|
Thank you very much @sinbai and @stephybun 👍 👍 👍 |
|
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. |
Community Note
Description
PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_cosmosdb_account- support new version ofmongo_server_version[Support for CosmosDB API Mongo 7.0 #27605]This is a (please select all that apply):
Related Issue(s)
Fixes #27605