Skip to content

Commit

Permalink
New Resource azurerm_cosmosdb_gremlin_graph (#5301)
Browse files Browse the repository at this point in the history
Fixes last parts of #3692 & #4970
  • Loading branch information
SebRosander authored and katbyte committed Jan 8, 2020
1 parent 6de6220 commit e2c0f4b
Show file tree
Hide file tree
Showing 6 changed files with 1,040 additions and 0 deletions.
22 changes: 22 additions & 0 deletions azurerm/helpers/azure/cosmos.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,25 @@ func ParseCosmosTableID(id string) (*CosmosTableID, error) {
Table: table,
}, nil
}

type CosmosGremlinGraphID struct {
CosmosDatabaseID
Graph string
}

func ParseCosmosGramlinGraphID(id string) (*CosmosGremlinGraphID, error) {
subid, err := ParseCosmosDatabaseID(id)
if err != nil {
return nil, err
}

graph, ok := subid.Path["graphs"]
if !ok {
return nil, fmt.Errorf("Error: Unable to parse Cosmos Gremlin Graph Resource ID: Graph is missing from: %s", id)
}

return &CosmosGremlinGraphID{
CosmosDatabaseID: *subid,
Graph: graph,
}, nil
}
1 change: 1 addition & 0 deletions azurerm/internal/services/cosmos/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func (r Registration) SupportedResources() map[string]*schema.Resource {
"azurerm_cosmosdb_account": resourceArmCosmosDbAccount(),
"azurerm_cosmosdb_cassandra_keyspace": resourceArmCosmosDbCassandraKeyspace(),
"azurerm_cosmosdb_gremlin_database": resourceArmCosmosGremlinDatabase(),
"azurerm_cosmosdb_gremlin_graph": resourceArmCosmosDbGremlinGraph(),
"azurerm_cosmosdb_mongo_collection": resourceArmCosmosDbMongoCollection(),
"azurerm_cosmosdb_mongo_database": resourceArmCosmosDbMongoDatabase(),
"azurerm_cosmosdb_sql_container": resourceArmCosmosDbSQLContainer(),
Expand Down
Loading

0 comments on commit e2c0f4b

Please sign in to comment.