Skip to content

Commit ba8036e

Browse files
authored
Merge pull request #80 from cloudgraphdev/feat/EP-3227
feat: Added missing subnets ids and endpoint policies for subnets
2 parents aaaf8b7 + baa0a6e commit ba8036e

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/services/virtualNetwork/format.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ export default ({
2525
enableVmProtection,
2626
resourceGroupId,
2727
Tags,
28+
subnets = []
2829
} = service
30+
const subnetsIds = []
31+
const serviceEndpointPoliciesIds = []
32+
33+
subnets.forEach(s => {
34+
const { id, serviceEndpointPolicies = [] } = s
35+
subnetsIds.push(id)
36+
serviceEndpointPoliciesIds.push(...serviceEndpointPolicies.map(p => p.id))
37+
})
38+
2939
return {
3040
id,
3141
name,
@@ -55,6 +65,8 @@ export default ({
5565
provisioningState,
5666
resourceGuid,
5767
resourceGroupId,
68+
subnetsIds,
69+
serviceEndpointPoliciesIds,
5870
tags: formatTagsFromMap(Tags),
5971
}
6072
}

src/services/virtualNetwork/schema.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type azureVirtualNetwork implements azureResource
2222
flowTimeoutInMinutes: Int @search
2323
provisioningState: String @search(by: [hash, regexp])
2424
resourceGuid: String @search(by: [hash, regexp])
25+
subnetsIds: [String] @search(by: [hash])
26+
serviceEndpointPoliciesIds: [String] @search(by: [hash])
2527
appServiceEnvironments: [azureAppServiceEnvironment] @hasInverse(field: virtualNetwork)
2628
firewalls: [azureFirewall] @hasInverse(field: virtualNetworks)
2729
lbVirtualNetworkOf: [azureLoadBalancer] @hasInverse(field: loadBalancerBackendVirtualNetworks)

src/types/generated.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6384,6 +6384,8 @@ export type AzureVirtualNetwork = AzureResource & {
63846384
provisioningState?: Maybe<Scalars['String']>;
63856385
resourceGroup?: Maybe<Array<Maybe<AzureResourceGroup>>>;
63866386
resourceGuid?: Maybe<Scalars['String']>;
6387+
serviceEndpointPoliciesIds?: Maybe<Array<Maybe<Scalars['String']>>>;
6388+
subnetsIds?: Maybe<Array<Maybe<Scalars['String']>>>;
63876389
virtualMachines?: Maybe<Array<Maybe<AzureVirtualMachine>>>;
63886390
};
63896391

0 commit comments

Comments
 (0)