1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. KubernetesHealthCheckPolicy
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.KubernetesHealthCheckPolicy

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a tke kubernetes_health_check_policy

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const kubernetesHealthCheckPolicy = new tencentcloud.KubernetesHealthCheckPolicy("kubernetesHealthCheckPolicy", {
        clusterId: "cls-xxxxx",
        rules: [
            {
                autoRepairEnabled: true,
                enabled: true,
                name: "OOMKilling",
            },
            {
                autoRepairEnabled: true,
                enabled: true,
                name: "KubeletUnhealthy",
            },
        ],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    kubernetes_health_check_policy = tencentcloud.KubernetesHealthCheckPolicy("kubernetesHealthCheckPolicy",
        cluster_id="cls-xxxxx",
        rules=[
            {
                "auto_repair_enabled": True,
                "enabled": True,
                "name": "OOMKilling",
            },
            {
                "auto_repair_enabled": True,
                "enabled": True,
                "name": "KubeletUnhealthy",
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewKubernetesHealthCheckPolicy(ctx, "kubernetesHealthCheckPolicy", &tencentcloud.KubernetesHealthCheckPolicyArgs{
    			ClusterId: pulumi.String("cls-xxxxx"),
    			Rules: tencentcloud.KubernetesHealthCheckPolicyRuleArray{
    				&tencentcloud.KubernetesHealthCheckPolicyRuleArgs{
    					AutoRepairEnabled: pulumi.Bool(true),
    					Enabled:           pulumi.Bool(true),
    					Name:              pulumi.String("OOMKilling"),
    				},
    				&tencentcloud.KubernetesHealthCheckPolicyRuleArgs{
    					AutoRepairEnabled: pulumi.Bool(true),
    					Enabled:           pulumi.Bool(true),
    					Name:              pulumi.String("KubeletUnhealthy"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var kubernetesHealthCheckPolicy = new Tencentcloud.KubernetesHealthCheckPolicy("kubernetesHealthCheckPolicy", new()
        {
            ClusterId = "cls-xxxxx",
            Rules = new[]
            {
                new Tencentcloud.Inputs.KubernetesHealthCheckPolicyRuleArgs
                {
                    AutoRepairEnabled = true,
                    Enabled = true,
                    Name = "OOMKilling",
                },
                new Tencentcloud.Inputs.KubernetesHealthCheckPolicyRuleArgs
                {
                    AutoRepairEnabled = true,
                    Enabled = true,
                    Name = "KubeletUnhealthy",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.KubernetesHealthCheckPolicy;
    import com.pulumi.tencentcloud.KubernetesHealthCheckPolicyArgs;
    import com.pulumi.tencentcloud.inputs.KubernetesHealthCheckPolicyRuleArgs;
    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 kubernetesHealthCheckPolicy = new KubernetesHealthCheckPolicy("kubernetesHealthCheckPolicy", KubernetesHealthCheckPolicyArgs.builder()
                .clusterId("cls-xxxxx")
                .rules(            
                    KubernetesHealthCheckPolicyRuleArgs.builder()
                        .autoRepairEnabled(true)
                        .enabled(true)
                        .name("OOMKilling")
                        .build(),
                    KubernetesHealthCheckPolicyRuleArgs.builder()
                        .autoRepairEnabled(true)
                        .enabled(true)
                        .name("KubeletUnhealthy")
                        .build())
                .build());
    
        }
    }
    
    resources:
      kubernetesHealthCheckPolicy:
        type: tencentcloud:KubernetesHealthCheckPolicy
        properties:
          clusterId: cls-xxxxx
          rules:
            - autoRepairEnabled: true
              enabled: true
              name: OOMKilling
            - autoRepairEnabled: true
              enabled: true
              name: KubeletUnhealthy
    

    Create KubernetesHealthCheckPolicy Resource

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

    Constructor syntax

    new KubernetesHealthCheckPolicy(name: string, args: KubernetesHealthCheckPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def KubernetesHealthCheckPolicy(resource_name: str,
                                    args: KubernetesHealthCheckPolicyArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def KubernetesHealthCheckPolicy(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    cluster_id: Optional[str] = None,
                                    rules: Optional[Sequence[KubernetesHealthCheckPolicyRuleArgs]] = None,
                                    kubernetes_health_check_policy_id: Optional[str] = None,
                                    name: Optional[str] = None)
    func NewKubernetesHealthCheckPolicy(ctx *Context, name string, args KubernetesHealthCheckPolicyArgs, opts ...ResourceOption) (*KubernetesHealthCheckPolicy, error)
    public KubernetesHealthCheckPolicy(string name, KubernetesHealthCheckPolicyArgs args, CustomResourceOptions? opts = null)
    public KubernetesHealthCheckPolicy(String name, KubernetesHealthCheckPolicyArgs args)
    public KubernetesHealthCheckPolicy(String name, KubernetesHealthCheckPolicyArgs args, CustomResourceOptions options)
    
    type: tencentcloud:KubernetesHealthCheckPolicy
    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 KubernetesHealthCheckPolicyArgs
    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 KubernetesHealthCheckPolicyArgs
    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 KubernetesHealthCheckPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KubernetesHealthCheckPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KubernetesHealthCheckPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ClusterId string
    ID of the cluster.
    Rules List<KubernetesHealthCheckPolicyRule>
    Health check policy rule list.
    KubernetesHealthCheckPolicyId string
    ID of the resource.
    Name string
    Health Check Policy Name.
    ClusterId string
    ID of the cluster.
    Rules []KubernetesHealthCheckPolicyRuleArgs
    Health check policy rule list.
    KubernetesHealthCheckPolicyId string
    ID of the resource.
    Name string
    Health Check Policy Name.
    clusterId String
    ID of the cluster.
    rules List<KubernetesHealthCheckPolicyRule>
    Health check policy rule list.
    kubernetesHealthCheckPolicyId String
    ID of the resource.
    name String
    Health Check Policy Name.
    clusterId string
    ID of the cluster.
    rules KubernetesHealthCheckPolicyRule[]
    Health check policy rule list.
    kubernetesHealthCheckPolicyId string
    ID of the resource.
    name string
    Health Check Policy Name.
    cluster_id str
    ID of the cluster.
    rules Sequence[KubernetesHealthCheckPolicyRuleArgs]
    Health check policy rule list.
    kubernetes_health_check_policy_id str
    ID of the resource.
    name str
    Health Check Policy Name.
    clusterId String
    ID of the cluster.
    rules List<Property Map>
    Health check policy rule list.
    kubernetesHealthCheckPolicyId String
    ID of the resource.
    name String
    Health Check Policy Name.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KubernetesHealthCheckPolicy 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 KubernetesHealthCheckPolicy Resource

    Get an existing KubernetesHealthCheckPolicy 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?: KubernetesHealthCheckPolicyState, opts?: CustomResourceOptions): KubernetesHealthCheckPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            kubernetes_health_check_policy_id: Optional[str] = None,
            name: Optional[str] = None,
            rules: Optional[Sequence[KubernetesHealthCheckPolicyRuleArgs]] = None) -> KubernetesHealthCheckPolicy
    func GetKubernetesHealthCheckPolicy(ctx *Context, name string, id IDInput, state *KubernetesHealthCheckPolicyState, opts ...ResourceOption) (*KubernetesHealthCheckPolicy, error)
    public static KubernetesHealthCheckPolicy Get(string name, Input<string> id, KubernetesHealthCheckPolicyState? state, CustomResourceOptions? opts = null)
    public static KubernetesHealthCheckPolicy get(String name, Output<String> id, KubernetesHealthCheckPolicyState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:KubernetesHealthCheckPolicy    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:
    ClusterId string
    ID of the cluster.
    KubernetesHealthCheckPolicyId string
    ID of the resource.
    Name string
    Health Check Policy Name.
    Rules List<KubernetesHealthCheckPolicyRule>
    Health check policy rule list.
    ClusterId string
    ID of the cluster.
    KubernetesHealthCheckPolicyId string
    ID of the resource.
    Name string
    Health Check Policy Name.
    Rules []KubernetesHealthCheckPolicyRuleArgs
    Health check policy rule list.
    clusterId String
    ID of the cluster.
    kubernetesHealthCheckPolicyId String
    ID of the resource.
    name String
    Health Check Policy Name.
    rules List<KubernetesHealthCheckPolicyRule>
    Health check policy rule list.
    clusterId string
    ID of the cluster.
    kubernetesHealthCheckPolicyId string
    ID of the resource.
    name string
    Health Check Policy Name.
    rules KubernetesHealthCheckPolicyRule[]
    Health check policy rule list.
    cluster_id str
    ID of the cluster.
    kubernetes_health_check_policy_id str
    ID of the resource.
    name str
    Health Check Policy Name.
    rules Sequence[KubernetesHealthCheckPolicyRuleArgs]
    Health check policy rule list.
    clusterId String
    ID of the cluster.
    kubernetesHealthCheckPolicyId String
    ID of the resource.
    name String
    Health Check Policy Name.
    rules List<Property Map>
    Health check policy rule list.

    Supporting Types

    KubernetesHealthCheckPolicyRule, KubernetesHealthCheckPolicyRuleArgs

    AutoRepairEnabled bool
    Enable repair or not.
    Enabled bool
    Enable detection of this project or not.
    Name string
    Health check rule details.
    AutoRepairEnabled bool
    Enable repair or not.
    Enabled bool
    Enable detection of this project or not.
    Name string
    Health check rule details.
    autoRepairEnabled Boolean
    Enable repair or not.
    enabled Boolean
    Enable detection of this project or not.
    name String
    Health check rule details.
    autoRepairEnabled boolean
    Enable repair or not.
    enabled boolean
    Enable detection of this project or not.
    name string
    Health check rule details.
    auto_repair_enabled bool
    Enable repair or not.
    enabled bool
    Enable detection of this project or not.
    name str
    Health check rule details.
    autoRepairEnabled Boolean
    Enable repair or not.
    enabled Boolean
    Enable detection of this project or not.
    name String
    Health check rule details.

    Import

    tke kubernetes_health_check_policy can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/kubernetesHealthCheckPolicy:KubernetesHealthCheckPolicy kubernetes_health_check_policy cls-xxxxx#healthcheckpolicyname
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack