1. Packages
  2. OVH
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

OVH

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 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),
        };
    });
    
    import com.ovhcloud.pulumi.ovh.CloudProject.Kube;
    import com.ovhcloud.pulumi.ovh.CloudProject.KubeArgs;
    import com.ovhcloud.pulumi.ovh.CloudProject.KubeNodePool;
    import com.ovhcloud.pulumi.ovh.CloudProject.KubeNodePoolArgs;
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    
    
    /**
     * Minimal Pulumi example with Java SDK.
     */
    public class App {
    
        private final static String OVH_CLOUD_PROJECT_SERVICE = System.getenv("OVH_CLOUD_PROJECT_SERVICE");
    
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            KubeArgs kubeDetails = KubeArgs.builder()
                                            .serviceName(OVH_CLOUD_PROJECT_SERVICE)
                                            .name("pulumi-k8s")
                                            .region("GRA7")
                                        .build();
            Kube myKube = new Kube("my-kube", kubeDetails);
    
            KubeNodePoolArgs nodePoolDetails = KubeNodePoolArgs.builder()
                                                .serviceName(OVH_CLOUD_PROJECT_SERVICE)
                                                .flavorName("d2-4")
                                                .kubeId(myKube.id().asPlaintext())
                                                .minNodes(1)
                                                .maxNodes(1)
                                            .build();
    
            KubeNodePool nodePool = new KubeNodePool("pulumi-nodepool", nodePoolDetails);
            
            ctx.export("kubeconfig", myKube.kubeconfig());
        }
    }
    
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud