software.amazon.awscdk.services.glue.alpha.CloudWatchEncryption Maven / Gradle / Ivy
package software.amazon.awscdk.services.glue.alpha;
/**
* (experimental) CloudWatch Logs encryption configuration.
*
* Example:
*
*
* SecurityConfiguration.Builder.create(this, "MySecurityConfiguration")
* .cloudWatchEncryption(CloudWatchEncryption.builder()
* .mode(CloudWatchEncryptionMode.KMS)
* .build())
* .jobBookmarksEncryption(JobBookmarksEncryption.builder()
* .mode(JobBookmarksEncryptionMode.CLIENT_SIDE_KMS)
* .build())
* .s3Encryption(S3Encryption.builder()
* .mode(S3EncryptionMode.KMS)
* .build())
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-11-15T10:25:09.315Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.CloudWatchEncryption")
@software.amazon.jsii.Jsii.Proxy(CloudWatchEncryption.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CloudWatchEncryption extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Encryption mode.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode getMode();
/**
* (experimental) The KMS key to be used to encrypt the data.
*
* Default: A key will be created if one is not provided.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.kms.IKey getKmsKey() {
return null;
}
/**
* @return a {@link Builder} of {@link CloudWatchEncryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CloudWatchEncryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode mode;
software.amazon.awscdk.services.kms.IKey kmsKey;
/**
* Sets the value of {@link CloudWatchEncryption#getMode}
* @param mode Encryption mode. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder mode(software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode mode) {
this.mode = mode;
return this;
}
/**
* Sets the value of {@link CloudWatchEncryption#getKmsKey}
* @param kmsKey The KMS key to be used to encrypt the data.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder kmsKey(software.amazon.awscdk.services.kms.IKey kmsKey) {
this.kmsKey = kmsKey;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CloudWatchEncryption}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public CloudWatchEncryption build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CloudWatchEncryption}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CloudWatchEncryption {
private final software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode mode;
private final software.amazon.awscdk.services.kms.IKey kmsKey;
/**
* 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.mode = software.amazon.jsii.Kernel.get(this, "mode", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode.class));
this.kmsKey = software.amazon.jsii.Kernel.get(this, "kmsKey", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.kms.IKey.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.mode = java.util.Objects.requireNonNull(builder.mode, "mode is required");
this.kmsKey = builder.kmsKey;
}
@Override
public final software.amazon.awscdk.services.glue.alpha.CloudWatchEncryptionMode getMode() {
return this.mode;
}
@Override
public final software.amazon.awscdk.services.kms.IKey getKmsKey() {
return this.kmsKey;
}
@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("mode", om.valueToTree(this.getMode()));
if (this.getKmsKey() != null) {
data.set("kmsKey", om.valueToTree(this.getKmsKey()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-glue-alpha.CloudWatchEncryption"));
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;
CloudWatchEncryption.Jsii$Proxy that = (CloudWatchEncryption.Jsii$Proxy) o;
if (!mode.equals(that.mode)) return false;
return this.kmsKey != null ? this.kmsKey.equals(that.kmsKey) : that.kmsKey == null;
}
@Override
public final int hashCode() {
int result = this.mode.hashCode();
result = 31 * result + (this.kmsKey != null ? this.kmsKey.hashCode() : 0);
return result;
}
}
}