Class HealthCheck


  • public class HealthCheck
    extends com.pulumi.resources.CustomResource
    Provides a Route53 health check. ## Example Usage ### Connectivity and HTTP Status Code Check <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.route53.HealthCheck;
     import com.pulumi.aws.route53.HealthCheckArgs;
     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 example = new HealthCheck("example", HealthCheckArgs.builder()        
                 .fqdn("example.com")
                 .port(80)
                 .type("HTTP")
                 .resourcePath("/")
                 .failureThreshold("5")
                 .requestInterval("30")
                 .tags(Map.of("Name", "tf-test-health-check"))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Connectivity and String Matching Check <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.route53.HealthCheck;
     import com.pulumi.aws.route53.HealthCheckArgs;
     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 example = new HealthCheck("example", HealthCheckArgs.builder()        
                 .failureThreshold("5")
                 .fqdn("example.com")
                 .port(443)
                 .requestInterval("30")
                 .resourcePath("/")
                 .searchString("example")
                 .type("HTTPS_STR_MATCH")
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Aggregate Check <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.route53.HealthCheck;
     import com.pulumi.aws.route53.HealthCheckArgs;
     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 parent = new HealthCheck("parent", HealthCheckArgs.builder()        
                 .type("CALCULATED")
                 .childHealthThreshold(1)
                 .childHealthchecks(child.id())
                 .tags(Map.of("Name", "tf-test-calculated-health-check"))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### CloudWatch Alarm Check <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cloudwatch.MetricAlarm;
     import com.pulumi.aws.cloudwatch.MetricAlarmArgs;
     import com.pulumi.aws.route53.HealthCheck;
     import com.pulumi.aws.route53.HealthCheckArgs;
     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 foobar = new MetricAlarm("foobar", MetricAlarmArgs.builder()        
                 .name("test-foobar5")
                 .comparisonOperator("GreaterThanOrEqualToThreshold")
                 .evaluationPeriods("2")
                 .metricName("CPUUtilization")
                 .namespace("AWS/EC2")
                 .period("120")
                 .statistic("Average")
                 .threshold("80")
                 .alarmDescription("This metric monitors ec2 cpu utilization")
                 .build());
     
             var foo = new HealthCheck("foo", HealthCheckArgs.builder()        
                 .type("CLOUDWATCH_METRIC")
                 .cloudwatchAlarmName(foobar.name())
                 .cloudwatchAlarmRegion("us-west-2")
                 .insufficientDataHealthStatus("Healthy")
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import Route53 Health Checks using the health check `id`. For example: ```sh $ pulumi import aws:route53/healthCheck:HealthCheck http_check abcdef11-2222-3333-4444-555555fedcba ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> childHealthchecks()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> childHealthThreshold()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmName()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmRegion()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disabled()  
      com.pulumi.core.Output<java.lang.Boolean> enableSni()  
      com.pulumi.core.Output<java.lang.Integer> failureThreshold()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> fqdn()  
      static HealthCheck get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, HealthCheckState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> insufficientDataHealthStatus()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> invertHealthcheck()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> ipAddress()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> measureLatency()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> port()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> referenceName()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> regions()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> requestInterval()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> resourcePath()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> routingControlArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> searchString()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> type()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HealthCheck

        public HealthCheck​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • HealthCheck

        public HealthCheck​(java.lang.String name,
                           HealthCheckArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • HealthCheck

        public HealthCheck​(java.lang.String name,
                           HealthCheckArgs args,
                           @Nullable
                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The Amazon Resource Name (ARN) of the Health Check.
      • childHealthThreshold

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> childHealthThreshold()
        Returns:
        The minimum number of child health checks that must be healthy for Route 53 to consider the parent health check to be healthy. Valid values are integers between 0 and 256, inclusive
      • childHealthchecks

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> childHealthchecks()
        Returns:
        For a specified parent health check, a list of HealthCheckId values for the associated child health checks.
      • cloudwatchAlarmName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmName()
        Returns:
        The name of the CloudWatch alarm.
      • cloudwatchAlarmRegion

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> cloudwatchAlarmRegion()
        Returns:
        The CloudWatchRegion that the CloudWatch alarm was created in.
      • disabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> disabled()
        Returns:
        A boolean value that stops Route 53 from performing health checks. When set to true, Route 53 will do the following depending on the type of health check: * For health checks that check the health of endpoints, Route5 53 stops submitting requests to your application, server, or other resource. * For calculated health checks, Route 53 stops aggregating the status of the referenced health checks. * For health checks that monitor CloudWatch alarms, Route 53 stops monitoring the corresponding CloudWatch metrics. > **Note:** After you disable a health check, Route 53 considers the status of the health check to always be healthy. If you configured DNS failover, Route 53 continues to route traffic to the corresponding resources. If you want to stop routing traffic to a resource, change the value of `invert_healthcheck`.
      • enableSni

        public com.pulumi.core.Output<java.lang.Boolean> enableSni()
        Returns:
        A boolean value that indicates whether Route53 should send the `fqdn` to the endpoint when performing the health check. This defaults to AWS' defaults: when the `type` is "HTTPS" `enable_sni` defaults to `true`, when `type` is anything else `enable_sni` defaults to `false`.
      • failureThreshold

        public com.pulumi.core.Output<java.lang.Integer> failureThreshold()
        Returns:
        The number of consecutive health checks that an endpoint must pass or fail.
      • fqdn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> fqdn()
        Returns:
        The fully qualified domain name of the endpoint to be checked. If a value is set for `ip_address`, the value set for `fqdn` will be passed in the `Host` header.
      • insufficientDataHealthStatus

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> insufficientDataHealthStatus()
        Returns:
        The status of the health check when CloudWatch has insufficient data about the state of associated alarm. Valid values are `Healthy` , `Unhealthy` and `LastKnownStatus`.
      • invertHealthcheck

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> invertHealthcheck()
        Returns:
        A boolean value that indicates whether the status of health check should be inverted. For example, if a health check is healthy but Inverted is True , then Route 53 considers the health check to be unhealthy.
      • ipAddress

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> ipAddress()
        Returns:
        The IP address of the endpoint to be checked.
      • measureLatency

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> measureLatency()
        Returns:
        A Boolean value that indicates whether you want Route 53 to measure the latency between health checkers in multiple AWS regions and your endpoint and to display CloudWatch latency graphs in the Route 53 console.
      • port

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> port()
        Returns:
        The port of the endpoint to be checked.
      • referenceName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> referenceName()
        Returns:
        This is a reference name used in Caller Reference (helpful for identifying single health_check set amongst others)
      • regions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> regions()
        Returns:
        A list of AWS regions that you want Amazon Route 53 health checkers to check the specified endpoint from.
      • requestInterval

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> requestInterval()
        Returns:
        The number of seconds between the time that Amazon Route 53 gets a response from your endpoint and the time that it sends the next health-check request.
      • resourcePath

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> resourcePath()
        Returns:
        The path that you want Amazon Route 53 to request when performing health checks.
      • routingControlArn

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> routingControlArn()
        Returns:
        The Amazon Resource Name (ARN) for the Route 53 Application Recovery Controller routing control. This is used when health check type is `RECOVERY_CONTROL`
      • searchString

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> searchString()
        Returns:
        String searched in the first 5120 bytes of the response body for check to be considered healthy. Only valid with `HTTP_STR_MATCH` and `HTTPS_STR_MATCH`.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A map of tags to assign to the health check. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • type

        public com.pulumi.core.Output<java.lang.String> type()
        Returns:
        The protocol to use when performing health checks. Valid values are `HTTP`, `HTTPS`, `HTTP_STR_MATCH`, `HTTPS_STR_MATCH`, `TCP`, `CALCULATED`, `CLOUDWATCH_METRIC` and `RECOVERY_CONTROL`.
      • get

        public static HealthCheck get​(java.lang.String name,
                                      com.pulumi.core.Output<java.lang.String> id,
                                      @Nullable
                                      HealthCheckState state,
                                      @Nullable
                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.