ovh.SavingsPlan.SavingsPlan
Explore with Pulumi AI
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:
- Display
Name 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
- Service
Name string - 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)
- Display
Name 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
- Service
Name string - 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)
- display
Name 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
- service
Name String - ID of the public cloud project
- size Integer
- Size of the Savings Plan
- auto
Renewal Boolean - Whether Savings Plan should be renewed at the end of the period (defaults to false)
- display
Name 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
- service
Name string - ID of the public cloud project
- size number
- Size of the Savings Plan
- auto
Renewal 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)
- display
Name 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
- service
Name String - ID of the public cloud project
- size Number
- Size of the Savings Plan
- auto
Renewal 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:
- End
Date string - End date of the Savings Plan
- Id string
- The provider-assigned unique ID for this managed resource.
- Period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - Period
End stringDate - End date of the current period
- Period
Start stringDate - Start date of the current period
- Service
Id int - Billing ID of the service
- Start
Date string - Start date of the Savings Plan
- Status string
- Status of the Savings Plan
- End
Date string - End date of the Savings Plan
- Id string
- The provider-assigned unique ID for this managed resource.
- Period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - Period
End stringDate - End date of the current period
- Period
Start stringDate - Start date of the current period
- Service
Id int - Billing ID of the service
- Start
Date string - Start date of the Savings Plan
- Status string
- Status of the Savings Plan
- end
Date String - End date of the Savings Plan
- id String
- The provider-assigned unique ID for this managed resource.
- period
End StringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End StringDate - End date of the current period
- period
Start StringDate - Start date of the current period
- service
Id Integer - Billing ID of the service
- start
Date String - Start date of the Savings Plan
- status String
- Status of the Savings Plan
- end
Date string - End date of the Savings Plan
- id string
- The provider-assigned unique ID for this managed resource.
- period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End stringDate - End date of the current period
- period
Start stringDate - Start date of the current period
- service
Id number - Billing ID of the service
- start
Date 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_ straction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period_
end_ strdate - End date of the current period
- period_
start_ strdate - 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
- end
Date String - End date of the Savings Plan
- id String
- The provider-assigned unique ID for this managed resource.
- period
End StringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End StringDate - End date of the current period
- period
Start StringDate - Start date of the current period
- service
Id Number - Billing ID of the service
- start
Date 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.
- Auto
Renewal bool - Whether Savings Plan should be renewed at the end of the period (defaults to false)
- Display
Name string - Custom display name, used in invoices
- End
Date 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
- Period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - Period
End stringDate - End date of the current period
- Period
Start stringDate - Start date of the current period
- Service
Id int - Billing ID of the service
- Service
Name string - ID of the public cloud project
- Size int
- Size of the Savings Plan
- Start
Date 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 string - Custom display name, used in invoices
- End
Date 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
- Period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - Period
End stringDate - End date of the current period
- Period
Start stringDate - Start date of the current period
- Service
Id int - Billing ID of the service
- Service
Name string - ID of the public cloud project
- Size int
- Size of the Savings Plan
- Start
Date string - Start date of the Savings Plan
- Status string
- Status of the Savings Plan
- auto
Renewal Boolean - Whether Savings Plan should be renewed at the end of the period (defaults to false)
- display
Name String - Custom display name, used in invoices
- end
Date 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
- period
End StringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End StringDate - End date of the current period
- period
Start StringDate - Start date of the current period
- service
Id Integer - Billing ID of the service
- service
Name String - ID of the public cloud project
- size Integer
- Size of the Savings Plan
- start
Date String - Start date of the Savings Plan
- status String
- Status of the Savings Plan
- auto
Renewal boolean - Whether Savings Plan should be renewed at the end of the period (defaults to false)
- display
Name string - Custom display name, used in invoices
- end
Date 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
- period
End stringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End stringDate - End date of the current period
- period
Start stringDate - Start date of the current period
- service
Id number - Billing ID of the service
- service
Name string - ID of the public cloud project
- size number
- Size of the Savings Plan
- start
Date 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_ straction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period_
end_ strdate - End date of the current period
- period_
start_ strdate - 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
- auto
Renewal Boolean - Whether Savings Plan should be renewed at the end of the period (defaults to false)
- display
Name String - Custom display name, used in invoices
- end
Date 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
- period
End StringAction - Action performed when reaching the end of the period (controles by the
auto_renewal
parameter) - period
End StringDate - End date of the current period
- period
Start StringDate - Start date of the current period
- service
Id Number - Billing ID of the service
- service
Name String - ID of the public cloud project
- size Number
- Size of the Savings Plan
- start
Date 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.