Skip to content
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

Parameter naming consistency in Data Connector Azure for vnet and subnet ID's #100

Open
cerocool1203 opened this issue May 31, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@cerocool1203
Copy link

I was creating a Data connector in Azure and found a bit confusing the parameters requirements for vnet_id and subnet_id as they are not looking for the resources ID's instead looking for the vnet and subnet names respectively, looking at the code below (occm_azure.go lines 93-104)I can see the Resource ID string gets created based on the parameters provided.

if occmDetails.VnetResourceGroup != "" { registerAgentTOService.Placement.Network = fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", occmDetails.SubscriptionID, occmDetails.VnetResourceGroup, occmDetails.VnetID) } else { registerAgentTOService.Placement.Network = fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", occmDetails.SubscriptionID, occmDetails.ResourceGroup, occmDetails.VnetID) } registerAgentTOService.Placement.Subnet = fmt.Sprintf("%s/subnets/%s", registerAgentTOService.Placement.Network, occmDetails.SubnetID) userData, newClientID, err := c.getCustomData(registerAgentTOService, proxyCertificates, clientID) if err != nil { return OCCMMResult{}, err }

I can see there are two options

  1. Replace the parameters vnet_id and subnet_id for vnet_name and subnet_name to be consistent with the AzureRM provider.

  2. Provide vnet_id and subnet_id as the Resource ID's of the resources and removing the string manipulation to generate the Resource ID within the code. Provisioning infrastructure using terraform we can pass on this ID as part of the vnet and subnet creation as those attributes are exportable e.g. azurerm_virtual_network. However, that will mean a breaking change.
    Hope that provides some context

@lonico lonico added the enhancement New feature or request label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants