1. Packages
  2. OVH
OVHCloud v0.36.1 published on Wednesday, Jan 10, 2024 by OVHcloud

OVH

ovh logo
OVHCloud v0.36.1 published on Wednesday, Jan 10, 2024 by OVHcloud

    The OVH provider for Pulumi can be used to provision any of the resources available in OVHcloud. The OVH provider must be configured with credentials to deploy and update resources in OVH.

    Information

    Note that the lbrlabs Pulumi OVH provider is replaced by this official one. See the Migration Guide for more information.

    Example

    // Deploy a new Kubernetes cluster
    myKube, err := cloudproject.NewKube(ctx, "my_desired_cluster", &cloudproject.KubeArgs{
        ServiceName: pulumi.String("xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxx"),
        Name:        pulumi.String("my_desired_cluster"),
        Region:      pulumi.String("GRA5"),
    })
    if err != nil {
        return err
    }
    
    // Export kubeconfig file to a secret
    ctx.Export("kubeconfig", pulumi.ToSecret(myKube.Kubeconfig))
    
    """Get a Kubernetes cluster version"""
    import pulumi
    import pulumi_ovh as ovh
    
    config = pulumi.Config();
    service_name = config.require('serviceName')
    
    print(service_name);
    
    my_kube_cluster = ovh.cloudproject.get_kube(service_name=service_name,
        kube_id="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx");
    pulumi.export("version", my_kube_cluster.version)
    
    import * as pulumi from "@pulumi/pulumi";
    
    import * as ovh from "@ovh-devrelteam/pulumi-ovh"
    
    let config = new pulumi.Config();
    let serviceName = config.require("serviceName")
    
    console.log(serviceName)
    
    // Get a Kubernetes cluster version
    let myKubeCluster = ovh.cloudproject.getKube({
        serviceName: serviceName,
        kubeId: "xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
    }) 
    
    export const version = myKubeCluster.then(myKubeCluster => myKubeCluster.version);
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    using System;
    
    return await Deployment.RunAsync(() => 
    {
    
        var config = new Pulumi.Config();
        var serviceName = config.Require("serviceName");
    
        System.Console.WriteLine(serviceName);
    
        var myKubeCluster = Ovh.CloudProject.GetKube.Invoke(new()
        {
            ServiceName = serviceName,
            KubeId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
        });
    
        return new Dictionary<string, object?>
        {
            ["version"] = myKubeCluster.Apply(getKubeResult => getKubeResult.Version),
        };
    });
    
    ovh logo
    OVHCloud v0.36.1 published on Wednesday, Jan 10, 2024 by OVHcloud