Skip to content

Commit

Permalink
Added EnableAggregationPipeline to Cosmos DB capabilities hashicorp#1848
Browse files Browse the repository at this point in the history
  • Loading branch information
mobility authored and mobility committed Aug 30, 2018
1 parent 1a72110 commit cfba833
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions azurerm/resource_arm_cosmos_db_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func resourceArmCosmosDBAccount() *schema.Resource {
"EnableTable",
"EnableGremlin",
`EnableCassandra`,
"EnableAggregationPipeline"
}, true),
},
},
Expand Down
35 changes: 35 additions & 0 deletions azurerm/resource_arm_cosmos_db_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,31 @@ func TestAccAzureRMCosmosDBAccount_mongoDB(t *testing.T) {
})
}

func TestAccAzureRMCosmosDBAccount_aggregation(t *testing.T) {
ri := acctest.RandInt()
resourceName := "azurerm_cosmosdb_account.test"

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMCosmosDBAccountDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMCosmosDBAccount_aggregation(ri, testLocation()),
Check: resource.ComposeAggregateTestCheckFunc(
checkAccAzureRMCosmosDBAccount_basic(resourceName, testLocation(), string(documentdb.BoundedStaleness), 1),
resource.TestCheckResourceAttr(resourceName, "kind", "MongoDB"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMCosmosDBAccount_gremlin(t *testing.T) {
ri := acctest.RandInt()
resourceName := "azurerm_cosmosdb_account.test"
Expand Down Expand Up @@ -554,6 +579,16 @@ func testAccAzureRMCosmosDBAccount_mongoDB(rInt int, location string) string {
`)
}

func testAccAzureRMCosmosDBAccount_aggregation(rInt int, location string) string {
return testAccAzureRMCosmosDBAccount_basic(rInt, location, string(documentdb.BoundedStaleness), "", `
kind = "MongoDB"
capabilities = {
name = "EnableAggregationPipeline"
}
`)
}

func testAccAzureRMCosmosDBAccount_gremlin(rInt int, location string) string {
return testAccAzureRMCosmosDBAccount_basic(rInt, location, string(documentdb.BoundedStaleness), "", `
kind = "GlobalDocumentDB"
Expand Down

0 comments on commit cfba833

Please sign in to comment.