https://pulumi.com logo
Title
h

handsome-state-59775

09/03/2021, 9:25 AM
I'm unable to use the latest API version azure-natives network.PublicIPAddress like so:
pulumi_azure_native.network.PublicIPAddress
error: cannot check existence of resource '/subscriptions/.../providers/Microsoft.Network/publicIPAddresses/...': status code 400, {"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2020-11-01' is invalid. The supported versions are '2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}}
arm2pulumi suggests
v20200801
. Is it not possible to do this without specifying the API version explicitly?
t

tall-librarian-49374

09/03/2021, 9:28 AM
Oh, this is surprising. 2020-11-01 has been default since March, I’d expect somebody would hit this by now… Did Azure unpublish the API version?..
h

handsome-state-59775

09/03/2021, 9:39 AM
with v20200801:
error: Code="Failed" Message="The async operation failed." AdditionalInfo=[{"message":"No HTTP resource was found that matches the request URI '<https://management.azure.com/subscriptions/.../providers/Microsoft.Network/publicIPAddresses/iacazuresandbox-ingress-ip?api-version=2020-08-01>'."}]
with v20201101, same InvalidApiVersionParameter as without specifying API version
python code for reference:
import pulumi as p
import pulumi_azure_native as az
import pulumi_azure_native.network as net

def create_public_static_ingress_ip(
        resource_group: az.resources.ResourceGroup,
        resource_name: str,
        location: str,
        tags: Mapping[str, str],
) -> None:
    """Provisions a static IP for use with the cluster ingress."""
    api = net.v20201101

    public_static_ip = api.PublicIPAddress(
            resource_name=resource_name,
            resource_group_name=resource_group,
            public_ip_address_name=resource_name,
            location=location,
            public_ip_allocation_method=api.IPAllocationMethod.STATIC,
            sku=api.PublicIPAddressSkuArgs(
                    name=api.PublicIPAddressSkuName.STANDARD,
                    tier=api.PublicIPAddressSkuTier.GLOBAL_,
            ),
            ddos_settings=api.DdosSettingsArgs(
                    protected_ip=True,
                    protection_coverage=api.DdosSettingsProtectionCoverage(
                            value=api.DdosSettingsProtectionCoverage.STANDARD,
                    ),
            ),
            tags=tags,
            opts=p.ResourceOptions(
                    protect=True,
            ),
    )

    p.export('ingress-ip', public_static_ip)
pulumi-azure-native==1.25.0
pulumi==3.11.0
also, a lot of the more recent "supported versions" as listed in the error message are apparently not available via pulumi.
t

tall-librarian-49374

09/03/2021, 10:46 AM
I’ve just run https://github.com/pulumi/examples/tree/master/azure-py-webserver and it works perfectly well. Could you try it on your end?
👀 1