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

Support for Azure Bastion Developer SKU #23808

Closed
1 task done
vMarkusK opened this issue Nov 7, 2023 · 13 comments · Fixed by #26068
Closed
1 task done

Support for Azure Bastion Developer SKU #23808

vMarkusK opened this issue Nov 7, 2023 · 13 comments · Fixed by #26068
Labels
enhancement preview service/network upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR

Comments

@vMarkusK
Copy link

vMarkusK commented Nov 7, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Description

Azure Bastion Developer SKU is in Public Preview:
https://azure.microsoft.com/de-de/updates/azure-bastion-developer-public-preview/

Current Error:

│ Error: expected sku to be one of ["Basic" "Standard"], got Developer
│ 
│   with azurerm_bastion_host.mgmt-bastion,
│   on management.tf line 112, in resource "azurerm_bastion_host" "mgmt-bastion":
│  112:     sku                 = "Developer"
│ 

New or Affected Resource(s)/Data Source(s)

azurerm_bastion_host

Potential Terraform Configuration

resource "azurerm_bastion_host" "mgmt-bastion" {
    name                = "mgmt-bastion"
    location            = azurerm_resource_group.mgmt-rg.location
    resource_group_name = azurerm_resource_group.mgmt-rg.name
    sku                 = "Developer"


    ip_configuration {
        name                 = "configuration"
        subnet_id            = azurerm_subnet.mgmt-sn01.id
        public_ip_address_id = azurerm_public_ip.mgmt-bastion-pip
    }
}

References

No response

@mybayern1974 mybayern1974 added enhancement upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR labels Nov 8, 2023
@neil-yechenwei
Copy link
Contributor

Thanks for raising this issue. After checked, seems azure-rest-api-specs hasn't supported this new feature yet. Once it's supported, we will take another look. Thanks.

@michelkeus
Copy link

Thanks for raising this issue. After checked, seems azure-rest-api-specs hasn't supported this new feature yet. Once it's supported, we will take another look. Thanks.

Hi Neil, from what I can see now is that the Developer SKU is now part of the 2023-06-01 spec. Would be good to have this integrated into the Terraform Provider soon as Bastion is used by many developers.

@michelkeus
Copy link

@rcskosir @mybayern1974 @neil-yechenwei

Sorry for bumping this, was hoping this had already had some attention...

@neil-yechenwei
Copy link
Contributor

Sorry for late response. Though this new SKU is released to 2023-06-01 spec but this feature is still in preview. See more details from https://learn.microsoft.com/en-us/azure/bastion/quickstart-developer-sku.

@tfstateuk
Copy link

Hey, as it's been a few months since this post, was wondering if there's been any progress or update that can be made for this?

@michelkeus
Copy link

@tfstateuk - I did see that there was an announcement on internet that Bastion Developer had been GA'd (https://azure.microsoft.com/en-us/updates/general-availability-azure-bastion-developer-sku/) but it seems that the announcement has been pulled back.

Meanwhile I've gotten it to work and be deployable from Terraform by using "azurerm_resource_group_template_deployment" in conjunction with the ARM template that the portal spits out. This seems to work just as well.

Example:

resource "azurerm_resource_group_template_deployment" "BAST-EU-NE-TEST" {
  name = "BAST-EU-NE-TEST"
  resource_group_name = azurerm_resource_group.RG-EU-LAB-NE-BASTION.name
  deployment_mode = "Incremental"

 parameters_content = jsonencode({
        "location": {
            "value": "northeurope"
        },
        "resourceGroup": {
            "value": "RG-EU-LAB-NE-BASTION"
        },
        "bastionHostName": {
            "value": "Bastion01"
        },
        "bastionHostSku": {
            "value": "Developer"
        },
        "vnetId": {
            "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/RG-EU-LAB-NE-TEST/providers/Microsoft.Network/virtualNetworks/VNET"
        }
 })

 template_content = file("./templates/bastion.json")
}

The referenced json can be found here:

{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "type": "String"
        },
        "resourceGroup": {
            "type": "String"
        },
        "bastionHostName": {
            "type": "String"
        },
        "vnetId": {
            "type": "String"
        },
        "bastionHostSku": {
            "type": "String"
        }
    },
    "resources": [
        {
            "apiVersion": "2022-09-01",
            "type": "Microsoft.Network/bastionHosts",
            "name": "[parameters('bastionHostName')]",
            "sku": {
                "name": "[parameters('bastionHostSku')]"
            },
            "location": "[parameters('location')]",
            "dependsOn": [],
            "properties": {
                "virtualNetwork": {
                    "id": "[parameters('vnetId')]"
                }
            },
            "tags": {}
        }
    ]
}

This works for me to deploy Azure Bastion in the Developer SKU until we can get native support sorted. Hope this helps you and perhaps some of the others that might want to use it this way.

@tfstateuk
Copy link

Thank you, I'll give this a go!

@rwilc
Copy link

rwilc commented May 23, 2024

It looks like the API has been updated, the AzAPI provider references support for the Developer sku now - https://learn.microsoft.com/en-us/azure/templates/microsoft.network/bastionhosts?pivots=deployment-language-terraform#sku-2:~:text=string-,Sku,-Expand%20table

@tfstateuk
Copy link

I'm going to give it a test now and report back..I have it commented out in dev , so will report back

@tfstateuk
Copy link

sadly no success, maybe the API hasn't quite been updated just yet..however the arm template method referenced above is working fine

@tfstateuk
Copy link

So though this is Closed and classed as completed, still getting the error

│ Error: expected sku to be one of ["Basic" "Standard"], got Developer

│ with azurerm_bastion_host.mgmt-bastion,
│ on management.tf line 112, in resource "azurerm_bastion_host" "mgmt-bastion":
│ 112: sku = "Developer"

What are the next steps with getting this available now the API is updated?

@stephybun
Copy link
Member

@tfstateuk this will be available v3.106.0 of the provider which will be released at the end of this week.

@tfstateuk
Copy link

So the good news 3.106.0 is out, and the developer SKU is working as expected :)

Here's the expected code for those who are looking for it..

resource "azurerm_bastion_host" "bastionhost" {
location = azurerm_resource_group.hub-rg.location
name = "AzureBastionSubnet"
resource_group_name = azurerm_resource_group.hub-rg.name
sku = "Developer"
virtual_network_id = azurerm_virtual_network.hub-vnet.id
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement preview service/network upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants