castai.RebalancingJob
Explore with Pulumi AI
Job assigns a rebalancing schedule to a cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as castai from "@pulumi/castai";
const spots = new castai.RebalancingJob("spots", {
    clusterId: castai_eks_cluster.test.id,
    rebalancingScheduleId: castai_rebalancing_schedule.spots.id,
    enabled: true,
});
import pulumi
import pulumi_castai as castai
spots = castai.RebalancingJob("spots",
    cluster_id=castai_eks_cluster["test"]["id"],
    rebalancing_schedule_id=castai_rebalancing_schedule["spots"]["id"],
    enabled=True)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/castai/v7/castai"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := castai.NewRebalancingJob(ctx, "spots", &castai.RebalancingJobArgs{
			ClusterId:             pulumi.Any(castai_eks_cluster.Test.Id),
			RebalancingScheduleId: pulumi.Any(castai_rebalancing_schedule.Spots.Id),
			Enabled:               pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Castai = Pulumi.Castai;
return await Deployment.RunAsync(() => 
{
    var spots = new Castai.RebalancingJob("spots", new()
    {
        ClusterId = castai_eks_cluster.Test.Id,
        RebalancingScheduleId = castai_rebalancing_schedule.Spots.Id,
        Enabled = true,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.castai.RebalancingJob;
import com.pulumi.castai.RebalancingJobArgs;
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 spots = new RebalancingJob("spots", RebalancingJobArgs.builder()
            .clusterId(castai_eks_cluster.test().id())
            .rebalancingScheduleId(castai_rebalancing_schedule.spots().id())
            .enabled(true)
            .build());
    }
}
resources:
  spots:
    type: castai:RebalancingJob
    properties:
      clusterId: ${castai_eks_cluster.test.id}
      rebalancingScheduleId: ${castai_rebalancing_schedule.spots.id}
      enabled: true
Create RebalancingJob Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RebalancingJob(name: string, args: RebalancingJobArgs, opts?: CustomResourceOptions);@overload
def RebalancingJob(resource_name: str,
                   args: RebalancingJobArgs,
                   opts: Optional[ResourceOptions] = None)
@overload
def RebalancingJob(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   cluster_id: Optional[str] = None,
                   rebalancing_schedule_id: Optional[str] = None,
                   enabled: Optional[bool] = None,
                   rebalancing_job_id: Optional[str] = None,
                   timeouts: Optional[RebalancingJobTimeoutsArgs] = None)func NewRebalancingJob(ctx *Context, name string, args RebalancingJobArgs, opts ...ResourceOption) (*RebalancingJob, error)public RebalancingJob(string name, RebalancingJobArgs args, CustomResourceOptions? opts = null)
public RebalancingJob(String name, RebalancingJobArgs args)
public RebalancingJob(String name, RebalancingJobArgs args, CustomResourceOptions options)
type: castai:RebalancingJob
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 RebalancingJobArgs
- 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 RebalancingJobArgs
- 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 RebalancingJobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RebalancingJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RebalancingJobArgs
- 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 rebalancingJobResource = new Castai.RebalancingJob("rebalancingJobResource", new()
{
    ClusterId = "string",
    RebalancingScheduleId = "string",
    Enabled = false,
    RebalancingJobId = "string",
    Timeouts = new Castai.Inputs.RebalancingJobTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Read = "string",
        Update = "string",
    },
});
example, err := castai.NewRebalancingJob(ctx, "rebalancingJobResource", &castai.RebalancingJobArgs{
ClusterId: pulumi.String("string"),
RebalancingScheduleId: pulumi.String("string"),
Enabled: pulumi.Bool(false),
RebalancingJobId: pulumi.String("string"),
Timeouts: &.RebalancingJobTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var rebalancingJobResource = new RebalancingJob("rebalancingJobResource", RebalancingJobArgs.builder()
    .clusterId("string")
    .rebalancingScheduleId("string")
    .enabled(false)
    .rebalancingJobId("string")
    .timeouts(RebalancingJobTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .read("string")
        .update("string")
        .build())
    .build());
rebalancing_job_resource = castai.RebalancingJob("rebalancingJobResource",
    cluster_id="string",
    rebalancing_schedule_id="string",
    enabled=False,
    rebalancing_job_id="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "read": "string",
        "update": "string",
    })
const rebalancingJobResource = new castai.RebalancingJob("rebalancingJobResource", {
    clusterId: "string",
    rebalancingScheduleId: "string",
    enabled: false,
    rebalancingJobId: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        read: "string",
        update: "string",
    },
});
type: castai:RebalancingJob
properties:
    clusterId: string
    enabled: false
    rebalancingJobId: string
    rebalancingScheduleId: string
    timeouts:
        create: string
        delete: string
        read: string
        update: string
RebalancingJob 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 RebalancingJob resource accepts the following input properties:
- ClusterId string
- CAST AI cluster id.
- RebalancingSchedule stringId 
- Rebalancing schedule of this job.
- Enabled bool
- The job will only be executed if it's enabled.
- RebalancingJob stringId 
- The ID of this resource.
- Timeouts
RebalancingJob Timeouts 
- ClusterId string
- CAST AI cluster id.
- RebalancingSchedule stringId 
- Rebalancing schedule of this job.
- Enabled bool
- The job will only be executed if it's enabled.
- RebalancingJob stringId 
- The ID of this resource.
- Timeouts
RebalancingJob Timeouts Args 
- clusterId String
- CAST AI cluster id.
- rebalancingSchedule StringId 
- Rebalancing schedule of this job.
- enabled Boolean
- The job will only be executed if it's enabled.
- rebalancingJob StringId 
- The ID of this resource.
- timeouts
RebalancingJob Timeouts 
- clusterId string
- CAST AI cluster id.
- rebalancingSchedule stringId 
- Rebalancing schedule of this job.
- enabled boolean
- The job will only be executed if it's enabled.
- rebalancingJob stringId 
- The ID of this resource.
- timeouts
RebalancingJob Timeouts 
- cluster_id str
- CAST AI cluster id.
- rebalancing_schedule_ strid 
- Rebalancing schedule of this job.
- enabled bool
- The job will only be executed if it's enabled.
- rebalancing_job_ strid 
- The ID of this resource.
- timeouts
RebalancingJob Timeouts Args 
- clusterId String
- CAST AI cluster id.
- rebalancingSchedule StringId 
- Rebalancing schedule of this job.
- enabled Boolean
- The job will only be executed if it's enabled.
- rebalancingJob StringId 
- The ID of this resource.
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the RebalancingJob resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RebalancingJob Resource
Get an existing RebalancingJob 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?: RebalancingJobState, opts?: CustomResourceOptions): RebalancingJob@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        enabled: Optional[bool] = None,
        rebalancing_job_id: Optional[str] = None,
        rebalancing_schedule_id: Optional[str] = None,
        timeouts: Optional[RebalancingJobTimeoutsArgs] = None) -> RebalancingJobfunc GetRebalancingJob(ctx *Context, name string, id IDInput, state *RebalancingJobState, opts ...ResourceOption) (*RebalancingJob, error)public static RebalancingJob Get(string name, Input<string> id, RebalancingJobState? state, CustomResourceOptions? opts = null)public static RebalancingJob get(String name, Output<String> id, RebalancingJobState state, CustomResourceOptions options)resources:  _:    type: castai:RebalancingJob    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.
- ClusterId string
- CAST AI cluster id.
- Enabled bool
- The job will only be executed if it's enabled.
- RebalancingJob stringId 
- The ID of this resource.
- RebalancingSchedule stringId 
- Rebalancing schedule of this job.
- Timeouts
RebalancingJob Timeouts 
- ClusterId string
- CAST AI cluster id.
- Enabled bool
- The job will only be executed if it's enabled.
- RebalancingJob stringId 
- The ID of this resource.
- RebalancingSchedule stringId 
- Rebalancing schedule of this job.
- Timeouts
RebalancingJob Timeouts Args 
- clusterId String
- CAST AI cluster id.
- enabled Boolean
- The job will only be executed if it's enabled.
- rebalancingJob StringId 
- The ID of this resource.
- rebalancingSchedule StringId 
- Rebalancing schedule of this job.
- timeouts
RebalancingJob Timeouts 
- clusterId string
- CAST AI cluster id.
- enabled boolean
- The job will only be executed if it's enabled.
- rebalancingJob stringId 
- The ID of this resource.
- rebalancingSchedule stringId 
- Rebalancing schedule of this job.
- timeouts
RebalancingJob Timeouts 
- cluster_id str
- CAST AI cluster id.
- enabled bool
- The job will only be executed if it's enabled.
- rebalancing_job_ strid 
- The ID of this resource.
- rebalancing_schedule_ strid 
- Rebalancing schedule of this job.
- timeouts
RebalancingJob Timeouts Args 
- clusterId String
- CAST AI cluster id.
- enabled Boolean
- The job will only be executed if it's enabled.
- rebalancingJob StringId 
- The ID of this resource.
- rebalancingSchedule StringId 
- Rebalancing schedule of this job.
- timeouts Property Map
Supporting Types
RebalancingJobTimeouts, RebalancingJobTimeoutsArgs      
Import
Import jobs by specifying cluster ID and schedule name.
Schedule must be assigned to the cluster already for this command to succeed.
$ pulumi import castai:index/rebalancingJob:RebalancingJob spots' 12345678-1762-45eb-bd4f-85cb172e6ad3/spots
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- castai castai/terraform-provider-castai
- License
- Notes
- This Pulumi package is based on the castaiTerraform Provider.