1. Packages
  2. OVH
  3. API Docs
  4. SavingsPlan
  5. SavingsPlan
OVHCloud v1.6.0 published on Monday, Feb 10, 2025 by OVHcloud

ovh.SavingsPlan.SavingsPlan

Explore with Pulumi AI

ovh logo
OVHCloud v1.6.0 published on Monday, Feb 10, 2025 by OVHcloud

    Create and manage an OVHcloud Savings Plan

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const plan = new ovh.savingsplan.SavingsPlan("plan", {
        autoRenewal: true,
        displayName: "one_month_rancher_savings_plan",
        flavor: "Rancher",
        period: "P1M",
        serviceName: "<public cloud project ID>",
        size: 2,
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    plan = ovh.savings_plan.SavingsPlan("plan",
        auto_renewal=True,
        display_name="one_month_rancher_savings_plan",
        flavor="Rancher",
        period="P1M",
        service_name="<public cloud project ID>",
        size=2)
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/savingsplan"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := savingsplan.NewSavingsPlan(ctx, "plan", &savingsplan.SavingsPlanArgs{
    			AutoRenewal: pulumi.Bool(true),
    			DisplayName: pulumi.String("one_month_rancher_savings_plan"),
    			Flavor:      pulumi.String("Rancher"),
    			Period:      pulumi.String("P1M"),
    			ServiceName: pulumi.String("<public cloud project ID>"),
    			Size:        pulumi.Int(2),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var plan = new Ovh.SavingsPlan.SavingsPlan("plan", new()
        {
            AutoRenewal = true,
            DisplayName = "one_month_rancher_savings_plan",
            Flavor = "Rancher",
            Period = "P1M",
            ServiceName = "<public cloud project ID>",
            Size = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.SavingsPlan.SavingsPlan;
    import com.pulumi.ovh.SavingsPlan.SavingsPlanArgs;
    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) {
            var plan = new SavingsPlan("plan", SavingsPlanArgs.builder()
                .autoRenewal(true)
                .displayName("one_month_rancher_savings_plan")
                .flavor("Rancher")
                .period("P1M")
                .serviceName("<public cloud project ID>")
                .size(2)
                .build());
    
        }
    }
    
    resources:
      plan:
        type: ovh:SavingsPlan:SavingsPlan
        properties:
          autoRenewal: true
          displayName: one_month_rancher_savings_plan
          flavor: Rancher
          period: P1M
          serviceName: <public cloud project ID>
          size: 2
    

    Create SavingsPlan Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SavingsPlan(name: string, args: SavingsPlanArgs, opts?: CustomResourceOptions);
    @overload
    def SavingsPlan(resource_name: str,
                    args: SavingsPlanArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SavingsPlan(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    display_name: Optional[str] = None,
                    flavor: Optional[str] = None,
                    period: Optional[str] = None,
                    service_name: Optional[str] = None,
                    size: Optional[int] = None,
                    auto_renewal: Optional[bool] = None)
    func NewSavingsPlan(ctx *Context, name string, args SavingsPlanArgs, opts ...ResourceOption) (*SavingsPlan, error)
    public SavingsPlan(string name, SavingsPlanArgs args, CustomResourceOptions? opts = null)
    public SavingsPlan(String name, SavingsPlanArgs args)
    public SavingsPlan(String name, SavingsPlanArgs args, CustomResourceOptions options)
    
    type: ovh:SavingsPlan:SavingsPlan
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SavingsPlanArgs
    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 SavingsPlanArgs
    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 SavingsPlanArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SavingsPlanArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SavingsPlanArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var savingsPlanResource = new Ovh.SavingsPlan.SavingsPlan("savingsPlanResource", new()
    {
        DisplayName = "string",
        Flavor = "string",
        Period = "string",
        ServiceName = "string",
        Size = 0,
        AutoRenewal = false,
    });
    
    example, err := SavingsPlan.NewSavingsPlan(ctx, "savingsPlanResource", &SavingsPlan.SavingsPlanArgs{
    	DisplayName: pulumi.String("string"),
    	Flavor:      pulumi.String("string"),
    	Period:      pulumi.String("string"),
    	ServiceName: pulumi.String("string"),
    	Size:        pulumi.Int(0),
    	AutoRenewal: pulumi.Bool(false),
    })
    
    var savingsPlanResource = new SavingsPlan("savingsPlanResource", SavingsPlanArgs.builder()
        .displayName("string")
        .flavor("string")
        .period("string")
        .serviceName("string")
        .size(0)
        .autoRenewal(false)
        .build());
    
    savings_plan_resource = ovh.savings_plan.SavingsPlan("savingsPlanResource",
        display_name="string",
        flavor="string",
        period="string",
        service_name="string",
        size=0,
        auto_renewal=False)
    
    const savingsPlanResource = new ovh.savingsplan.SavingsPlan("savingsPlanResource", {
        displayName: "string",
        flavor: "string",
        period: "string",
        serviceName: "string",
        size: 0,
        autoRenewal: false,
    });
    
    type: ovh:SavingsPlan:SavingsPlan
    properties:
        autoRenewal: false
        displayName: string
        flavor: string
        period: string
        serviceName: string
        size: 0
    

    SavingsPlan Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SavingsPlan resource accepts the following input properties:

    DisplayName string
    Custom display name, used in invoices
    Flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    Period string
    Periodicity of the Savings Plan
    ServiceName string
    ID of the public cloud project
    Size int
    Size of the Savings Plan
    AutoRenewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    DisplayName string
    Custom display name, used in invoices
    Flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    Period string
    Periodicity of the Savings Plan
    ServiceName string
    ID of the public cloud project
    Size int
    Size of the Savings Plan
    AutoRenewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName String
    Custom display name, used in invoices
    flavor String
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period String
    Periodicity of the Savings Plan
    serviceName String
    ID of the public cloud project
    size Integer
    Size of the Savings Plan
    autoRenewal Boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName string
    Custom display name, used in invoices
    flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period string
    Periodicity of the Savings Plan
    serviceName string
    ID of the public cloud project
    size number
    Size of the Savings Plan
    autoRenewal boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    display_name str
    Custom display name, used in invoices
    flavor str
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period str
    Periodicity of the Savings Plan
    service_name str
    ID of the public cloud project
    size int
    Size of the Savings Plan
    auto_renewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName String
    Custom display name, used in invoices
    flavor String
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period String
    Periodicity of the Savings Plan
    serviceName String
    ID of the public cloud project
    size Number
    Size of the Savings Plan
    autoRenewal Boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)

    Outputs

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

    EndDate string
    End date of the Savings Plan
    Id string
    The provider-assigned unique ID for this managed resource.
    PeriodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    PeriodEndDate string
    End date of the current period
    PeriodStartDate string
    Start date of the current period
    ServiceId int
    Billing ID of the service
    StartDate string
    Start date of the Savings Plan
    Status string
    Status of the Savings Plan
    EndDate string
    End date of the Savings Plan
    Id string
    The provider-assigned unique ID for this managed resource.
    PeriodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    PeriodEndDate string
    End date of the current period
    PeriodStartDate string
    Start date of the current period
    ServiceId int
    Billing ID of the service
    StartDate string
    Start date of the Savings Plan
    Status string
    Status of the Savings Plan
    endDate String
    End date of the Savings Plan
    id String
    The provider-assigned unique ID for this managed resource.
    periodEndAction String
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate String
    End date of the current period
    periodStartDate String
    Start date of the current period
    serviceId Integer
    Billing ID of the service
    startDate String
    Start date of the Savings Plan
    status String
    Status of the Savings Plan
    endDate string
    End date of the Savings Plan
    id string
    The provider-assigned unique ID for this managed resource.
    periodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate string
    End date of the current period
    periodStartDate string
    Start date of the current period
    serviceId number
    Billing ID of the service
    startDate string
    Start date of the Savings Plan
    status string
    Status of the Savings Plan
    end_date str
    End date of the Savings Plan
    id str
    The provider-assigned unique ID for this managed resource.
    period_end_action str
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    period_end_date str
    End date of the current period
    period_start_date str
    Start date of the current period
    service_id int
    Billing ID of the service
    start_date str
    Start date of the Savings Plan
    status str
    Status of the Savings Plan
    endDate String
    End date of the Savings Plan
    id String
    The provider-assigned unique ID for this managed resource.
    periodEndAction String
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate String
    End date of the current period
    periodStartDate String
    Start date of the current period
    serviceId Number
    Billing ID of the service
    startDate String
    Start date of the Savings Plan
    status String
    Status of the Savings Plan

    Look up Existing SavingsPlan Resource

    Get an existing SavingsPlan 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?: SavingsPlanState, opts?: CustomResourceOptions): SavingsPlan
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_renewal: Optional[bool] = None,
            display_name: Optional[str] = None,
            end_date: Optional[str] = None,
            flavor: Optional[str] = None,
            period: Optional[str] = None,
            period_end_action: Optional[str] = None,
            period_end_date: Optional[str] = None,
            period_start_date: Optional[str] = None,
            service_id: Optional[int] = None,
            service_name: Optional[str] = None,
            size: Optional[int] = None,
            start_date: Optional[str] = None,
            status: Optional[str] = None) -> SavingsPlan
    func GetSavingsPlan(ctx *Context, name string, id IDInput, state *SavingsPlanState, opts ...ResourceOption) (*SavingsPlan, error)
    public static SavingsPlan Get(string name, Input<string> id, SavingsPlanState? state, CustomResourceOptions? opts = null)
    public static SavingsPlan get(String name, Output<String> id, SavingsPlanState state, CustomResourceOptions options)
    resources:  _:    type: ovh:SavingsPlan:SavingsPlan    get:      id: ${id}
    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:
    AutoRenewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    DisplayName string
    Custom display name, used in invoices
    EndDate string
    End date of the Savings Plan
    Flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    Period string
    Periodicity of the Savings Plan
    PeriodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    PeriodEndDate string
    End date of the current period
    PeriodStartDate string
    Start date of the current period
    ServiceId int
    Billing ID of the service
    ServiceName string
    ID of the public cloud project
    Size int
    Size of the Savings Plan
    StartDate string
    Start date of the Savings Plan
    Status string
    Status of the Savings Plan
    AutoRenewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    DisplayName string
    Custom display name, used in invoices
    EndDate string
    End date of the Savings Plan
    Flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    Period string
    Periodicity of the Savings Plan
    PeriodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    PeriodEndDate string
    End date of the current period
    PeriodStartDate string
    Start date of the current period
    ServiceId int
    Billing ID of the service
    ServiceName string
    ID of the public cloud project
    Size int
    Size of the Savings Plan
    StartDate string
    Start date of the Savings Plan
    Status string
    Status of the Savings Plan
    autoRenewal Boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName String
    Custom display name, used in invoices
    endDate String
    End date of the Savings Plan
    flavor String
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period String
    Periodicity of the Savings Plan
    periodEndAction String
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate String
    End date of the current period
    periodStartDate String
    Start date of the current period
    serviceId Integer
    Billing ID of the service
    serviceName String
    ID of the public cloud project
    size Integer
    Size of the Savings Plan
    startDate String
    Start date of the Savings Plan
    status String
    Status of the Savings Plan
    autoRenewal boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName string
    Custom display name, used in invoices
    endDate string
    End date of the Savings Plan
    flavor string
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period string
    Periodicity of the Savings Plan
    periodEndAction string
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate string
    End date of the current period
    periodStartDate string
    Start date of the current period
    serviceId number
    Billing ID of the service
    serviceName string
    ID of the public cloud project
    size number
    Size of the Savings Plan
    startDate string
    Start date of the Savings Plan
    status string
    Status of the Savings Plan
    auto_renewal bool
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    display_name str
    Custom display name, used in invoices
    end_date str
    End date of the Savings Plan
    flavor str
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period str
    Periodicity of the Savings Plan
    period_end_action str
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    period_end_date str
    End date of the current period
    period_start_date str
    Start date of the current period
    service_id int
    Billing ID of the service
    service_name str
    ID of the public cloud project
    size int
    Size of the Savings Plan
    start_date str
    Start date of the Savings Plan
    status str
    Status of the Savings Plan
    autoRenewal Boolean
    Whether Savings Plan should be renewed at the end of the period (defaults to false)
    displayName String
    Custom display name, used in invoices
    endDate String
    End date of the Savings Plan
    flavor String
    Savings Plan flavor. The list of available flavors can be retrieved in the next section.
    period String
    Periodicity of the Savings Plan
    periodEndAction String
    Action performed when reaching the end of the period (controles by the auto_renewal parameter)
    periodEndDate String
    End date of the current period
    periodStartDate String
    Start date of the current period
    serviceId Number
    Billing ID of the service
    serviceName String
    ID of the public cloud project
    size Number
    Size of the Savings Plan
    startDate String
    Start date of the Savings Plan
    status String
    Status of the Savings Plan

    Import

    A savings plan can be imported using the following format: service_name and id of the savings plan, separated by “/” e.g.

    $ terraform import ovh_savings_plan.plan service_name/savings_plan_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v1.6.0 published on Monday, Feb 10, 2025 by OVHcloud