Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

getHealthCheckTemplates

This data source provides the Alb Health Check Templates of the current Alibaba Cloud user.

NOTE: Available in v1.134.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Alb.GetHealthCheckTemplates.InvokeAsync(new AliCloud.Alb.GetHealthCheckTemplatesArgs
        {
            Ids = 
            {
                "example_id",
            },
        }));
        this.AlbHealthCheckTemplateId1 = ids.Apply(ids => ids.Templates?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Alb.GetHealthCheckTemplates.InvokeAsync(new AliCloud.Alb.GetHealthCheckTemplatesArgs
        {
            NameRegex = "^my-HealthCheckTemplate",
        }));
        this.AlbHealthCheckTemplateId2 = nameRegex.Apply(nameRegex => nameRegex.Templates?[0]?.Id);
    }

    [Output("albHealthCheckTemplateId1")]
    public Output<string> AlbHealthCheckTemplateId1 { get; set; }
    [Output("albHealthCheckTemplateId2")]
    public Output<string> AlbHealthCheckTemplateId2 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/alb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := alb.GetHealthCheckTemplates(ctx, &alb.GetHealthCheckTemplatesArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("albHealthCheckTemplateId1", ids.Templates[0].Id)
		opt0 := "^my-HealthCheckTemplate"
		nameRegex, err := alb.GetHealthCheckTemplates(ctx, &alb.GetHealthCheckTemplatesArgs{
			NameRegex: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("albHealthCheckTemplateId2", nameRegex.Templates[0].Id)
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.alb.get_health_check_templates(ids=["example_id"])
pulumi.export("albHealthCheckTemplateId1", ids.templates[0].id)
name_regex = alicloud.alb.get_health_check_templates(name_regex="^my-HealthCheckTemplate")
pulumi.export("albHealthCheckTemplateId2", name_regex.templates[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.alb.getHealthCheckTemplates({
    ids: ["example_id"],
});
export const albHealthCheckTemplateId1 = ids.then(ids => ids.templates?[0]?.id);
const nameRegex = alicloud.alb.getHealthCheckTemplates({
    nameRegex: "^my-HealthCheckTemplate",
});
export const albHealthCheckTemplateId2 = nameRegex.then(nameRegex => nameRegex.templates?[0]?.id);

Using getHealthCheckTemplates

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getHealthCheckTemplates(args: GetHealthCheckTemplatesArgs, opts?: InvokeOptions): Promise<GetHealthCheckTemplatesResult>
function getHealthCheckTemplatesOutput(args: GetHealthCheckTemplatesOutputArgs, opts?: InvokeOptions): Output<GetHealthCheckTemplatesResult>
def get_health_check_templates(health_check_template_ids: Optional[Sequence[str]] = None,
                               health_check_template_name: Optional[str] = None,
                               ids: Optional[Sequence[str]] = None,
                               name_regex: Optional[str] = None,
                               output_file: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetHealthCheckTemplatesResult
def get_health_check_templates_output(health_check_template_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               health_check_template_name: Optional[pulumi.Input[str]] = None,
                               ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               name_regex: Optional[pulumi.Input[str]] = None,
                               output_file: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetHealthCheckTemplatesResult]
func GetHealthCheckTemplates(ctx *Context, args *GetHealthCheckTemplatesArgs, opts ...InvokeOption) (*GetHealthCheckTemplatesResult, error)
func GetHealthCheckTemplatesOutput(ctx *Context, args *GetHealthCheckTemplatesOutputArgs, opts ...InvokeOption) GetHealthCheckTemplatesResultOutput

> Note: This function is named GetHealthCheckTemplates in the Go SDK.

public static class GetHealthCheckTemplates 
{
    public static Task<GetHealthCheckTemplatesResult> InvokeAsync(GetHealthCheckTemplatesArgs args, InvokeOptions? opts = null)
    public static Output<GetHealthCheckTemplatesResult> Invoke(GetHealthCheckTemplatesInvokeArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

HealthCheckTemplateIds List<string>
The health check template ids.
HealthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
Ids List<string>
A list of Health Check Template IDs.
NameRegex string
A regex string to filter results by Health Check Template name.
OutputFile string
HealthCheckTemplateIds []string
The health check template ids.
HealthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
Ids []string
A list of Health Check Template IDs.
NameRegex string
A regex string to filter results by Health Check Template name.
OutputFile string
healthCheckTemplateIds string[]
The health check template ids.
healthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
ids string[]
A list of Health Check Template IDs.
nameRegex string
A regex string to filter results by Health Check Template name.
outputFile string
health_check_template_ids Sequence[str]
The health check template ids.
health_check_template_name str
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
ids Sequence[str]
A list of Health Check Template IDs.
name_regex str
A regex string to filter results by Health Check Template name.
output_file str

getHealthCheckTemplates Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
Templates List<Pulumi.AliCloud.Alb.Outputs.GetHealthCheckTemplatesTemplate>
HealthCheckTemplateIds List<string>
HealthCheckTemplateName string
NameRegex string
OutputFile string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Templates []GetHealthCheckTemplatesTemplate
HealthCheckTemplateIds []string
HealthCheckTemplateName string
NameRegex string
OutputFile string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
templates GetHealthCheckTemplatesTemplate[]
healthCheckTemplateIds string[]
healthCheckTemplateName string
nameRegex string
outputFile string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
templates Sequence[GetHealthCheckTemplatesTemplate]
health_check_template_ids Sequence[str]
health_check_template_name str
name_regex str
output_file str

Supporting Types

GetHealthCheckTemplatesTemplate

HealthCheckCodes List<string>
The HTTP status code that indicates a successful health check.
HealthCheckConnectPort int
The number of the port that is used for health checks. Valid values: 0 to 65535. Default value: 0. This default value indicates that the backend server is used for health checks.
HealthCheckHost string
The domain name that is used for health checks. Default value: $SERVER_IP. The domain name must be 1 to 80 characters in length.
HealthCheckHttpVersion string
The version of the HTTP protocol. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1.
HealthCheckInterval int
The time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Default value: 2.
HealthCheckMethod string
The health check method. Valid values: GET and HEAD. Default value: HEAD.
HealthCheckPath string
The URL that is used for health checks. The URL must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( )* [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).
HealthCheckProtocol string
The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
HealthCheckTemplateId string
The ID of the resource.
HealthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
HealthCheckTimeout int
The timeout period of a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Valid values: 1 to 300. Unit: seconds. Default value: 5.
HealthyThreshold int
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10. Default value: 3. Unit: seconds.
Id string
The ID of the Health Check Template.
UnhealthyThreshold int
The number of times that an healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10. Default value: 3. Unit: seconds.
HealthCheckCodes []string
The HTTP status code that indicates a successful health check.
HealthCheckConnectPort int
The number of the port that is used for health checks. Valid values: 0 to 65535. Default value: 0. This default value indicates that the backend server is used for health checks.
HealthCheckHost string
The domain name that is used for health checks. Default value: $SERVER_IP. The domain name must be 1 to 80 characters in length.
HealthCheckHttpVersion string
The version of the HTTP protocol. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1.
HealthCheckInterval int
The time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Default value: 2.
HealthCheckMethod string
The health check method. Valid values: GET and HEAD. Default value: HEAD.
HealthCheckPath string
The URL that is used for health checks. The URL must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( )* [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).
HealthCheckProtocol string
The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
HealthCheckTemplateId string
The ID of the resource.
HealthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
HealthCheckTimeout int
The timeout period of a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Valid values: 1 to 300. Unit: seconds. Default value: 5.
HealthyThreshold int
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10. Default value: 3. Unit: seconds.
Id string
The ID of the Health Check Template.
UnhealthyThreshold int
The number of times that an healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10. Default value: 3. Unit: seconds.
healthCheckCodes string[]
The HTTP status code that indicates a successful health check.
healthCheckConnectPort number
The number of the port that is used for health checks. Valid values: 0 to 65535. Default value: 0. This default value indicates that the backend server is used for health checks.
healthCheckHost string
The domain name that is used for health checks. Default value: $SERVER_IP. The domain name must be 1 to 80 characters in length.
healthCheckHttpVersion string
The version of the HTTP protocol. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1.
healthCheckInterval number
The time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Default value: 2.
healthCheckMethod string
The health check method. Valid values: GET and HEAD. Default value: HEAD.
healthCheckPath string
The URL that is used for health checks. The URL must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( )* [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).
healthCheckProtocol string
The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
healthCheckTemplateId string
The ID of the resource.
healthCheckTemplateName string
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
healthCheckTimeout number
The timeout period of a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Valid values: 1 to 300. Unit: seconds. Default value: 5.
healthyThreshold number
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10. Default value: 3. Unit: seconds.
id string
The ID of the Health Check Template.
unhealthyThreshold number
The number of times that an healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10. Default value: 3. Unit: seconds.
health_check_codes Sequence[str]
The HTTP status code that indicates a successful health check.
health_check_connect_port int
The number of the port that is used for health checks. Valid values: 0 to 65535. Default value: 0. This default value indicates that the backend server is used for health checks.
health_check_host str
The domain name that is used for health checks. Default value: $SERVER_IP. The domain name must be 1 to 80 characters in length.
health_check_http_version str
The version of the HTTP protocol. Valid values: HTTP1.0 and HTTP1.1. Default value: HTTP1.1.
health_check_interval int
The time interval between two consecutive health checks. Valid values: 1 to 50. Unit: seconds. Default value: 2.
health_check_method str
The health check method. Valid values: GET and HEAD. Default value: HEAD.
health_check_path str
The URL that is used for health checks. The URL must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( )* [ ] @ $ ^ : ' , +. The URL must start with a forward slash (/).
health_check_protocol str
The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
health_check_template_id str
The ID of the resource.
health_check_template_name str
The name of the health check template. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
health_check_timeout int
The timeout period of a health check response. If the backend Elastic Compute Service (ECS) instance does not send an expected response within the specified period of time, the health check fails. Valid values: 1 to 300. Unit: seconds. Default value: 5.
healthy_threshold int
The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy (from fail to success). Valid values: 2 to 10. Default value: 3. Unit: seconds.
id str
The ID of the Health Check Template.
unhealthy_threshold int
The number of times that an healthy backend server must consecutively fail health checks before it is declared unhealthy (from success to fail). Valid values: 2 to 10. Default value: 3. Unit: seconds.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.