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

Use Standard IP SKU by default for edge case with private_virtual_network_with_public_ip field #469

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

JenGoldstrich
Copy link
Contributor

@JenGoldstrich JenGoldstrich commented Feb 21, 2025

This PR fixes an issue raised where the private_virtual_network_with_public_ip field that allows users to bring their own vnet, and have the plugin create a public IP, subnet.

This is a breaking change, as the default behavior for this for this field will change, but on March 31st 2025 https://azure.microsoft.com/en-us/updates?id=upgrade-to-standard-sku-public-ip-addresses-in-azure-by-30-september-2025-basic-sku-will-be-retired Azure is removing the ability to create these IPs, so we don't have much of a choice but to make a breaking change, users can roll back by setting the public_ip_sku field to basic, if they want to use the newest plugin version, but still create basic IP skus.

Following up we should address this issue #468, which basically requests having the plugin creates the Network Security Group (NSG). But I didn't wanna delay rolling out this fix in the mean time.

The requestor had a good suggestion in the other linked issue to assign it at the NIC level, doing some reading I've learned that this can have some unexpected side effects as the NIC NSG can conflict with the Subnet NSG. The default behavior should be to encourage users to create their own NSGs in this situation, since they're managing their own vnet, but we should add support for creating an NSG at the NIC level, for users who do not want to create this security group (or those that do not know their build machine's IP ahead of time, and want to explicitly only allow that build VM)

Closes #458

@JenGoldstrich JenGoldstrich requested a review from a team as a code owner February 21, 2025 05:48
@@ -302,7 +302,18 @@ func GetVirtualMachineTemplateBuilder(config *Config) (*template.TemplateBuilder
}
}

if config.VirtualNetworkName != "" && DefaultPrivateVirtualNetworkWithPublicIp != config.PrivateVirtualNetworkWithPublicIp {
// Standard is the default, basic will no longer be supported in the future
if config.PublicIpSKU != "Basic" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We no longer need to check the vnet or private IP status here, because we simply moved the public IP sku block up above the check that removes the public IP. So if the public IP shouldn't be here we remove it when we call builder.SetVirtualNetwork

@JenGoldstrich JenGoldstrich merged commit 1270ae1 into main Feb 22, 2025
12 checks passed
@JenGoldstrich JenGoldstrich deleted the vnet_with_public_ip_basic_sku branch February 22, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AzureRM Builder: private_virtual_network_with_public_ip assigns a Basic SKU Public IP
2 participants