1. Packages
  2. Harness Provider
  3. API Docs
  4. autostopping
  5. RuleK8s
Viewing docs for Harness v0.11.8
published on Friday, Mar 27, 2026 by Pulumi
harness logo
Viewing docs for Harness v0.11.8
published on Friday, Mar 27, 2026 by Pulumi

    Data source for retrieving a Harness AutoStopping rule for K8s services.

    Create RuleK8s Resource

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

    Constructor syntax

    new RuleK8s(name: string, args: RuleK8sArgs, opts?: CustomResourceOptions);
    @overload
    def RuleK8s(resource_name: str,
                args: RuleK8sArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def RuleK8s(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                cloud_connector_id: Optional[str] = None,
                k8s_connector_id: Optional[str] = None,
                k8s_namespace: Optional[str] = None,
                rule_yaml: Optional[str] = None,
                depends: Optional[Sequence[RuleK8sDependArgs]] = None,
                dry_run: Optional[bool] = None,
                idle_time_mins: Optional[int] = None,
                name: Optional[str] = None)
    func NewRuleK8s(ctx *Context, name string, args RuleK8sArgs, opts ...ResourceOption) (*RuleK8s, error)
    public RuleK8s(string name, RuleK8sArgs args, CustomResourceOptions? opts = null)
    public RuleK8s(String name, RuleK8sArgs args)
    public RuleK8s(String name, RuleK8sArgs args, CustomResourceOptions options)
    
    type: harness:autostopping:RuleK8s
    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 RuleK8sArgs
    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 RuleK8sArgs
    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 RuleK8sArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleK8sArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleK8sArgs
    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 ruleK8sResource = new Harness.Autostopping.RuleK8s("ruleK8sResource", new()
    {
        CloudConnectorId = "string",
        K8sConnectorId = "string",
        K8sNamespace = "string",
        RuleYaml = "string",
        Depends = new[]
        {
            new Harness.Autostopping.Inputs.RuleK8sDependArgs
            {
                RuleId = 0,
                DelayInSec = 0,
            },
        },
        DryRun = false,
        IdleTimeMins = 0,
        Name = "string",
    });
    
    example, err := autostopping.NewRuleK8s(ctx, "ruleK8sResource", &autostopping.RuleK8sArgs{
    	CloudConnectorId: pulumi.String("string"),
    	K8sConnectorId:   pulumi.String("string"),
    	K8sNamespace:     pulumi.String("string"),
    	RuleYaml:         pulumi.String("string"),
    	Depends: autostopping.RuleK8sDependArray{
    		&autostopping.RuleK8sDependArgs{
    			RuleId:     pulumi.Int(0),
    			DelayInSec: pulumi.Int(0),
    		},
    	},
    	DryRun:       pulumi.Bool(false),
    	IdleTimeMins: pulumi.Int(0),
    	Name:         pulumi.String("string"),
    })
    
    var ruleK8sResource = new RuleK8s("ruleK8sResource", RuleK8sArgs.builder()
        .cloudConnectorId("string")
        .k8sConnectorId("string")
        .k8sNamespace("string")
        .ruleYaml("string")
        .depends(RuleK8sDependArgs.builder()
            .ruleId(0)
            .delayInSec(0)
            .build())
        .dryRun(false)
        .idleTimeMins(0)
        .name("string")
        .build());
    
    rule_k8s_resource = harness.autostopping.RuleK8s("ruleK8sResource",
        cloud_connector_id="string",
        k8s_connector_id="string",
        k8s_namespace="string",
        rule_yaml="string",
        depends=[{
            "rule_id": 0,
            "delay_in_sec": 0,
        }],
        dry_run=False,
        idle_time_mins=0,
        name="string")
    
    const ruleK8sResource = new harness.autostopping.RuleK8s("ruleK8sResource", {
        cloudConnectorId: "string",
        k8sConnectorId: "string",
        k8sNamespace: "string",
        ruleYaml: "string",
        depends: [{
            ruleId: 0,
            delayInSec: 0,
        }],
        dryRun: false,
        idleTimeMins: 0,
        name: "string",
    });
    
    type: harness:autostopping:RuleK8s
    properties:
        cloudConnectorId: string
        depends:
            - delayInSec: 0
              ruleId: 0
        dryRun: false
        idleTimeMins: 0
        k8sConnectorId: string
        k8sNamespace: string
        name: string
        ruleYaml: string
    

    RuleK8s 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 RuleK8s resource accepts the following input properties:

    CloudConnectorId string
    Id of the cloud connector
    K8sConnectorId string
    Id of the K8s connector
    K8sNamespace string
    Namespace of the cluster
    RuleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    Depends List<RuleK8sDepend>
    Dependent rules
    DryRun bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    IdleTimeMins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    Name string
    Name of the rule
    CloudConnectorId string
    Id of the cloud connector
    K8sConnectorId string
    Id of the K8s connector
    K8sNamespace string
    Namespace of the cluster
    RuleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    Depends []RuleK8sDependArgs
    Dependent rules
    DryRun bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    IdleTimeMins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    Name string
    Name of the rule
    cloudConnectorId String
    Id of the cloud connector
    k8sConnectorId String
    Id of the K8s connector
    k8sNamespace String
    Namespace of the cluster
    ruleYaml String
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    depends List<RuleK8sDepend>
    Dependent rules
    dryRun Boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    idleTimeMins Integer
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    name String
    Name of the rule
    cloudConnectorId string
    Id of the cloud connector
    k8sConnectorId string
    Id of the K8s connector
    k8sNamespace string
    Namespace of the cluster
    ruleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    depends RuleK8sDepend[]
    Dependent rules
    dryRun boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    idleTimeMins number
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    name string
    Name of the rule
    cloud_connector_id str
    Id of the cloud connector
    k8s_connector_id str
    Id of the K8s connector
    k8s_namespace str
    Namespace of the cluster
    rule_yaml str
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    depends Sequence[RuleK8sDependArgs]
    Dependent rules
    dry_run bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    idle_time_mins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    name str
    Name of the rule
    cloudConnectorId String
    Id of the cloud connector
    k8sConnectorId String
    Id of the K8s connector
    k8sNamespace String
    Namespace of the cluster
    ruleYaml String
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    depends List<Property Map>
    Dependent rules
    dryRun Boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    idleTimeMins Number
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    name String
    Name of the rule

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource
    Id string
    The provider-assigned unique ID for this managed resource.
    Identifier string
    Unique identifier of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource
    id string
    The provider-assigned unique ID for this managed resource.
    identifier string
    Unique identifier of the resource
    id str
    The provider-assigned unique ID for this managed resource.
    identifier str
    Unique identifier of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    identifier String
    Unique identifier of the resource

    Look up Existing RuleK8s Resource

    Get an existing RuleK8s 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?: RuleK8sState, opts?: CustomResourceOptions): RuleK8s
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cloud_connector_id: Optional[str] = None,
            depends: Optional[Sequence[RuleK8sDependArgs]] = None,
            dry_run: Optional[bool] = None,
            identifier: Optional[str] = None,
            idle_time_mins: Optional[int] = None,
            k8s_connector_id: Optional[str] = None,
            k8s_namespace: Optional[str] = None,
            name: Optional[str] = None,
            rule_yaml: Optional[str] = None) -> RuleK8s
    func GetRuleK8s(ctx *Context, name string, id IDInput, state *RuleK8sState, opts ...ResourceOption) (*RuleK8s, error)
    public static RuleK8s Get(string name, Input<string> id, RuleK8sState? state, CustomResourceOptions? opts = null)
    public static RuleK8s get(String name, Output<String> id, RuleK8sState state, CustomResourceOptions options)
    resources:  _:    type: harness:autostopping:RuleK8s    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:
    CloudConnectorId string
    Id of the cloud connector
    Depends List<RuleK8sDepend>
    Dependent rules
    DryRun bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    Identifier string
    Unique identifier of the resource
    IdleTimeMins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    K8sConnectorId string
    Id of the K8s connector
    K8sNamespace string
    Namespace of the cluster
    Name string
    Name of the rule
    RuleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    CloudConnectorId string
    Id of the cloud connector
    Depends []RuleK8sDependArgs
    Dependent rules
    DryRun bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    Identifier string
    Unique identifier of the resource
    IdleTimeMins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    K8sConnectorId string
    Id of the K8s connector
    K8sNamespace string
    Namespace of the cluster
    Name string
    Name of the rule
    RuleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    cloudConnectorId String
    Id of the cloud connector
    depends List<RuleK8sDepend>
    Dependent rules
    dryRun Boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    identifier String
    Unique identifier of the resource
    idleTimeMins Integer
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    k8sConnectorId String
    Id of the K8s connector
    k8sNamespace String
    Namespace of the cluster
    name String
    Name of the rule
    ruleYaml String
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    cloudConnectorId string
    Id of the cloud connector
    depends RuleK8sDepend[]
    Dependent rules
    dryRun boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    identifier string
    Unique identifier of the resource
    idleTimeMins number
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    k8sConnectorId string
    Id of the K8s connector
    k8sNamespace string
    Namespace of the cluster
    name string
    Name of the rule
    ruleYaml string
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    cloud_connector_id str
    Id of the cloud connector
    depends Sequence[RuleK8sDependArgs]
    Dependent rules
    dry_run bool
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    identifier str
    Unique identifier of the resource
    idle_time_mins int
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    k8s_connector_id str
    Id of the K8s connector
    k8s_namespace str
    Namespace of the cluster
    name str
    Name of the rule
    rule_yaml str
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).
    cloudConnectorId String
    Id of the cloud connector
    depends List<Property Map>
    Dependent rules
    dryRun Boolean
    Boolean that indicates whether the AutoStopping rule should be created in DryRun mode
    identifier String
    Unique identifier of the resource
    idleTimeMins Number
    Idle time in minutes. This is the time that the AutoStopping rule waits before stopping the idle instances.
    k8sConnectorId String
    Id of the K8s connector
    k8sNamespace String
    Namespace of the cluster
    name String
    Name of the rule
    ruleYaml String
    YAML definition of the K8s AutoStopping rule (workload selector, ingress, etc.).

    Supporting Types

    RuleK8sDepend, RuleK8sDependArgs

    RuleId int
    Rule id of the dependent rule
    DelayInSec int
    Number of seconds the rule should wait after warming up the dependent rule
    RuleId int
    Rule id of the dependent rule
    DelayInSec int
    Number of seconds the rule should wait after warming up the dependent rule
    ruleId Integer
    Rule id of the dependent rule
    delayInSec Integer
    Number of seconds the rule should wait after warming up the dependent rule
    ruleId number
    Rule id of the dependent rule
    delayInSec number
    Number of seconds the rule should wait after warming up the dependent rule
    rule_id int
    Rule id of the dependent rule
    delay_in_sec int
    Number of seconds the rule should wait after warming up the dependent rule
    ruleId Number
    Rule id of the dependent rule
    delayInSec Number
    Number of seconds the rule should wait after warming up the dependent rule

    Package Details

    Repository
    harness pulumi/pulumi-harness
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the harness Terraform Provider.
    harness logo
    Viewing docs for Harness v0.11.8
    published on Friday, Mar 27, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.