-
Notifications
You must be signed in to change notification settings - Fork 544
feat(azure-resources): Add Virtual Network Gateways and Connections #7636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(azure-resources): Add Virtual Network Gateways and Connections #7636
Conversation
This PR has the following changes to source plugin(s) tables:
|
| logger zerolog.Logger | ||
| registeredNamespaces map[string]map[string]bool | ||
| resourceGroups map[string][]*armresources.GenericResourceExpanded | ||
| resourceGroups map[string][]string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need the group names, no reason to keep the whole object
|
|
||
| func (c *Client) disocverResourceGroups(ctx context.Context) error { | ||
| c.resourceGroups = make(map[string][]*armresources.GenericResourceExpanded, len(c.subscriptions)) | ||
| filter := "resourceType eq 'Microsoft.Resources/resourceGroups'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query wasn't working (returned 0 results). There's a dedicated client to get the resource groups so I used that one
|
|
||
| func (c *Client) ID() string { | ||
| return c.SubscriptionId | ||
| if c.ResourceGroup != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follows the Azure convention, see
| const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` |
| client := meta.(*Client) | ||
| var c = make([]schema.ClientMeta, 0) | ||
| for _, subId := range client.subscriptions { | ||
| if _, ok := client.registeredNamespaces[subId][namespace]; ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept the logic as SubscriptionMultiplexRegisteredNamespace to skip non registered namespaces
| return err | ||
| } | ||
|
|
||
| pager := svc.NewListPager(cl.ResourceGroup, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here that we only pass the resource group unlike other resources that pass other parent's fields
| return err | ||
| } | ||
|
|
||
| pager := svc.NewListPager(cl.ResourceGroup, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See here that we only pass the resource group unlike other resources that pass other parent's fields
🤖 I have created a release *beep* *boop* --- ## [4.1.0](plugins-source-azure-v4.0.0...plugins-source-azure-v4.1.0) (2023-02-07) ### Features * **azure-resources:** Add Virtual Network Gateways and Connections ([#7636](#7636)) ([97a9254](97a9254)) ### Bug Fixes * **azure-resources:** Use default API version of `armhealthbot` bots client ([#7177](#7177)) ([e24af94](e24af94)) * **azure:** Fix Azure CIS Policies in Section 2 ([#7718](#7718)) ([3c77b2c](3c77b2c)) * **deps:** Update golang.org/x/exp digest to f062dba ([#7531](#7531)) ([59d5575](59d5575)) * **deps:** Update google.golang.org/genproto digest to 1c01626 ([#7533](#7533)) ([c549c27](c549c27)) * **deps:** Update module github.com/Azure/azure-sdk-for-go/sdk/azidentity to v1.2.1 ([#7540](#7540)) ([3b5c838](3b5c838)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.33.0 ([#7595](#7595)) ([c5adc75](c5adc75)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.33.1 ([#7614](#7614)) ([2fe665c](2fe665c)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.34.0 ([#7719](#7719)) ([6a33085](6a33085)) * **deps:** Update module github.com/golang-jwt/jwt/v4 to v4.4.3 ([#7543](#7543)) ([0607454](0607454)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
Fixes #7628.
Notes
cloudquery/plugins/source/azure/resources/services/appservice/web_app_vnet_connections.go
Line 30 in 8d97115