org.cdk8s.plus22.IngressTls Maven / Gradle / Ivy
Show all versions of cdk8s-plus-22 Show documentation
package org.cdk8s.plus22;
/**
* Represents the TLS configuration mapping that is passed to the ingress controller for SSL termination.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.47.0 (build 86d2c33)", date = "2021-12-08T00:16:55.103Z")
@software.amazon.jsii.Jsii(module = org.cdk8s.plus22.$Module.class, fqn = "cdk8s-plus-22.IngressTls")
@software.amazon.jsii.Jsii.Proxy(IngressTls.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface IngressTls extends software.amazon.jsii.JsiiSerializable {
/**
* Hosts are a list of hosts included in the TLS certificate.
*
* The values in
* this list must match the name/s used in the TLS Secret.
*
* Default: - If unspecified, it defaults to the wildcard host setting for
* the loadbalancer controller fulfilling this Ingress.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getHosts() {
return null;
}
/**
* Secret is the secret that contains the certificate and key used to terminate SSL traffic on 443.
*
* If the SNI host in a listener conflicts with
* the "Host" header field used by an IngressRule, the SNI host is used for
* termination and value of the Host header is used for routing.
*
* Default: - If unspecified, it allows SSL routing based on SNI hostname.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable org.cdk8s.plus22.ISecret getSecret() {
return null;
}
/**
* @return a {@link Builder} of {@link IngressTls}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link IngressTls}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List hosts;
org.cdk8s.plus22.ISecret secret;
/**
* Sets the value of {@link IngressTls#getHosts}
* @param hosts Hosts are a list of hosts included in the TLS certificate.
* The values in
* this list must match the name/s used in the TLS Secret.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder hosts(java.util.List hosts) {
this.hosts = hosts;
return this;
}
/**
* Sets the value of {@link IngressTls#getSecret}
* @param secret Secret is the secret that contains the certificate and key used to terminate SSL traffic on 443.
* If the SNI host in a listener conflicts with
* the "Host" header field used by an IngressRule, the SNI host is used for
* termination and value of the Host header is used for routing.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder secret(org.cdk8s.plus22.ISecret secret) {
this.secret = secret;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link IngressTls}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public IngressTls build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link IngressTls}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements IngressTls {
private final java.util.List hosts;
private final org.cdk8s.plus22.ISecret secret;
/**
* 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.hosts = software.amazon.jsii.Kernel.get(this, "hosts", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.secret = software.amazon.jsii.Kernel.get(this, "secret", software.amazon.jsii.NativeType.forClass(org.cdk8s.plus22.ISecret.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.hosts = builder.hosts;
this.secret = builder.secret;
}
@Override
public final java.util.List getHosts() {
return this.hosts;
}
@Override
public final org.cdk8s.plus22.ISecret getSecret() {
return this.secret;
}
@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.getHosts() != null) {
data.set("hosts", om.valueToTree(this.getHosts()));
}
if (this.getSecret() != null) {
data.set("secret", om.valueToTree(this.getSecret()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk8s-plus-22.IngressTls"));
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;
IngressTls.Jsii$Proxy that = (IngressTls.Jsii$Proxy) o;
if (this.hosts != null ? !this.hosts.equals(that.hosts) : that.hosts != null) return false;
return this.secret != null ? this.secret.equals(that.secret) : that.secret == null;
}
@Override
public final int hashCode() {
int result = this.hosts != null ? this.hosts.hashCode() : 0;
result = 31 * result + (this.secret != null ? this.secret.hashCode() : 0);
return result;
}
}
}