-
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
azurerm_cosmosdb_account
- support new version of mongo_server_version
#27763
Conversation
@katbyte Hi! Thank you for earlier work in this repository. Can you please review this pull request? :) |
} | ||
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stephybun thanks for your time and feedback. Sure, I have parameterized the test. Could you please take another look? Thanks.
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 @sinbai LGTM 🦕
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