pulumi / pulumi-openstack

An OpenStack Pulumi resource package, providing multi-language access to OpenStack
Apache License 2.0
55 stars 8 forks source link

Incorrect mappings for Loadbalancing and BGP VPN resources #690

Open ederst opened 1 month ago

ederst commented 1 month ago

Describe what happened

After upgrading to pulumi-openstack v5.0.0 loadbalancer.Loadbalancer is not available anymore. Instead the resource seems to have been replaced with LbLoadbalancerV2. The crux here is that this resource is mapped at index and not in the loadbalancer module/package - like for example loadbalancer.L7PolicyV2.

This seems to be true for multiple resources - see "Affected Resource(s)".

To fix this, the resources need a proper mapping in resources.go. For example like this, I guess:

"openstack_lb_loadbalancer_v2": {
    Tok: openstackResource(lbMod, "LoadbalancerV2"),
    Docs: &tfbridge.DocInfo{
        AllowMissing: true,
    },
},

Sample program

import pulumi_openstack as openstack

openstack.loadbalancer.Loadbalancer(...) # does not work anymore
openstack.LbLoadbalancerV2(...) # works

Log output

No response

Affected Resource(s)

openstack.LbLoadbalancerV2
openstack.LbFlavorprofileV2
openstack.BgpvpnV2
openstack.BgpvpnNetworkAssociateV2
openstack.BgpvpnPortAssociateV2
openstack.BgpvpnRouterAssociateV2

Output of pulumi about

Running /$HOME/.pulumi/3.135.0/pulumi/pulumi about
CLI
Version      3.135.0
Go Version   go1.23.1
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  aws         6.54.1
resource  kubernetes  4.18.1
resource  openstack   5.0.0
language  python      unknown
resource  random      4.16.5
resource  tls         5.0.7

Host
OS       darwin
Version  15.0
Arch     arm64

This project is written in python: executable='$PROJECT_DIR/.venv/bin/python' version='3.12.6'

Current Stack: $ORGA/$PROJECT/test

TYPE                                       URN
$RESOURCES

Found no pending operations associated with test

Backend
Name           https://$PULUMI_BACKEND_URL
URL            https://$PULUMI_BACKEND_URL/Stefan-Prietl
User           Stefan-Prietl
Organizations  Stefan-Prietl, $ORGAS
Token type     personal

Dependencies:
NAME                 VERSION
annotated-types      0.7.0
ansible-core         2.17.4
pip                  24.0
pre-commit           3.8.0
pydantic_core        2.23.4
pyright              1.1.381
pytest-cov           5.0.0
rope                 1.13.0
ruff                 0.6.7
ruyaml               0.91.0
typer                0.12.5
yamllint             1.35.1

Pulumi locates its logs in /var/folders/5b/dd8bgp9178s13b8bm4g7vhs40000gn/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

VenelinMartinov commented 1 month ago

Thanks for reporting @ederst and sorry for the inconvenience, I've raised a PR to fix this: Use automatic module mappings in Openstack provider #692

It also automates this for future resources, so we should not see this again.

VenelinMartinov commented 4 weeks ago

Ran into some issues with the PR, will try to resolve them early next week, sorry for the delay.

ederst commented 2 weeks ago

Ran into some issues with the PR, will try to resolve them early next week, sorry for the delay.

Nothing to worry about, we currently use the Loadbalancer resource mapped at index and it works just fine.