io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerExtension Maven / Gradle / Ivy
Show all versions of cdk-ecs-service-extensions Show documentation
package io.github.cdklabs.cdkecsserviceextensions;
/**
* (experimental) This extension add a public facing load balancer for sending traffic to one or more replicas of the application container.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-21T00:38:42.474Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkecsserviceextensions.$Module.class, fqn = "@aws-cdk-containers/ecs-service-extensions.HttpLoadBalancerExtension")
public class HttpLoadBalancerExtension extends io.github.cdklabs.cdkecsserviceextensions.ServiceExtension {
protected HttpLoadBalancerExtension(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected HttpLoadBalancerExtension(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public HttpLoadBalancerExtension(final @org.jetbrains.annotations.Nullable io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { props });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public HttpLoadBalancerExtension() {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this);
}
/**
* (experimental) Prior to launching the task definition as a service, this hook is called on each extension to give it a chance to mutate the properties of the service to be created.
*
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.ServiceBuild modifyServiceProps(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.ServiceBuild props) {
return software.amazon.jsii.Kernel.call(this, "modifyServiceProps", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkecsserviceextensions.ServiceBuild.class), new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) A hook that is called for each extension ahead of time to allow for any initial setup, such as creating resources in advance.
*
* @param service This parameter is required.
* @param scope This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public void prehook(final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdkecsserviceextensions.Service service, final @org.jetbrains.annotations.NotNull software.constructs.Construct scope) {
software.amazon.jsii.Kernel.call(this, "prehook", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required"), java.util.Objects.requireNonNull(scope, "scope is required") });
}
/**
* (experimental) When this hook is implemented by extension, it allows the extension to use the service which has been created.
*
* It is generally used to
* create any final resources which might depend on the service itself.
*
* @param service This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public void useService(final @org.jetbrains.annotations.NotNull java.lang.Object service) {
if (software.amazon.jsii.Configuration.getRuntimeTypeChecking()) {
if (
!(service instanceof software.amazon.awscdk.services.ecs.Ec2Service)
&& !(service instanceof software.amazon.awscdk.services.ecs.FargateService)
) {
throw new IllegalArgumentException(
new java.lang.StringBuilder("Expected ")
.append("service")
.append(" to be one of: software.amazon.awscdk.services.ecs.Ec2Service, software.amazon.awscdk.services.ecs.FargateService; received ")
.append(service.getClass()).toString());
}
}
software.amazon.jsii.Kernel.call(this, "useService", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(service, "service is required") });
}
/**
* (experimental) A fluent builder for {@link io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerExtension}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create() {
return new Builder();
}
private io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerProps.Builder props;
private Builder() {
}
/**
* (experimental) The number of ALB requests per target.
*
* @return {@code this}
* @param requestsPerTarget The number of ALB requests per target. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder requestsPerTarget(final java.lang.Number requestsPerTarget) {
this.props().requestsPerTarget(requestsPerTarget);
return this;
}
/**
* @return a newly built instance of {@link io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerExtension}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerExtension build() {
return new io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerExtension(
this.props != null ? this.props.build() : null
);
}
private io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerProps.Builder props() {
if (this.props == null) {
this.props = new io.github.cdklabs.cdkecsserviceextensions.HttpLoadBalancerProps.Builder();
}
return this.props;
}
}
}