Ovh

v0.0.4 published on Saturday, Sep 17, 2022 by lbrlabs

CloudProject

Orders a public cloud project.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Ovh = Lbrlabs.PulumiPackage.Ovh;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var mycart = Ovh.GetOrderCart.Invoke(new()
    {
        OvhSubsidiary = "fr",
        Description = "my cloud order cart",
    });

    var cloudOrderCartProductPlan = Ovh.GetOrderCartProductPlan.Invoke(new()
    {
        CartId = mycart.Apply(getOrderCartResult => getOrderCartResult.Id),
        PriceCapacity = "renew",
        Product = "cloud",
        PlanCode = "project.2018",
    });

    var cloudCloudProject = new Ovh.CloudProject("cloudCloudProject", new()
    {
        OvhSubsidiary = mycart.Apply(getOrderCartResult => getOrderCartResult.OvhSubsidiary),
        Description = "my cloud project",
        PaymentMean = "fidelity",
        Plan = new Ovh.Inputs.CloudProjectPlanArgs
        {
            Duration = cloudOrderCartProductPlan.Apply(getOrderCartProductPlanResult => getOrderCartProductPlanResult.SelectedPrices[0]?.Duration),
            PlanCode = cloudOrderCartProductPlan.Apply(getOrderCartProductPlanResult => getOrderCartProductPlanResult.PlanCode),
            PricingMode = cloudOrderCartProductPlan.Apply(getOrderCartProductPlanResult => getOrderCartProductPlanResult.SelectedPrices[0]?.PricingMode),
        },
    });

});
package main

import (
	"github.com/lbrlabs/pulumi-ovh/sdk/go/ovh"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		mycart, err := ovh.GetOrderCart(ctx, &GetOrderCartArgs{
			OvhSubsidiary: "fr",
			Description:   pulumi.StringRef("my cloud order cart"),
		}, nil)
		if err != nil {
			return err
		}
		cloudOrderCartProductPlan, err := ovh.GetOrderCartProductPlan(ctx, &GetOrderCartProductPlanArgs{
			CartId:        mycart.Id,
			PriceCapacity: "renew",
			Product:       "cloud",
			PlanCode:      "project.2018",
		}, nil)
		if err != nil {
			return err
		}
		_, err = ovh.NewCloudProject(ctx, "cloudCloudProject", &ovh.CloudProjectArgs{
			OvhSubsidiary: pulumi.String(mycart.OvhSubsidiary),
			Description:   pulumi.String("my cloud project"),
			PaymentMean:   pulumi.String("fidelity"),
			Plan: &CloudProjectPlanArgs{
				Duration:    pulumi.String(cloudOrderCartProductPlan.SelectedPrices[0].Duration),
				PlanCode:    pulumi.String(cloudOrderCartProductPlan.PlanCode),
				PricingMode: pulumi.String(cloudOrderCartProductPlan.SelectedPrices[0].PricingMode),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.OvhFunctions;
import com.pulumi.ovh.inputs.GetOrderCartArgs;
import com.pulumi.ovh.inputs.GetOrderCartProductPlanArgs;
import com.pulumi.ovh.CloudProject;
import com.pulumi.ovh.CloudProjectArgs;
import com.pulumi.ovh.inputs.CloudProjectPlanArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var mycart = OvhFunctions.getOrderCart(GetOrderCartArgs.builder()
            .ovhSubsidiary("fr")
            .description("my cloud order cart")
            .build());

        final var cloudOrderCartProductPlan = OvhFunctions.getOrderCartProductPlan(GetOrderCartProductPlanArgs.builder()
            .cartId(mycart.applyValue(getOrderCartResult -> getOrderCartResult.id()))
            .priceCapacity("renew")
            .product("cloud")
            .planCode("project.2018")
            .build());

        var cloudCloudProject = new CloudProject("cloudCloudProject", CloudProjectArgs.builder()        
            .ovhSubsidiary(mycart.applyValue(getOrderCartResult -> getOrderCartResult.ovhSubsidiary()))
            .description("my cloud project")
            .paymentMean("fidelity")
            .plan(CloudProjectPlanArgs.builder()
                .duration(cloudOrderCartProductPlan.applyValue(getOrderCartProductPlanResult -> getOrderCartProductPlanResult.selectedPrices()[0].duration()))
                .planCode(cloudOrderCartProductPlan.applyValue(getOrderCartProductPlanResult -> getOrderCartProductPlanResult.planCode()))
                .pricingMode(cloudOrderCartProductPlan.applyValue(getOrderCartProductPlanResult -> getOrderCartProductPlanResult.selectedPrices()[0].pricingMode()))
                .build())
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_ovh as ovh
import pulumi_ovh as ovh

mycart = ovh.get_order_cart(ovh_subsidiary="fr",
    description="my cloud order cart")
cloud_order_cart_product_plan = ovh.get_order_cart_product_plan(cart_id=mycart.id,
    price_capacity="renew",
    product="cloud",
    plan_code="project.2018")
cloud_cloud_project = ovh.CloudProject("cloudCloudProject",
    ovh_subsidiary=mycart.ovh_subsidiary,
    description="my cloud project",
    payment_mean="fidelity",
    plan=ovh.CloudProjectPlanArgs(
        duration=cloud_order_cart_product_plan.selected_prices[0].duration,
        plan_code=cloud_order_cart_product_plan.plan_code,
        pricing_mode=cloud_order_cart_product_plan.selected_prices[0].pricing_mode,
    ))
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@lbrlabs/pulumi-ovh";
import * as ovh from "@pulumi/ovh";

const mycart = ovh.getOrderCart({
    ovhSubsidiary: "fr",
    description: "my cloud order cart",
});
const cloudOrderCartProductPlan = mycart.then(mycart => ovh.getOrderCartProductPlan({
    cartId: mycart.id,
    priceCapacity: "renew",
    product: "cloud",
    planCode: "project.2018",
}));
const cloudCloudProject = new ovh.CloudProject("cloudCloudProject", {
    ovhSubsidiary: mycart.then(mycart => mycart.ovhSubsidiary),
    description: "my cloud project",
    paymentMean: "fidelity",
    plan: {
        duration: cloudOrderCartProductPlan.then(cloudOrderCartProductPlan => cloudOrderCartProductPlan.selectedPrices?[0]?.duration),
        planCode: cloudOrderCartProductPlan.then(cloudOrderCartProductPlan => cloudOrderCartProductPlan.planCode),
        pricingMode: cloudOrderCartProductPlan.then(cloudOrderCartProductPlan => cloudOrderCartProductPlan.selectedPrices?[0]?.pricingMode),
    },
});
resources:
  cloudCloudProject:
    type: ovh:CloudProject
    properties:
      ovhSubsidiary: ${mycart.ovhSubsidiary}
      description: my cloud project
      paymentMean: fidelity
      plan:
        duration: ${cloudOrderCartProductPlan.selectedPrices[0].duration}
        planCode: ${cloudOrderCartProductPlan.planCode}
        pricingMode: ${cloudOrderCartProductPlan.selectedPrices[0].pricingMode}
variables:
  mycart:
    Fn::Invoke:
      Function: ovh:getOrderCart
      Arguments:
        ovhSubsidiary: fr
        description: my cloud order cart
  cloudOrderCartProductPlan:
    Fn::Invoke:
      Function: ovh:getOrderCartProductPlan
      Arguments:
        cartId: ${mycart.id}
        priceCapacity: renew
        product: cloud
        planCode: project.2018

Create a CloudProject Resource

new CloudProject(name: string, args: CloudProjectArgs, opts?: CustomResourceOptions);
@overload
def CloudProject(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 description: Optional[str] = None,
                 ovh_subsidiary: Optional[str] = None,
                 payment_mean: Optional[str] = None,
                 plan: Optional[CloudProjectPlanArgs] = None,
                 plan_options: Optional[Sequence[CloudProjectPlanOptionArgs]] = None)
@overload
def CloudProject(resource_name: str,
                 args: CloudProjectArgs,
                 opts: Optional[ResourceOptions] = None)
func NewCloudProject(ctx *Context, name string, args CloudProjectArgs, opts ...ResourceOption) (*CloudProject, error)
public CloudProject(string name, CloudProjectArgs args, CustomResourceOptions? opts = null)
public CloudProject(String name, CloudProjectArgs args)
public CloudProject(String name, CloudProjectArgs args, CustomResourceOptions options)
type: ovh:CloudProject
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CloudProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CloudProjectArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CloudProjectArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CloudProjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CloudProjectArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CloudProject Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CloudProject resource accepts the following input properties:

OvhSubsidiary string

Ovh Subsidiary

PaymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

Plan Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanArgs

Product Plan to order

Description string

A description associated with the user.

PlanOptions List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanOptionArgs>

Product Plan to order

OvhSubsidiary string

Ovh Subsidiary

PaymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

Plan CloudProjectPlanArgs

Product Plan to order

Description string

A description associated with the user.

PlanOptions []CloudProjectPlanOptionArgs

Product Plan to order

ovhSubsidiary String

Ovh Subsidiary

paymentMean String

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

description String

A description associated with the user.

planOptions List<CloudProjectPlanOptionArgs>

Product Plan to order

ovhSubsidiary string

Ovh Subsidiary

paymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

description string

A description associated with the user.

planOptions CloudProjectPlanOptionArgs[]

Product Plan to order

ovh_subsidiary str

Ovh Subsidiary

payment_mean str

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

description str

A description associated with the user.

plan_options Sequence[CloudProjectPlanOptionArgs]

Product Plan to order

ovhSubsidiary String

Ovh Subsidiary

paymentMean String

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan Property Map

Product Plan to order

description String

A description associated with the user.

planOptions List<Property Map>

Product Plan to order

Outputs

All input properties are implicitly available as output properties. Additionally, the CloudProject resource produces the following output properties:

Access string

project access

Id string

The provider-assigned unique ID for this managed resource.

Orders List<Lbrlabs.PulumiPackage.Ovh.Outputs.CloudProjectOrder>

Details about an Order

ProjectId string

openstack project id

ProjectName string

openstack project name

Status string

project status

Access string

project access

Id string

The provider-assigned unique ID for this managed resource.

Orders []CloudProjectOrder

Details about an Order

ProjectId string

openstack project id

ProjectName string

openstack project name

Status string

project status

access String

project access

id String

The provider-assigned unique ID for this managed resource.

orders List<CloudProjectOrder>

Details about an Order

projectId String

openstack project id

projectName String

openstack project name

status String

project status

access string

project access

id string

The provider-assigned unique ID for this managed resource.

orders CloudProjectOrder[]

Details about an Order

projectId string

openstack project id

projectName string

openstack project name

status string

project status

access str

project access

id str

The provider-assigned unique ID for this managed resource.

orders Sequence[CloudProjectOrder]

Details about an Order

project_id str

openstack project id

project_name str

openstack project name

status str

project status

access String

project access

id String

The provider-assigned unique ID for this managed resource.

orders List<Property Map>

Details about an Order

projectId String

openstack project id

projectName String

openstack project name

status String

project status

Look up an Existing CloudProject Resource

Get an existing CloudProject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CloudProjectState, opts?: CustomResourceOptions): CloudProject
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access: Optional[str] = None,
        description: Optional[str] = None,
        orders: Optional[Sequence[CloudProjectOrderArgs]] = None,
        ovh_subsidiary: Optional[str] = None,
        payment_mean: Optional[str] = None,
        plan: Optional[CloudProjectPlanArgs] = None,
        plan_options: Optional[Sequence[CloudProjectPlanOptionArgs]] = None,
        project_id: Optional[str] = None,
        project_name: Optional[str] = None,
        status: Optional[str] = None) -> CloudProject
func GetCloudProject(ctx *Context, name string, id IDInput, state *CloudProjectState, opts ...ResourceOption) (*CloudProject, error)
public static CloudProject Get(string name, Input<string> id, CloudProjectState? state, CustomResourceOptions? opts = null)
public static CloudProject get(String name, Output<String> id, CloudProjectState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Access string

project access

Description string

A description associated with the user.

Orders List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectOrderArgs>

Details about an Order

OvhSubsidiary string

Ovh Subsidiary

PaymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

Plan Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanArgs

Product Plan to order

PlanOptions List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanOptionArgs>

Product Plan to order

ProjectId string

openstack project id

ProjectName string

openstack project name

Status string

project status

Access string

project access

Description string

A description associated with the user.

Orders []CloudProjectOrderArgs

Details about an Order

OvhSubsidiary string

Ovh Subsidiary

PaymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

Plan CloudProjectPlanArgs

Product Plan to order

PlanOptions []CloudProjectPlanOptionArgs

Product Plan to order

ProjectId string

openstack project id

ProjectName string

openstack project name

Status string

project status

access String

project access

description String

A description associated with the user.

orders List<CloudProjectOrderArgs>

Details about an Order

ovhSubsidiary String

Ovh Subsidiary

paymentMean String

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

planOptions List<CloudProjectPlanOptionArgs>

Product Plan to order

projectId String

openstack project id

projectName String

openstack project name

status String

project status

access string

project access

description string

A description associated with the user.

orders CloudProjectOrderArgs[]

Details about an Order

ovhSubsidiary string

Ovh Subsidiary

paymentMean string

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

planOptions CloudProjectPlanOptionArgs[]

Product Plan to order

projectId string

openstack project id

projectName string

openstack project name

status string

project status

access str

project access

description str

A description associated with the user.

orders Sequence[CloudProjectOrderArgs]

Details about an Order

ovh_subsidiary str

Ovh Subsidiary

payment_mean str

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan CloudProjectPlanArgs

Product Plan to order

plan_options Sequence[CloudProjectPlanOptionArgs]

Product Plan to order

project_id str

openstack project id

project_name str

openstack project name

status str

project status

access String

project access

description String

A description associated with the user.

orders List<Property Map>

Details about an Order

ovhSubsidiary String

Ovh Subsidiary

paymentMean String

Ovh payment mode (One of "default-payment-mean", "fidelity", "ovh-account")

plan Property Map

Product Plan to order

planOptions List<Property Map>

Product Plan to order

projectId String

openstack project id

projectName String

openstack project name

status String

project status

Supporting Types

CloudProjectOrder

Date string

date

Details List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectOrderDetail>

Information about a Bill entry

ExpirationDate string

expiration date

OrderId int

order id

Date string

date

Details []CloudProjectOrderDetail

Information about a Bill entry

ExpirationDate string

expiration date

OrderId int

order id

date String

date

details List<CloudProjectOrderDetail>

Information about a Bill entry

expirationDate String

expiration date

orderId Integer

order id

date string

date

details CloudProjectOrderDetail[]

Information about a Bill entry

expirationDate string

expiration date

orderId number

order id

date str

date

details Sequence[CloudProjectOrderDetail]

Information about a Bill entry

expiration_date str

expiration date

order_id int

order id

date String

date

details List<Property Map>

Information about a Bill entry

expirationDate String

expiration date

orderId Number

order id

CloudProjectOrderDetail

Description string

A description associated with the user.

Domain string

expiration date

OrderDetailId int

order detail id

Quantity string

quantity

Description string

A description associated with the user.

Domain string

expiration date

OrderDetailId int

order detail id

Quantity string

quantity

description String

A description associated with the user.

domain String

expiration date

orderDetailId Integer

order detail id

quantity String

quantity

description string

A description associated with the user.

domain string

expiration date

orderDetailId number

order detail id

quantity string

quantity

description str

A description associated with the user.

domain str

expiration date

order_detail_id int

order detail id

quantity str

quantity

description String

A description associated with the user.

domain String

expiration date

orderDetailId Number

order detail id

quantity String

quantity

CloudProjectPlan

Duration string

duration

PlanCode string

Plan code

PricingMode string

Pricing model identifier

CatalogName string

Catalog name

Configurations List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanConfiguration>

Representation of a configuration item for personalizing product

Duration string

duration

PlanCode string

Plan code

PricingMode string

Pricing model identifier

CatalogName string

Catalog name

Configurations []CloudProjectPlanConfiguration

Representation of a configuration item for personalizing product

duration String

duration

planCode String

Plan code

pricingMode String

Pricing model identifier

catalogName String

Catalog name

configurations List<CloudProjectPlanConfiguration>

Representation of a configuration item for personalizing product

duration string

duration

planCode string

Plan code

pricingMode string

Pricing model identifier

catalogName string

Catalog name

configurations CloudProjectPlanConfiguration[]

Representation of a configuration item for personalizing product

duration str

duration

plan_code str

Plan code

pricing_mode str

Pricing model identifier

catalog_name str

Catalog name

configurations Sequence[CloudProjectPlanConfiguration]

Representation of a configuration item for personalizing product

duration String

duration

planCode String

Plan code

pricingMode String

Pricing model identifier

catalogName String

Catalog name

configurations List<Property Map>

Representation of a configuration item for personalizing product

CloudProjectPlanConfiguration

Label string

Identifier of the resource

Value string

Path to the resource in API.OVH.COM

Label string

Identifier of the resource

Value string

Path to the resource in API.OVH.COM

label String

Identifier of the resource

value String

Path to the resource in API.OVH.COM

label string

Identifier of the resource

value string

Path to the resource in API.OVH.COM

label str

Identifier of the resource

value str

Path to the resource in API.OVH.COM

label String

Identifier of the resource

value String

Path to the resource in API.OVH.COM

CloudProjectPlanOption

Duration string

duration

PlanCode string

Plan code

PricingMode string

Pricing model identifier

CatalogName string

Catalog name

Configurations List<Lbrlabs.PulumiPackage.Ovh.Inputs.CloudProjectPlanOptionConfiguration>

Representation of a configuration item for personalizing product

Duration string

duration

PlanCode string

Plan code

PricingMode string

Pricing model identifier

CatalogName string

Catalog name

Configurations []CloudProjectPlanOptionConfiguration

Representation of a configuration item for personalizing product

duration String

duration

planCode String

Plan code

pricingMode String

Pricing model identifier

catalogName String

Catalog name

configurations List<CloudProjectPlanOptionConfiguration>

Representation of a configuration item for personalizing product

duration string

duration

planCode string

Plan code

pricingMode string

Pricing model identifier

catalogName string

Catalog name

configurations CloudProjectPlanOptionConfiguration[]

Representation of a configuration item for personalizing product

duration str

duration

plan_code str

Plan code

pricing_mode str

Pricing model identifier

catalog_name str

Catalog name

configurations Sequence[CloudProjectPlanOptionConfiguration]

Representation of a configuration item for personalizing product

duration String

duration

planCode String

Plan code

pricingMode String

Pricing model identifier

catalogName String

Catalog name

configurations List<Property Map>

Representation of a configuration item for personalizing product

CloudProjectPlanOptionConfiguration

Label string

Identifier of the resource

Value string

Path to the resource in API.OVH.COM

Label string

Identifier of the resource

Value string

Path to the resource in API.OVH.COM

label String

Identifier of the resource

value String

Path to the resource in API.OVH.COM

label string

Identifier of the resource

value string

Path to the resource in API.OVH.COM

label str

Identifier of the resource

value str

Path to the resource in API.OVH.COM

label String

Identifier of the resource

value String

Path to the resource in API.OVH.COM

Import

ant

This resource is in beta state. Use with caution.

Package Details

Repository
https://github.com/lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.