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

azurerm_search_service - the properties replica_count & partition_count are no longer force new #5935

Merged
merged 1 commit into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ func resourceArmSearchService() *schema.Resource {
Type: schema.TypeInt,
Optional: true,
Computed: true,
ForceNew: true,
},

"partition_count": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
ForceNew: true,
Type: schema.TypeInt,
Optional: true,
Computed: true,
ValidateFunc: validation.IntAtMost(12),
},

"primary_key": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestAccAzureRMSearchService_complete(t *testing.T) {
})
}

func TestAccAzureRMSearchService_tagUpdate(t *testing.T) {
func TestAccAzureRMSearchService_update(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_search_service", "test")

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -90,19 +90,19 @@ func TestAccAzureRMSearchService_tagUpdate(t *testing.T) {
CheckDestroy: testCheckAzureRMSearchServiceDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMSearchService_withCustomTagValue(data, "staging"),
Config: testAccAzureRMSearchService_basic(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMSearchServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.environment", "staging"),
),
},
{
Config: testAccAzureRMSearchService_withCustomTagValue(data, "production"),
Config: testAccAzureRMSearchService_complete(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMSearchServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.environment", "production"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "2"),
resource.TestCheckResourceAttr(data.ResourceName, "tags.environment", "Production"),
),
},
},
Expand Down Expand Up @@ -166,7 +166,7 @@ func testCheckAzureRMSearchServiceDestroy(s *terraform.State) error {
return nil
}

func testAccAzureRMSearchService_withCustomTagValue(data acceptance.TestData, tagValue string) string {
func testAccAzureRMSearchService_basic(data acceptance.TestData) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
Expand All @@ -180,14 +180,10 @@ resource "azurerm_search_service" "test" {
sku = "standard"

tags = {
environment = "%s"
environment = "staging"
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, tagValue)
}

func testAccAzureRMSearchService_basic(data acceptance.TestData) string {
return testAccAzureRMSearchService_withCustomTagValue(data, "staging")
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger)
}

func testAccAzureRMSearchService_requiresImport(data acceptance.TestData) string {
Expand Down Expand Up @@ -220,9 +216,11 @@ resource "azurerm_search_service" "test" {
location = "${azurerm_resource_group.test.location}"
sku = "standard"
replica_count = 2
partition_count = 3

tags = {
environment = "production"
environment = "Production"
residential = "Area"
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger)
Expand Down