software.amazon.awscdk.services.apprunner.alpha.AutoScalingConfigurationProps Maven / Gradle / Ivy
Show all versions of apprunner-alpha Show documentation
package software.amazon.awscdk.services.apprunner.alpha;
/**
* (experimental) Properties of the App Runner Auto Scaling Configuration.
*
* Example:
*
*
* AutoScalingConfiguration autoScalingConfiguration = AutoScalingConfiguration.Builder.create(this, "AutoScalingConfiguration")
* .autoScalingConfigurationName("MyAutoScalingConfiguration")
* .maxConcurrency(150)
* .maxSize(20)
* .minSize(5)
* .build();
* Service.Builder.create(this, "DemoService")
* .source(Source.fromEcrPublic(EcrPublicProps.builder()
* .imageConfiguration(ImageConfiguration.builder().port(8000).build())
* .imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
* .build()))
* .autoScalingConfiguration(autoScalingConfiguration)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-17T21:37:41.210Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.apprunner.alpha.$Module.class, fqn = "@aws-cdk/aws-apprunner-alpha.AutoScalingConfigurationProps")
@software.amazon.jsii.Jsii.Proxy(AutoScalingConfigurationProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AutoScalingConfigurationProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The name for the Auto Scaling Configuration.
*
* Default: - a name generated by CloudFormation
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getAutoScalingConfigurationName() {
return null;
}
/**
* (experimental) The maximum number of concurrent requests that an instance processes.
*
* If the number of concurrent requests exceeds this limit, App Runner scales the service up.
*
* Must be between 1 and 200.
*
* Default: 100
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxConcurrency() {
return null;
}
/**
* (experimental) The maximum number of instances that a service scales up to.
*
* At most maxSize instances actively serve traffic for your service.
*
* Must be between 1 and 25.
*
* Default: 25
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxSize() {
return null;
}
/**
* (experimental) The minimum number of instances that App Runner provisions for a service.
*
* The service always has at least minSize provisioned instances.
*
* Must be between 1 and 25.
*
* Default: 1
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMinSize() {
return null;
}
/**
* @return a {@link Builder} of {@link AutoScalingConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AutoScalingConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String autoScalingConfigurationName;
java.lang.Number maxConcurrency;
java.lang.Number maxSize;
java.lang.Number minSize;
/**
* Sets the value of {@link AutoScalingConfigurationProps#getAutoScalingConfigurationName}
* @param autoScalingConfigurationName The name for the Auto Scaling Configuration.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoScalingConfigurationName(java.lang.String autoScalingConfigurationName) {
this.autoScalingConfigurationName = autoScalingConfigurationName;
return this;
}
/**
* Sets the value of {@link AutoScalingConfigurationProps#getMaxConcurrency}
* @param maxConcurrency The maximum number of concurrent requests that an instance processes.
* If the number of concurrent requests exceeds this limit, App Runner scales the service up.
*
* Must be between 1 and 200.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maxConcurrency(java.lang.Number maxConcurrency) {
this.maxConcurrency = maxConcurrency;
return this;
}
/**
* Sets the value of {@link AutoScalingConfigurationProps#getMaxSize}
* @param maxSize The maximum number of instances that a service scales up to.
* At most maxSize instances actively serve traffic for your service.
*
* Must be between 1 and 25.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maxSize(java.lang.Number maxSize) {
this.maxSize = maxSize;
return this;
}
/**
* Sets the value of {@link AutoScalingConfigurationProps#getMinSize}
* @param minSize The minimum number of instances that App Runner provisions for a service.
* The service always has at least minSize provisioned instances.
*
* Must be between 1 and 25.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder minSize(java.lang.Number minSize) {
this.minSize = minSize;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AutoScalingConfigurationProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AutoScalingConfigurationProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AutoScalingConfigurationProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AutoScalingConfigurationProps {
private final java.lang.String autoScalingConfigurationName;
private final java.lang.Number maxConcurrency;
private final java.lang.Number maxSize;
private final java.lang.Number minSize;
/**
* 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.autoScalingConfigurationName = software.amazon.jsii.Kernel.get(this, "autoScalingConfigurationName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.maxConcurrency = software.amazon.jsii.Kernel.get(this, "maxConcurrency", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.maxSize = software.amazon.jsii.Kernel.get(this, "maxSize", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.minSize = software.amazon.jsii.Kernel.get(this, "minSize", 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.autoScalingConfigurationName = builder.autoScalingConfigurationName;
this.maxConcurrency = builder.maxConcurrency;
this.maxSize = builder.maxSize;
this.minSize = builder.minSize;
}
@Override
public final java.lang.String getAutoScalingConfigurationName() {
return this.autoScalingConfigurationName;
}
@Override
public final java.lang.Number getMaxConcurrency() {
return this.maxConcurrency;
}
@Override
public final java.lang.Number getMaxSize() {
return this.maxSize;
}
@Override
public final java.lang.Number getMinSize() {
return this.minSize;
}
@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.getAutoScalingConfigurationName() != null) {
data.set("autoScalingConfigurationName", om.valueToTree(this.getAutoScalingConfigurationName()));
}
if (this.getMaxConcurrency() != null) {
data.set("maxConcurrency", om.valueToTree(this.getMaxConcurrency()));
}
if (this.getMaxSize() != null) {
data.set("maxSize", om.valueToTree(this.getMaxSize()));
}
if (this.getMinSize() != null) {
data.set("minSize", om.valueToTree(this.getMinSize()));
}
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.AutoScalingConfigurationProps"));
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;
AutoScalingConfigurationProps.Jsii$Proxy that = (AutoScalingConfigurationProps.Jsii$Proxy) o;
if (this.autoScalingConfigurationName != null ? !this.autoScalingConfigurationName.equals(that.autoScalingConfigurationName) : that.autoScalingConfigurationName != null) return false;
if (this.maxConcurrency != null ? !this.maxConcurrency.equals(that.maxConcurrency) : that.maxConcurrency != null) return false;
if (this.maxSize != null ? !this.maxSize.equals(that.maxSize) : that.maxSize != null) return false;
return this.minSize != null ? this.minSize.equals(that.minSize) : that.minSize == null;
}
@Override
public final int hashCode() {
int result = this.autoScalingConfigurationName != null ? this.autoScalingConfigurationName.hashCode() : 0;
result = 31 * result + (this.maxConcurrency != null ? this.maxConcurrency.hashCode() : 0);
result = 31 * result + (this.maxSize != null ? this.maxSize.hashCode() : 0);
result = 31 * result + (this.minSize != null ? this.minSize.hashCode() : 0);
return result;
}
}
}