All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.apprunner.alpha.HttpHealthCheckOptions Maven / Gradle / Ivy

package software.amazon.awscdk.services.apprunner.alpha;

/**
 * (experimental) Properties used to define HTTP Based healthchecks.
 * 

* Example: *

*

 * Service.Builder.create(this, "Service")
 *         .source(Source.fromEcrPublic(EcrPublicProps.builder()
 *                 .imageConfiguration(ImageConfiguration.builder().port(8000).build())
 *                 .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
 *                 .build()))
 *         .healthCheck(HealthCheck.http(HttpHealthCheckOptions.builder()
 *                 .healthyThreshold(5)
 *                 .interval(Duration.seconds(10))
 *                 .path("/")
 *                 .timeout(Duration.seconds(10))
 *                 .unhealthyThreshold(10)
 *                 .build()))
 *         .build();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-17T21:37:41.217Z") @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.apprunner.alpha.$Module.class, fqn = "@aws-cdk/aws-apprunner-alpha.HttpHealthCheckOptions") @software.amazon.jsii.Jsii.Proxy(HttpHealthCheckOptions.Jsii$Proxy.class) @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public interface HttpHealthCheckOptions extends software.amazon.jsii.JsiiSerializable { /** * (experimental) The number of consecutive checks that must succeed before App Runner decides that the service is healthy. *

* Default: 1 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getHealthyThreshold() { return null; } /** * (experimental) The time interval, in seconds, between health checks. *

* Default: Duration.seconds(5) */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getInterval() { return null; } /** * (experimental) The URL that health check requests are sent to. *

* Default: / */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.String getPath() { return null; } /** * (experimental) The time, in seconds, to wait for a health check response before deciding it failed. *

* Default: Duration.seconds(2) */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getTimeout() { return null; } /** * (experimental) The number of consecutive checks that must fail before App Runner decides that the service is unhealthy. *

* Default: 5 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getUnhealthyThreshold() { return null; } /** * @return a {@link Builder} of {@link HttpHealthCheckOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link HttpHealthCheckOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { java.lang.Number healthyThreshold; software.amazon.awscdk.Duration interval; java.lang.String path; software.amazon.awscdk.Duration timeout; java.lang.Number unhealthyThreshold; /** * Sets the value of {@link HttpHealthCheckOptions#getHealthyThreshold} * @param healthyThreshold The number of consecutive checks that must succeed before App Runner decides that the service is healthy. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder healthyThreshold(java.lang.Number healthyThreshold) { this.healthyThreshold = healthyThreshold; return this; } /** * Sets the value of {@link HttpHealthCheckOptions#getInterval} * @param interval The time interval, in seconds, between health checks. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder interval(software.amazon.awscdk.Duration interval) { this.interval = interval; return this; } /** * Sets the value of {@link HttpHealthCheckOptions#getPath} * @param path The URL that health check requests are sent to. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder path(java.lang.String path) { this.path = path; return this; } /** * Sets the value of {@link HttpHealthCheckOptions#getTimeout} * @param timeout The time, in seconds, to wait for a health check response before deciding it failed. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder timeout(software.amazon.awscdk.Duration timeout) { this.timeout = timeout; return this; } /** * Sets the value of {@link HttpHealthCheckOptions#getUnhealthyThreshold} * @param unhealthyThreshold The number of consecutive checks that must fail before App Runner decides that the service is unhealthy. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder unhealthyThreshold(java.lang.Number unhealthyThreshold) { this.unhealthyThreshold = unhealthyThreshold; return this; } /** * Builds the configured instance. * @return a new instance of {@link HttpHealthCheckOptions} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public HttpHealthCheckOptions build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link HttpHealthCheckOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements HttpHealthCheckOptions { private final java.lang.Number healthyThreshold; private final software.amazon.awscdk.Duration interval; private final java.lang.String path; private final software.amazon.awscdk.Duration timeout; private final java.lang.Number unhealthyThreshold; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.healthyThreshold = software.amazon.jsii.Kernel.get(this, "healthyThreshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.interval = software.amazon.jsii.Kernel.get(this, "interval", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class)); this.path = software.amazon.jsii.Kernel.get(this, "path", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.timeout = software.amazon.jsii.Kernel.get(this, "timeout", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class)); this.unhealthyThreshold = software.amazon.jsii.Kernel.get(this, "unhealthyThreshold", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.healthyThreshold = builder.healthyThreshold; this.interval = builder.interval; this.path = builder.path; this.timeout = builder.timeout; this.unhealthyThreshold = builder.unhealthyThreshold; } @Override public final java.lang.Number getHealthyThreshold() { return this.healthyThreshold; } @Override public final software.amazon.awscdk.Duration getInterval() { return this.interval; } @Override public final java.lang.String getPath() { return this.path; } @Override public final software.amazon.awscdk.Duration getTimeout() { return this.timeout; } @Override public final java.lang.Number getUnhealthyThreshold() { return this.unhealthyThreshold; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); if (this.getHealthyThreshold() != null) { data.set("healthyThreshold", om.valueToTree(this.getHealthyThreshold())); } if (this.getInterval() != null) { data.set("interval", om.valueToTree(this.getInterval())); } if (this.getPath() != null) { data.set("path", om.valueToTree(this.getPath())); } if (this.getTimeout() != null) { data.set("timeout", om.valueToTree(this.getTimeout())); } if (this.getUnhealthyThreshold() != null) { data.set("unhealthyThreshold", om.valueToTree(this.getUnhealthyThreshold())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@aws-cdk/aws-apprunner-alpha.HttpHealthCheckOptions")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HttpHealthCheckOptions.Jsii$Proxy that = (HttpHealthCheckOptions.Jsii$Proxy) o; if (this.healthyThreshold != null ? !this.healthyThreshold.equals(that.healthyThreshold) : that.healthyThreshold != null) return false; if (this.interval != null ? !this.interval.equals(that.interval) : that.interval != null) return false; if (this.path != null ? !this.path.equals(that.path) : that.path != null) return false; if (this.timeout != null ? !this.timeout.equals(that.timeout) : that.timeout != null) return false; return this.unhealthyThreshold != null ? this.unhealthyThreshold.equals(that.unhealthyThreshold) : that.unhealthyThreshold == null; } @Override public final int hashCode() { int result = this.healthyThreshold != null ? this.healthyThreshold.hashCode() : 0; result = 31 * result + (this.interval != null ? this.interval.hashCode() : 0); result = 31 * result + (this.path != null ? this.path.hashCode() : 0); result = 31 * result + (this.timeout != null ? this.timeout.hashCode() : 0); result = 31 * result + (this.unhealthyThreshold != null ? this.unhealthyThreshold.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy