-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: arg code for PostgreSQL read replica detection (#430)
- Loading branch information
Showing
1 changed file
with
6 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 6 additions & 4 deletions
10
azure-resources/DBforPostgreSQL/flexibleServers/kql/2ab85a67-26be-4ed2-a0bb-101b2513ec63.kql
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// Azure Resource Graph Query | ||
// Find Database for PostgreSQL instances that are read replicas | ||
// Find Database for PostgreSQL instances that do not have read replicas | ||
resources | ||
| where type == "microsoft.dbforpostgresql/flexibleservers" | ||
| where properties.replicationRole == "AsyncReplica" | ||
| project recommendationId = "2ab85a67-26be-4ed2-a0bb-101b2513ec63", name, id, tags, param1 = strcat("replicationRole:", properties['replicationRole']) | ||
| where type == "microsoft.dbforpostgresql/flexibleservers" and properties.replicationRole == "AsyncReplica" | ||
| project replicaServerId = id, id = tostring(properties.sourceServerResourceId) | ||
| join kind=fullouter (resources | where type == "microsoft.dbforpostgresql/flexibleservers" and properties.replicationRole != "AsyncReplica") on id | ||
| where isempty(replicaServerId) | ||
| project recommendationId = "2ab85a67-26be-4ed2-a0bb-101b2513ec63", name, id = id1, tags, param1 = strcat("replicationRole:", properties['replicationRole']) |