Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Fix wrong external name configuration of azurerm_cosmosdb_account #163

Merged
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
2 changes: 1 addition & 1 deletion config/cosmosdb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func Configure(p *config.Provider) {
r.ExternalName = config.NameAsIdentifier
r.ExternalName.GetExternalNameFn = common.GetNameFromFullyQualifiedID
// /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1
r.ExternalName.GetIDFn = common.GetFullyQualifiedIDFn("Microsoft.DocumentDB", "databaseAccounts", "account_name")
r.ExternalName.GetIDFn = common.GetFullyQualifiedIDFn("Microsoft.DocumentDB", "databaseAccounts", "name")
})

p.AddResourceConfigurator("azurerm_cosmosdb_notebook_workspace", func(r *config.Resource) {
Expand Down
28 changes: 28 additions & 0 deletions examples/cosmosdb/account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: cosmosdb.azure.jet.crossplane.io/v1alpha2
kind: Account
metadata:
name: example-account
spec:
forProvider:
kind: MongoDB
location: "East US"
offerType: Standard
mongoServerVersion: "4.0"
backup:
- type: Continuous
consistencyPolicy:
- consistencyLevel: Session
resourceGroupNameRef:
name: example
geoLocation:
- failoverPriority: 0
location: "East US"
zoneRedundant: False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, what happens if we omit this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the zoneRedundant field, the default value is also False and when we omit this, the value is set to the False

capabilities:
- name: EnableMongo
- name: DisableRateLimitingResponses
providerConfigRef:
name: example
writeConnectionSecretToRef:
name: conn-example-cosmos
namespace: crossplane-system