tencentcloud.KubernetesHealthCheckPolicy
Explore with Pulumi AI
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:
- Cluster
Id string - ID of the cluster.
- Rules
List<Kubernetes
Health Check Policy Rule> - Health check policy rule list.
- Kubernetes
Health stringCheck Policy Id - ID of the resource.
- Name string
- Health Check Policy Name.
- Cluster
Id string - ID of the cluster.
- Rules
[]Kubernetes
Health Check Policy Rule Args - Health check policy rule list.
- Kubernetes
Health stringCheck Policy Id - ID of the resource.
- Name string
- Health Check Policy Name.
- cluster
Id String - ID of the cluster.
- rules
List<Kubernetes
Health Check Policy Rule> - Health check policy rule list.
- kubernetes
Health StringCheck Policy Id - ID of the resource.
- name String
- Health Check Policy Name.
- cluster
Id string - ID of the cluster.
- rules
Kubernetes
Health Check Policy Rule[] - Health check policy rule list.
- kubernetes
Health stringCheck Policy Id - ID of the resource.
- name string
- Health Check Policy Name.
- cluster_
id str - ID of the cluster.
- rules
Sequence[Kubernetes
Health Check Policy Rule Args] - Health check policy rule list.
- kubernetes_
health_ strcheck_ policy_ id - ID of the resource.
- name str
- Health Check Policy Name.
- cluster
Id String - ID of the cluster.
- rules List<Property Map>
- Health check policy rule list.
- kubernetes
Health StringCheck Policy Id - 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.
- Cluster
Id string - ID of the cluster.
- Kubernetes
Health stringCheck Policy Id - ID of the resource.
- Name string
- Health Check Policy Name.
- Rules
List<Kubernetes
Health Check Policy Rule> - Health check policy rule list.
- Cluster
Id string - ID of the cluster.
- Kubernetes
Health stringCheck Policy Id - ID of the resource.
- Name string
- Health Check Policy Name.
- Rules
[]Kubernetes
Health Check Policy Rule Args - Health check policy rule list.
- cluster
Id String - ID of the cluster.
- kubernetes
Health StringCheck Policy Id - ID of the resource.
- name String
- Health Check Policy Name.
- rules
List<Kubernetes
Health Check Policy Rule> - Health check policy rule list.
- cluster
Id string - ID of the cluster.
- kubernetes
Health stringCheck Policy Id - ID of the resource.
- name string
- Health Check Policy Name.
- rules
Kubernetes
Health Check Policy Rule[] - Health check policy rule list.
- cluster_
id str - ID of the cluster.
- kubernetes_
health_ strcheck_ policy_ id - ID of the resource.
- name str
- Health Check Policy Name.
- rules
Sequence[Kubernetes
Health Check Policy Rule Args] - Health check policy rule list.
- cluster
Id String - ID of the cluster.
- kubernetes
Health StringCheck Policy Id - ID of the resource.
- name String
- Health Check Policy Name.
- rules List<Property Map>
- Health check policy rule list.
Supporting Types
KubernetesHealthCheckPolicyRule, KubernetesHealthCheckPolicyRuleArgs
- Auto
Repair boolEnabled - Enable repair or not.
- Enabled bool
- Enable detection of this project or not.
- Name string
- Health check rule details.
- Auto
Repair boolEnabled - Enable repair or not.
- Enabled bool
- Enable detection of this project or not.
- Name string
- Health check rule details.
- auto
Repair BooleanEnabled - Enable repair or not.
- enabled Boolean
- Enable detection of this project or not.
- name String
- Health check rule details.
- auto
Repair booleanEnabled - Enable repair or not.
- enabled boolean
- Enable detection of this project or not.
- name string
- Health check rule details.
- auto_
repair_ boolenabled - Enable repair or not.
- enabled bool
- Enable detection of this project or not.
- name str
- Health check rule details.
- auto
Repair BooleanEnabled - 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.