io.github.cdklabs.cdk.amazonmq.BrokerDeploymentProps Maven / Gradle / Ivy
package io.github.cdklabs.cdk.amazonmq;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-08-08T22:30:31.776Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.amazonmq.$Module.class, fqn = "@cdklabs/cdk-amazonmq.BrokerDeploymentProps")
@software.amazon.jsii.Jsii.Proxy(BrokerDeploymentProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface BrokerDeploymentProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Determines whether the broker will undergo a minor version upgrade during the maintenance window.
*
* Default: - false. No minor version upgrade happens.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Boolean getAutoMinorVersionUpgrade();
/**
* (experimental) An instance type to use for the broker.
*
* Only a subset of available instance types is allowed.
*
* @see https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/broker-instance-types.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.InstanceType getInstanceType();
/**
* (experimental) Specifies whether the broker is open to public Internet or deployed with endpoints in own VPC.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Boolean getPubliclyAccessible();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getBrokerName() {
return null;
}
/**
* (experimental) Sets the retention days for the broker's CloudWatch LogGroups.
*
* Default: - undefined; CloudWatch Log Groups retention is set to never expire
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.logs.RetentionDays getCloudwatchLogsRetention() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.IRole getCloudwatchLogsRetentionRole() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getKey() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime getMaintenanceWindowStartTime() {
return null;
}
/**
* (experimental) The Security Groups to apply for a non publicly accessible broker.
*
* NOTE: This needs to be set only if publiclyAccessible
is true.
*
* Default: - undefined. If no VPC is selected then a default VPC's default SG will be used.
* Otherwise - a security group will be created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getSecurityGroups() {
return null;
}
/**
* (experimental) The VPC in which create the communication endpoints for a private broker.
*
* Default: - undefined. A default VPC will be used
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.IVpc getVpc() {
return null;
}
/**
* (experimental) vpcSubnets and vpc are optional.
*
* But when present - publiclyAccessible attribute must equal false.
*
* Default: - undefined. If vpc is present - this attribute must be present.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetSelection getVpcSubnets() {
return null;
}
/**
* @return a {@link Builder} of {@link BrokerDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link BrokerDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean autoMinorVersionUpgrade;
software.amazon.awscdk.services.ec2.InstanceType instanceType;
java.lang.Boolean publiclyAccessible;
java.lang.String brokerName;
software.amazon.awscdk.services.logs.RetentionDays cloudwatchLogsRetention;
software.amazon.awscdk.services.iam.IRole cloudwatchLogsRetentionRole;
software.amazon.awscdk.services.kms.IKey key;
io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime maintenanceWindowStartTime;
java.util.List securityGroups;
software.amazon.awscdk.services.ec2.IVpc vpc;
software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets;
/**
* Sets the value of {@link BrokerDeploymentProps#getAutoMinorVersionUpgrade}
* @param autoMinorVersionUpgrade Determines whether the broker will undergo a minor version upgrade during the maintenance window. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder autoMinorVersionUpgrade(java.lang.Boolean autoMinorVersionUpgrade) {
this.autoMinorVersionUpgrade = autoMinorVersionUpgrade;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getInstanceType}
* @param instanceType An instance type to use for the broker. This parameter is required.
* Only a subset of available instance types is allowed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder instanceType(software.amazon.awscdk.services.ec2.InstanceType instanceType) {
this.instanceType = instanceType;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getPubliclyAccessible}
* @param publiclyAccessible Specifies whether the broker is open to public Internet or deployed with endpoints in own VPC. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder publiclyAccessible(java.lang.Boolean publiclyAccessible) {
this.publiclyAccessible = publiclyAccessible;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getBrokerName}
* @param brokerName the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder brokerName(java.lang.String brokerName) {
this.brokerName = brokerName;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getCloudwatchLogsRetention}
* @param cloudwatchLogsRetention Sets the retention days for the broker's CloudWatch LogGroups.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cloudwatchLogsRetention(software.amazon.awscdk.services.logs.RetentionDays cloudwatchLogsRetention) {
this.cloudwatchLogsRetention = cloudwatchLogsRetention;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getCloudwatchLogsRetentionRole}
* @param cloudwatchLogsRetentionRole the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder cloudwatchLogsRetentionRole(software.amazon.awscdk.services.iam.IRole cloudwatchLogsRetentionRole) {
this.cloudwatchLogsRetentionRole = cloudwatchLogsRetentionRole;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getKey}
* @param key the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder key(software.amazon.awscdk.services.kms.IKey key) {
this.key = key;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getMaintenanceWindowStartTime}
* @param maintenanceWindowStartTime the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maintenanceWindowStartTime(io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime maintenanceWindowStartTime) {
this.maintenanceWindowStartTime = maintenanceWindowStartTime;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getSecurityGroups}
* @param securityGroups The Security Groups to apply for a non publicly accessible broker.
* NOTE: This needs to be set only if publiclyAccessible
is true.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder securityGroups(java.util.List extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups) {
this.securityGroups = (java.util.List)securityGroups;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getVpc}
* @param vpc The VPC in which create the communication endpoints for a private broker.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpc(software.amazon.awscdk.services.ec2.IVpc vpc) {
this.vpc = vpc;
return this;
}
/**
* Sets the value of {@link BrokerDeploymentProps#getVpcSubnets}
* @param vpcSubnets vpcSubnets and vpc are optional.
* But when present - publiclyAccessible attribute must equal false.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpcSubnets(software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets) {
this.vpcSubnets = vpcSubnets;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link BrokerDeploymentProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public BrokerDeploymentProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link BrokerDeploymentProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BrokerDeploymentProps {
private final java.lang.Boolean autoMinorVersionUpgrade;
private final software.amazon.awscdk.services.ec2.InstanceType instanceType;
private final java.lang.Boolean publiclyAccessible;
private final java.lang.String brokerName;
private final software.amazon.awscdk.services.logs.RetentionDays cloudwatchLogsRetention;
private final software.amazon.awscdk.services.iam.IRole cloudwatchLogsRetentionRole;
private final software.amazon.awscdk.services.kms.IKey key;
private final io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime maintenanceWindowStartTime;
private final java.util.List securityGroups;
private final software.amazon.awscdk.services.ec2.IVpc vpc;
private final software.amazon.awscdk.services.ec2.SubnetSelection vpcSubnets;
/**
* 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.autoMinorVersionUpgrade = software.amazon.jsii.Kernel.get(this, "autoMinorVersionUpgrade", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.instanceType = software.amazon.jsii.Kernel.get(this, "instanceType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.InstanceType.class));
this.publiclyAccessible = software.amazon.jsii.Kernel.get(this, "publiclyAccessible", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.brokerName = software.amazon.jsii.Kernel.get(this, "brokerName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.cloudwatchLogsRetention = software.amazon.jsii.Kernel.get(this, "cloudwatchLogsRetention", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.RetentionDays.class));
this.cloudwatchLogsRetentionRole = software.amazon.jsii.Kernel.get(this, "cloudwatchLogsRetentionRole", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.class));
this.key = software.amazon.jsii.Kernel.get(this, "key", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.class));
this.maintenanceWindowStartTime = software.amazon.jsii.Kernel.get(this, "maintenanceWindowStartTime", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime.class));
this.securityGroups = software.amazon.jsii.Kernel.get(this, "securityGroups", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.class)));
this.vpc = software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
this.vpcSubnets = software.amazon.jsii.Kernel.get(this, "vpcSubnets", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetSelection.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.autoMinorVersionUpgrade = java.util.Objects.requireNonNull(builder.autoMinorVersionUpgrade, "autoMinorVersionUpgrade is required");
this.instanceType = java.util.Objects.requireNonNull(builder.instanceType, "instanceType is required");
this.publiclyAccessible = java.util.Objects.requireNonNull(builder.publiclyAccessible, "publiclyAccessible is required");
this.brokerName = builder.brokerName;
this.cloudwatchLogsRetention = builder.cloudwatchLogsRetention;
this.cloudwatchLogsRetentionRole = builder.cloudwatchLogsRetentionRole;
this.key = builder.key;
this.maintenanceWindowStartTime = builder.maintenanceWindowStartTime;
this.securityGroups = (java.util.List)builder.securityGroups;
this.vpc = builder.vpc;
this.vpcSubnets = builder.vpcSubnets;
}
@Override
public final java.lang.Boolean getAutoMinorVersionUpgrade() {
return this.autoMinorVersionUpgrade;
}
@Override
public final software.amazon.awscdk.services.ec2.InstanceType getInstanceType() {
return this.instanceType;
}
@Override
public final java.lang.Boolean getPubliclyAccessible() {
return this.publiclyAccessible;
}
@Override
public final java.lang.String getBrokerName() {
return this.brokerName;
}
@Override
public final software.amazon.awscdk.services.logs.RetentionDays getCloudwatchLogsRetention() {
return this.cloudwatchLogsRetention;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getCloudwatchLogsRetentionRole() {
return this.cloudwatchLogsRetentionRole;
}
@Override
public final software.amazon.awscdk.services.kms.IKey getKey() {
return this.key;
}
@Override
public final io.github.cdklabs.cdk.amazonmq.MaintenanceWindowStartTime getMaintenanceWindowStartTime() {
return this.maintenanceWindowStartTime;
}
@Override
public final java.util.List getSecurityGroups() {
return this.securityGroups;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpc getVpc() {
return this.vpc;
}
@Override
public final software.amazon.awscdk.services.ec2.SubnetSelection getVpcSubnets() {
return this.vpcSubnets;
}
@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();
data.set("autoMinorVersionUpgrade", om.valueToTree(this.getAutoMinorVersionUpgrade()));
data.set("instanceType", om.valueToTree(this.getInstanceType()));
data.set("publiclyAccessible", om.valueToTree(this.getPubliclyAccessible()));
if (this.getBrokerName() != null) {
data.set("brokerName", om.valueToTree(this.getBrokerName()));
}
if (this.getCloudwatchLogsRetention() != null) {
data.set("cloudwatchLogsRetention", om.valueToTree(this.getCloudwatchLogsRetention()));
}
if (this.getCloudwatchLogsRetentionRole() != null) {
data.set("cloudwatchLogsRetentionRole", om.valueToTree(this.getCloudwatchLogsRetentionRole()));
}
if (this.getKey() != null) {
data.set("key", om.valueToTree(this.getKey()));
}
if (this.getMaintenanceWindowStartTime() != null) {
data.set("maintenanceWindowStartTime", om.valueToTree(this.getMaintenanceWindowStartTime()));
}
if (this.getSecurityGroups() != null) {
data.set("securityGroups", om.valueToTree(this.getSecurityGroups()));
}
if (this.getVpc() != null) {
data.set("vpc", om.valueToTree(this.getVpc()));
}
if (this.getVpcSubnets() != null) {
data.set("vpcSubnets", om.valueToTree(this.getVpcSubnets()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/cdk-amazonmq.BrokerDeploymentProps"));
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;
BrokerDeploymentProps.Jsii$Proxy that = (BrokerDeploymentProps.Jsii$Proxy) o;
if (!autoMinorVersionUpgrade.equals(that.autoMinorVersionUpgrade)) return false;
if (!instanceType.equals(that.instanceType)) return false;
if (!publiclyAccessible.equals(that.publiclyAccessible)) return false;
if (this.brokerName != null ? !this.brokerName.equals(that.brokerName) : that.brokerName != null) return false;
if (this.cloudwatchLogsRetention != null ? !this.cloudwatchLogsRetention.equals(that.cloudwatchLogsRetention) : that.cloudwatchLogsRetention != null) return false;
if (this.cloudwatchLogsRetentionRole != null ? !this.cloudwatchLogsRetentionRole.equals(that.cloudwatchLogsRetentionRole) : that.cloudwatchLogsRetentionRole != null) return false;
if (this.key != null ? !this.key.equals(that.key) : that.key != null) return false;
if (this.maintenanceWindowStartTime != null ? !this.maintenanceWindowStartTime.equals(that.maintenanceWindowStartTime) : that.maintenanceWindowStartTime != null) return false;
if (this.securityGroups != null ? !this.securityGroups.equals(that.securityGroups) : that.securityGroups != null) return false;
if (this.vpc != null ? !this.vpc.equals(that.vpc) : that.vpc != null) return false;
return this.vpcSubnets != null ? this.vpcSubnets.equals(that.vpcSubnets) : that.vpcSubnets == null;
}
@Override
public final int hashCode() {
int result = this.autoMinorVersionUpgrade.hashCode();
result = 31 * result + (this.instanceType.hashCode());
result = 31 * result + (this.publiclyAccessible.hashCode());
result = 31 * result + (this.brokerName != null ? this.brokerName.hashCode() : 0);
result = 31 * result + (this.cloudwatchLogsRetention != null ? this.cloudwatchLogsRetention.hashCode() : 0);
result = 31 * result + (this.cloudwatchLogsRetentionRole != null ? this.cloudwatchLogsRetentionRole.hashCode() : 0);
result = 31 * result + (this.key != null ? this.key.hashCode() : 0);
result = 31 * result + (this.maintenanceWindowStartTime != null ? this.maintenanceWindowStartTime.hashCode() : 0);
result = 31 * result + (this.securityGroups != null ? this.securityGroups.hashCode() : 0);
result = 31 * result + (this.vpc != null ? this.vpc.hashCode() : 0);
result = 31 * result + (this.vpcSubnets != null ? this.vpcSubnets.hashCode() : 0);
return result;
}
}
}