com.pepperize.cdk.autoscaling_gitlab_runner.Cache Maven / Gradle / Ivy
Show all versions of cdk-autoscaling-gitlab-runner Show documentation
package com.pepperize.cdk.autoscaling_gitlab_runner;
/**
* A GitLab Runner cache consisting of an Amazon S3 bucket.
*
* The bucket is encrypted with a KMS managed master key, it has public access blocked and will be cleared and deleted on CFN stack deletion.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-01T02:44:42.298Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.autoscaling_gitlab_runner.$Module.class, fqn = "@pepperize/cdk-autoscaling-gitlab-runner.Cache")
public class Cache extends software.constructs.Construct {
protected Cache(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Cache(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Cache(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable com.pepperize.cdk.autoscaling_gitlab_runner.CacheProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props });
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Cache(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getBucket() {
return software.amazon.jsii.Kernel.get(this, "bucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
/**
* A fluent builder for {@link com.pepperize.cdk.autoscaling_gitlab_runner.Cache}.
*/
@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}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private com.pepperize.cdk.autoscaling_gitlab_runner.CacheProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
}
/**
* The infix of the physical cache bucket name.
*
* Default: "runner-cache"
*
* @return {@code this}
* @param bucketName The infix of the physical cache bucket name. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder bucketName(final java.lang.String bucketName) {
this.props().bucketName(bucketName);
return this;
}
/**
* The number of days after which the created cache objects are deleted from S3.
*
* Default: 30 days
*
* @return {@code this}
* @param expiration The number of days after which the created cache objects are deleted from S3. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder expiration(final software.amazon.awscdk.Duration expiration) {
this.props().expiration(expiration);
return this;
}
/**
* @return a newly built instance of {@link com.pepperize.cdk.autoscaling_gitlab_runner.Cache}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public com.pepperize.cdk.autoscaling_gitlab_runner.Cache build() {
return new com.pepperize.cdk.autoscaling_gitlab_runner.Cache(
this.scope,
this.id,
this.props != null ? this.props.build() : null
);
}
private com.pepperize.cdk.autoscaling_gitlab_runner.CacheProps.Builder props() {
if (this.props == null) {
this.props = new com.pepperize.cdk.autoscaling_gitlab_runner.CacheProps.Builder();
}
return this.props;
}
}
}