-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(azure): allow CosmosDB Accounts to be referenced by name
This fixes some `account_name` not found issues for CosmosDB resources
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package azure | ||
|
||
import ( | ||
"github.com/infracost/infracost/internal/schema" | ||
) | ||
|
||
// This is a free resource but needs it's own custom registry item to specify the custom ID lookup function. | ||
func getCosmosDBAccountRegistryItem() *schema.RegistryItem { | ||
return &schema.RegistryItem{ | ||
Name: "azurerm_cosmosdb_account", | ||
NoPrice: true, | ||
Notes: []string{"Free resource."}, | ||
|
||
CustomRefIDFunc: func(d *schema.ResourceData) []string { | ||
return []string{d.Get("name").String()} | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters