ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtension Maven / Gradle / Ivy
Show all versions of cdk-ecs-keycloak Show documentation
package ca.wheatstalk.cdkecskeycloak;
/**
* Adds a keycloak container to a task definition.
*
* To use ECS service discovery
* to locate cluster members, you need to call useCloudMapService
with the
* CloudMap service so that we can configure the correct DNS query.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.29.0 (build 41df200)", date = "2021-04-28T04:27:48.365Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = ca.wheatstalk.cdkecskeycloak.$Module.class, fqn = "@wheatstalk/cdk-ecs-keycloak.KeycloakContainerExtension")
public class KeycloakContainerExtension extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.ecs.ITaskDefinitionExtension {
protected KeycloakContainerExtension(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected KeycloakContainerExtension(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public KeycloakContainerExtension(final @org.jetbrains.annotations.Nullable ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtensionProps 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.Stable)
public KeycloakContainerExtension() {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this);
}
/**
* Configure health checks on the target group.
*
* @param targetGroup This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void configureHealthCheck(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroup targetGroup) {
software.amazon.jsii.Kernel.call(this, "configureHealthCheck", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(targetGroup, "targetGroup is required") });
}
/**
* Apply the extension to the given TaskDefinition.
*
* @param taskDefinition This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public void extend(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.TaskDefinition taskDefinition) {
software.amazon.jsii.Kernel.call(this, "extend", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(taskDefinition, "taskDefinition is required") });
}
/**
* Inform Keycloak of a CloudMap service discovery mechanism.
*
* @param serviceDiscovery This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public void useCloudMapService(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.servicediscovery.IService serviceDiscovery) {
software.amazon.jsii.Kernel.call(this, "useCloudMapService", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(serviceDiscovery, "serviceDiscovery is required") });
}
/**
* Admin console port.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Number getAdminConsolePort() {
return software.amazon.jsii.Kernel.get(this, "adminConsolePort", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* The number of distributed auth session cache owners for each key.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Number getCacheOwnersAuthSessionsCount() {
return software.amazon.jsii.Kernel.get(this, "cacheOwnersAuthSessionsCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* The number of distributed cache owners for each key.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Number getCacheOwnersCount() {
return software.amazon.jsii.Kernel.get(this, "cacheOwnersCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* Name of the container added to the task definition.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getContainerName() {
return software.amazon.jsii.Kernel.get(this, "containerName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Name of the Keycloak database.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getDatabaseName() {
return software.amazon.jsii.Kernel.get(this, "databaseName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Database vendor.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull ca.wheatstalk.cdkecskeycloak.KeycloakDatabaseVendor getDatabaseVendor() {
return software.amazon.jsii.Kernel.get(this, "databaseVendor", software.amazon.jsii.NativeType.forClass(ca.wheatstalk.cdkecskeycloak.KeycloakDatabaseVendor.class));
}
/**
* The default admin user password.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getDefaultAdminPassword() {
return software.amazon.jsii.Kernel.get(this, "defaultAdminPassword", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The default admin user's name.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.String getDefaultAdminUser() {
return software.amazon.jsii.Kernel.get(this, "defaultAdminUser", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Web traffic port with HTTPS.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Number getHttpsWebPort() {
return software.amazon.jsii.Kernel.get(this, "httpsWebPort", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* True if infinicache clustering is enabled.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Boolean getInfinicacheClustering() {
return software.amazon.jsii.Kernel.get(this, "infinicacheClustering", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
* Web traffic port.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull java.lang.Number getWebPort() {
return software.amazon.jsii.Kernel.get(this, "webPort", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* A fluent builder for {@link ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtension}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
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.Stable)
public static Builder create() {
return new Builder();
}
private ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtensionProps.Builder props;
private Builder() {
}
/**
* The number of distributed cache owners for authentication sessions.
*
* Default: - same as `cacheOwnersCount`
*
* @return {@code this}
* @param cacheOwnersAuthSessionsCount The number of distributed cache owners for authentication sessions. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cacheOwnersAuthSessionsCount(final java.lang.Number cacheOwnersAuthSessionsCount) {
this.props().cacheOwnersAuthSessionsCount(cacheOwnersAuthSessionsCount);
return this;
}
/**
* The default number of distributed cache owners for each key.
*
* Default: 1
*
* @return {@code this}
* @param cacheOwnersCount The default number of distributed cache owners for each key. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder cacheOwnersCount(final java.lang.Number cacheOwnersCount) {
this.props().cacheOwnersCount(cacheOwnersCount);
return this;
}
/**
* A name for the container added to the task definition.
*
* Default: 'keycloak'
*
* @return {@code this}
* @param containerName A name for the container added to the task definition. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder containerName(final java.lang.String containerName) {
this.props().containerName(containerName);
return this;
}
/**
* Secrets manager secret containing the RDS database credentials and connection information in JSON format.
*
* Default: - none
*
* @return {@code this}
* @param databaseCredentials Secrets manager secret containing the RDS database credentials and connection information in JSON format. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder databaseCredentials(final software.amazon.awscdk.services.secretsmanager.ISecret databaseCredentials) {
this.props().databaseCredentials(databaseCredentials);
return this;
}
/**
* Database name.
*
* Default: 'keycloak'
*
* @return {@code this}
* @param databaseName Database name. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder databaseName(final java.lang.String databaseName) {
this.props().databaseName(databaseName);
return this;
}
/**
* Database schema.
*
* Default: - for Postgresql, the default is 'public'
*
* @return {@code this}
* @param databaseSchema Database schema. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder databaseSchema(final java.lang.String databaseSchema) {
this.props().databaseSchema(databaseSchema);
return this;
}
/**
* The database vendor.
*
* Default: KeycloakDatabaseVendor.H2
*
* @return {@code this}
* @param databaseVendor The database vendor. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder databaseVendor(final ca.wheatstalk.cdkecskeycloak.KeycloakDatabaseVendor databaseVendor) {
this.props().databaseVendor(databaseVendor);
return this;
}
/**
* Default admin user's password.
*
* This password is applied when the default admin user
* is created.
*
* Default: 'admin'
*
* @return {@code this}
* @param defaultAdminPassword Default admin user's password. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder defaultAdminPassword(final java.lang.String defaultAdminPassword) {
this.props().defaultAdminPassword(defaultAdminPassword);
return this;
}
/**
* Default admin user.
*
* This user is created in the master realm if it doesn't exist.
*
* Default: 'admin'
*
* @return {@code this}
* @param defaultAdminUser Default admin user. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder defaultAdminUser(final java.lang.String defaultAdminUser) {
this.props().defaultAdminUser(defaultAdminUser);
return this;
}
/**
* Keycloak container image to use.
*
* Default: - use jboss/keycloak from docker hub.
*
* @return {@code this}
* @param image Keycloak container image to use. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder image(final software.amazon.awscdk.services.ecs.ContainerImage image) {
this.props().image(image);
return this;
}
/**
* Enable infinicache clustering.
*
* Default: - true if any cache owner count is greater than 1
*
* @return {@code this}
* @param infinicacheClustering Enable infinicache clustering. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder infinicacheClustering(final java.lang.Boolean infinicacheClustering) {
this.props().infinicacheClustering(infinicacheClustering);
return this;
}
/**
* Log driver for the task.
*
* Default: - cloudwatch with one month retention
*
* @return {@code this}
* @param logging Log driver for the task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder logging(final software.amazon.awscdk.services.ecs.LogDriver logging) {
this.props().logging(logging);
return this;
}
/**
* Memory limit of the keycloak task.
*
* Default: 1024
*
* @return {@code this}
* @param memoryLimitMiB Memory limit of the keycloak task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memoryLimitMiB(final java.lang.Number memoryLimitMiB) {
this.props().memoryLimitMiB(memoryLimitMiB);
return this;
}
/**
* Memory reservation size for the keycloak task.
*
* Default: - 80% of memoryLimitMiB
*
* @return {@code this}
* @param memoryReservationMiB Memory reservation size for the keycloak task. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder memoryReservationMiB(final java.lang.Number memoryReservationMiB) {
this.props().memoryReservationMiB(memoryReservationMiB);
return this;
}
/**
* @returns a newly built instance of {@link ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtension}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtension build() {
return new ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtension(
this.props != null ? this.props.build() : null
);
}
private ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtensionProps.Builder props() {
if (this.props == null) {
this.props = new ca.wheatstalk.cdkecskeycloak.KeycloakContainerExtensionProps.Builder();
}
return this.props;
}
}
}