ovh/pulumi-ovh

lbrlabs migration guide, how to replace DomainZoneRecord and CloudProjectUser

Closed this issue · 4 comments

Hi.

We are planing to replace the lbrlabs legacy provider by this ovh provider.

We followed this guide: https://github.com/ovh/pulumi-ovh/blob/main/docs/how-to-guides/migration-from-lbrlabs-package.md

But we got this error:

AttributeError: module 'pulumi_ovh' has no attribute 'DomainZoneRecord'

The function which is raising this exception:

def register_ovh_domain(record_name, environment, instance_ip, root_dns_zone):
    dns_zone = "{}.{}".format(environment, root_dns_zone)
    sub_domain = "{}.{}".format(record_name, environment)
    log_msg("INFO", "[register_domain][ovh] register domain {}.{}".format(record_name, dns_zone))
    ovh.DomainZoneRecord(sub_domain,
        fieldtype = "A",
        subdomain = sub_domain,
        target = instance_ip,
        ttl = 3600,
        zone = root_dns_zone)

DomainZoneRecord did exists on the lbrlabs provider: https://github.com/lbrlabs/pulumi-ovh/blob/839a4bf77e56f48fb5942e8ea44aa4df93e63472/sdk/python/lbrlabs_ovh/domain_zone_record.py#L187

What is the replacement for this instruction ?

Same question for this instruction:

user = ovh.CloudProjectUser(hashed_bucket_name, service_name = service_name, description = hashed_bucket_name, role_name = "objectstore_operator")

Thanks in advance.

In order to add a bit of context, we're using a driver for cwcloud1 which is using both the OpenStack and lbrlabs ovh provider.

And the idea is to first replace completely the lbrlabs provider which is deprecated from by its official successor, then if possible stop combining two providers but make a complete rewrite of our driver only using this provider which looks great.

Footnotes

  1. a platform which provide a Deploymant as a service API, we presented-it here

Hi.

So we succeed to migrate replacing ovh.DomainZoneRecord by ovh.domain.ZoneRecord :)

I've opened this pull request to add this to the migration guide here: #228

Thanks

Fixed with the merge of #228

Thanks @scraly

My pleasure :)
And now with version 0.50 you have the first bricks of KMS product and more to come ;).