Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.alb.getHealthCheckTemplates
Explore with Pulumi AI
This data source provides the Alb Health Check Templates of the current Alibaba Cloud user.
NOTE: Available in v1.134.0+.
Example Usage
Basic Usage
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);
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)
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)
nameRegex, err := alb.GetHealthCheckTemplates(ctx, &alb.GetHealthCheckTemplatesArgs{
NameRegex: pulumi.StringRef("^my-HealthCheckTemplate"),
}, nil)
if err != nil {
return err
}
ctx.Export("albHealthCheckTemplateId2", nameRegex.Templates[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Alb.GetHealthCheckTemplates.Invoke(new()
{
Ids = new[]
{
"example_id",
},
});
var nameRegex = AliCloud.Alb.GetHealthCheckTemplates.Invoke(new()
{
NameRegex = "^my-HealthCheckTemplate",
});
return new Dictionary<string, object?>
{
["albHealthCheckTemplateId1"] = ids.Apply(getHealthCheckTemplatesResult => getHealthCheckTemplatesResult.Templates[0]?.Id),
["albHealthCheckTemplateId2"] = nameRegex.Apply(getHealthCheckTemplatesResult => getHealthCheckTemplatesResult.Templates[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.alb.AlbFunctions;
import com.pulumi.alicloud.alb.inputs.GetHealthCheckTemplatesArgs;
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) {
final var ids = AlbFunctions.getHealthCheckTemplates(GetHealthCheckTemplatesArgs.builder()
.ids("example_id")
.build());
ctx.export("albHealthCheckTemplateId1", ids.applyValue(getHealthCheckTemplatesResult -> getHealthCheckTemplatesResult.templates()[0].id()));
final var nameRegex = AlbFunctions.getHealthCheckTemplates(GetHealthCheckTemplatesArgs.builder()
.nameRegex("^my-HealthCheckTemplate")
.build());
ctx.export("albHealthCheckTemplateId2", nameRegex.applyValue(getHealthCheckTemplatesResult -> getHealthCheckTemplatesResult.templates()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:alb:getHealthCheckTemplates
Arguments:
ids:
- example_id
nameRegex:
fn::invoke:
Function: alicloud:alb:getHealthCheckTemplates
Arguments:
nameRegex: ^my-HealthCheckTemplate
outputs:
albHealthCheckTemplateId1: ${ids.templates[0].id}
albHealthCheckTemplateId2: ${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)
}
public static CompletableFuture<GetHealthCheckTemplatesResult> getHealthCheckTemplates(GetHealthCheckTemplatesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:alb/getHealthCheckTemplates:getHealthCheckTemplates
arguments:
# arguments dictionary
The following arguments are supported:
- Health
Check List<string>Template Ids - The health check template ids.
- Health
Check stringTemplate Name - 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.
- Name
Regex string - A regex string to filter results by Health Check Template name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Health
Check []stringTemplate Ids - The health check template ids.
- Health
Check stringTemplate Name - 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.
- Name
Regex string - A regex string to filter results by Health Check Template name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- health
Check List<String>Template Ids - The health check template ids.
- health
Check StringTemplate Name - 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.
- name
Regex String - A regex string to filter results by Health Check Template name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- health
Check string[]Template Ids - The health check template ids.
- health
Check stringTemplate Name - 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.
- name
Regex string - A regex string to filter results by Health Check Template name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- health_
check_ Sequence[str]template_ ids - The health check template ids.
- health_
check_ strtemplate_ name - 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 - File name where to save data source results (after running
pulumi preview
).
- health
Check List<String>Template Ids - The health check template ids.
- health
Check StringTemplate Name - 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.
- name
Regex String - A regex string to filter results by Health Check Template name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
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.
Ali Cloud. Alb. Outputs. Get Health Check Templates Template> - Health
Check List<string>Template Ids - Health
Check stringTemplate Name - Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Templates
[]Get
Health Check Templates Template - Health
Check []stringTemplate Ids - Health
Check stringTemplate Name - Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- templates
List<Get
Health Check Templates Template> - health
Check List<String>Template Ids - health
Check StringTemplate Name - name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- templates
Get
Health Check Templates Template[] - health
Check string[]Template Ids - health
Check stringTemplate Name - name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- templates
Sequence[Get
Health Check Templates Template] - health_
check_ Sequence[str]template_ ids - health_
check_ strtemplate_ name - name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- templates List<Property Map>
- health
Check List<String>Template Ids - health
Check StringTemplate Name - name
Regex String - output
File String
Supporting Types
GetHealthCheckTemplatesTemplate
- Health
Check List<string>Codes - The HTTP status code that indicates a successful health check.
- Health
Check intConnect Port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - Health
Check stringHost - 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 stringHttp Version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - Health
Check intInterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - Health
Check stringMethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - Health
Check stringPath - 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 stringProtocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- Health
Check stringTemplate Id - The ID of the resource.
- Health
Check stringTemplate Name - 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 intTimeout - 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
to300
. 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
to10
. Default value:3
. Unit: seconds. - Id string
- 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
to10
. Default value:3
. Unit: seconds.
- Health
Check []stringCodes - The HTTP status code that indicates a successful health check.
- Health
Check intConnect Port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - Health
Check stringHost - 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 stringHttp Version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - Health
Check intInterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - Health
Check stringMethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - Health
Check stringPath - 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 stringProtocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- Health
Check stringTemplate Id - The ID of the resource.
- Health
Check stringTemplate Name - 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 intTimeout - 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
to300
. 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
to10
. Default value:3
. Unit: seconds. - Id string
- 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
to10
. Default value:3
. Unit: seconds.
- health
Check List<String>Codes - The HTTP status code that indicates a successful health check.
- health
Check IntegerConnect Port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - health
Check StringHost - 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 StringHttp Version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - health
Check IntegerInterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - health
Check StringMethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - health
Check StringPath - 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 StringProtocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- health
Check StringTemplate Id - The ID of the resource.
- health
Check StringTemplate Name - 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 IntegerTimeout - 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
to300
. Unit: seconds. Default value:5
. - healthy
Threshold Integer - 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
to10
. Default value:3
. Unit: seconds. - id String
- The ID of the Health Check Template.
- unhealthy
Threshold Integer - 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
to10
. Default value:3
. Unit: seconds.
- health
Check string[]Codes - The HTTP status code that indicates a successful health check.
- health
Check numberConnect Port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - health
Check stringHost - 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 stringHttp Version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - health
Check numberInterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - health
Check stringMethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - health
Check stringPath - 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 stringProtocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- health
Check stringTemplate Id - The ID of the resource.
- health
Check stringTemplate Name - 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 numberTimeout - 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
to300
. Unit: seconds. Default value:5
. - healthy
Threshold 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
to10
. Default value:3
. Unit: seconds. - id string
- The ID of the Health Check Template.
- unhealthy
Threshold 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
to10
. Default value:3
. Unit: seconds.
- health_
check_ Sequence[str]codes - The HTTP status code that indicates a successful health check.
- health_
check_ intconnect_ port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - health_
check_ strhost - 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_ strhttp_ version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - health_
check_ intinterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - health_
check_ strmethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - health_
check_ strpath - 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_ strprotocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- health_
check_ strtemplate_ id - The ID of the resource.
- health_
check_ strtemplate_ name - 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_ inttimeout - 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
to300
. 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
to10
. 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
to10
. Default value:3
. Unit: seconds.
- health
Check List<String>Codes - The HTTP status code that indicates a successful health check.
- health
Check NumberConnect Port - The number of the port that is used for health checks. Valid values:
0
to65535
. Default value:0
. This default value indicates that the backend server is used for health checks. - health
Check StringHost - 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 StringHttp Version - The version of the HTTP protocol. Valid values:
HTTP1.0
andHTTP1.1
. Default value:HTTP1.1
. - health
Check NumberInterval - The time interval between two consecutive health checks. Valid values:
1
to50
. Unit: seconds. Default value:2
. - health
Check StringMethod - The health check method. Valid values:
GET
andHEAD
. Default value:HEAD
. - health
Check StringPath - 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 StringProtocol - The protocol that is used for health checks. Valid values: HTTP and TCP. Default value: HTTP.
- health
Check StringTemplate Id - The ID of the resource.
- health
Check StringTemplate Name - 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 NumberTimeout - 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
to300
. Unit: seconds. Default value:5
. - healthy
Threshold 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
to10
. Default value:3
. Unit: seconds. - id String
- The ID of the Health Check Template.
- unhealthy
Threshold 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
to10
. Default value:3
. Unit: seconds.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.