com.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProviderProps Maven / Gradle / Ivy
Show all versions of cdk.github.runners Show documentation
package com.cloudsnorkel.cdk.github.runners;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-14T02:42:19.399Z")
@software.amazon.jsii.Jsii(module = com.cloudsnorkel.cdk.github.runners.$Module.class, fqn = "@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps")
@software.amazon.jsii.Jsii.Proxy(CodeBuildRunnerProviderProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CodeBuildRunnerProviderProps extends software.amazon.jsii.JsiiSerializable, com.cloudsnorkel.cdk.github.runners.RunnerProviderProps {
/**
* (experimental) The type of compute to use for this build.
*
* See the {@link ComputeType} enum for the possible values.
*
* Default: {@link ComputeType#SMALL }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.codebuild.ComputeType getComputeType() {
return null;
}
/**
* (experimental) Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode.
*
* Disabling this can
* speed up provisioning of CodeBuild runners. If you don't intend on running or building Docker images, disable this for faster start-up times.
*
* Default: true
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getDockerInDocker() {
return null;
}
/**
* (experimental) Runner image builder used to build Docker images containing GitHub Runner and all requirements.
*
* The image builder must contain the {@link RunnerImageComponent.docker} component unless `dockerInDocker` is set to false.
* The image builder determines the OS and architecture of the runner.
*
* Default: CodeBuildRunnerProvider.imageBuilder()
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder getImageBuilder() {
return null;
}
/**
* (deprecated) GitHub Actions label used for this provider.
*
* Default: undefined
*
* @deprecated use {@link labels } instead
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.String getLabel() {
return null;
}
/**
* (experimental) GitHub Actions labels used for this provider.
*
* These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for
* based on runs-on. We match the labels from the webhook with the labels specified here. If all the labels specified here are present in the
* job's labels, this provider will be chosen and spawn a new runner.
*
* Default: ['codebuild']
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getLabels() {
return null;
}
/**
* (deprecated) Security group to assign to this instance.
*
* Default: public project with no security group
*
* @deprecated use {@link securityGroups }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() {
return null;
}
/**
* (experimental) Security groups to assign to this instance.
*
* Default: a new security group, if {@link vpc } is used
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getSecurityGroups() {
return null;
}
/**
* (experimental) Where to place the network interfaces within the VPC.
*
* Default: no subnet
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.SubnetSelection getSubnetSelection() {
return null;
}
/**
* (experimental) The number of minutes after which AWS CodeBuild stops the build if it's not complete.
*
* For valid values, see the timeoutInMinutes field in the AWS
* CodeBuild User Guide.
*
* Default: Duration.hours(1)
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getTimeout() {
return null;
}
/**
* (experimental) VPC to launch the runners in.
*
* Default: no VPC
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.IVpc getVpc() {
return null;
}
/**
* @return a {@link Builder} of {@link CodeBuildRunnerProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CodeBuildRunnerProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.codebuild.ComputeType computeType;
java.lang.Boolean dockerInDocker;
com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder imageBuilder;
java.lang.String label;
java.util.List labels;
software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup;
java.util.List securityGroups;
software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection;
software.amazon.awscdk.Duration timeout;
software.amazon.awscdk.services.ec2.IVpc vpc;
software.amazon.awscdk.services.logs.RetentionDays logRetention;
com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions retryOptions;
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getComputeType}
* @param computeType The type of compute to use for this build.
* See the {@link ComputeType} enum for the possible values.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder computeType(software.amazon.awscdk.services.codebuild.ComputeType computeType) {
this.computeType = computeType;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getDockerInDocker}
* @param dockerInDocker Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode.
* Disabling this can
* speed up provisioning of CodeBuild runners. If you don't intend on running or building Docker images, disable this for faster start-up times.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dockerInDocker(java.lang.Boolean dockerInDocker) {
this.dockerInDocker = dockerInDocker;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getImageBuilder}
* @param imageBuilder Runner image builder used to build Docker images containing GitHub Runner and all requirements.
* The image builder must contain the {@link RunnerImageComponent.docker} component unless `dockerInDocker` is set to false.
*
* The image builder determines the OS and architecture of the runner.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imageBuilder(com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder imageBuilder) {
this.imageBuilder = imageBuilder;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getLabel}
* @param label GitHub Actions label used for this provider.
* @return {@code this}
* @deprecated use {@link labels } instead
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder label(java.lang.String label) {
this.label = label;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getLabels}
* @param labels GitHub Actions labels used for this provider.
* These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for
* based on runs-on. We match the labels from the webhook with the labels specified here. If all the labels specified here are present in the
* job's labels, this provider will be chosen and spawn a new runner.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder labels(java.util.List labels) {
this.labels = labels;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getSecurityGroup}
* @param securityGroup Security group to assign to this instance.
* @return {@code this}
* @deprecated use {@link securityGroups }
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder securityGroup(software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup) {
this.securityGroup = securityGroup;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getSecurityGroups}
* @param securityGroups Security groups to assign to this instance.
* @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 CodeBuildRunnerProviderProps#getSubnetSelection}
* @param subnetSelection Where to place the network interfaces within the VPC.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder subnetSelection(software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection) {
this.subnetSelection = subnetSelection;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getTimeout}
* @param timeout The number of minutes after which AWS CodeBuild stops the build if it's not complete.
* For valid values, see the timeoutInMinutes field in the AWS
* CodeBuild User Guide.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder timeout(software.amazon.awscdk.Duration timeout) {
this.timeout = timeout;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getVpc}
* @param vpc VPC to launch the runners in.
* @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 CodeBuildRunnerProviderProps#getLogRetention}
* @param logRetention The number of days log events are kept in CloudWatch Logs.
* When updating
* this property, unsetting it doesn't remove the log retention policy. To
* remove the retention policy, set the value to INFINITE
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder logRetention(software.amazon.awscdk.services.logs.RetentionDays logRetention) {
this.logRetention = logRetention;
return this;
}
/**
* Sets the value of {@link CodeBuildRunnerProviderProps#getRetryOptions}
* @param retryOptions the value to be set.
* @return {@code this}
* @deprecated use {@link retryOptions } on {@link GitHubRunners } instead
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder retryOptions(com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions retryOptions) {
this.retryOptions = retryOptions;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CodeBuildRunnerProviderProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public CodeBuildRunnerProviderProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CodeBuildRunnerProviderProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CodeBuildRunnerProviderProps {
private final software.amazon.awscdk.services.codebuild.ComputeType computeType;
private final java.lang.Boolean dockerInDocker;
private final com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder imageBuilder;
private final java.lang.String label;
private final java.util.List labels;
private final software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup;
private final java.util.List securityGroups;
private final software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection;
private final software.amazon.awscdk.Duration timeout;
private final software.amazon.awscdk.services.ec2.IVpc vpc;
private final software.amazon.awscdk.services.logs.RetentionDays logRetention;
private final com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions retryOptions;
/**
* 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.computeType = software.amazon.jsii.Kernel.get(this, "computeType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.ComputeType.class));
this.dockerInDocker = software.amazon.jsii.Kernel.get(this, "dockerInDocker", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.imageBuilder = software.amazon.jsii.Kernel.get(this, "imageBuilder", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder.class));
this.label = software.amazon.jsii.Kernel.get(this, "label", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.labels = software.amazon.jsii.Kernel.get(this, "labels", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.securityGroup = software.amazon.jsii.Kernel.get(this, "securityGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.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.subnetSelection = software.amazon.jsii.Kernel.get(this, "subnetSelection", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.SubnetSelection.class));
this.timeout = software.amazon.jsii.Kernel.get(this, "timeout", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.vpc = software.amazon.jsii.Kernel.get(this, "vpc", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.IVpc.class));
this.logRetention = software.amazon.jsii.Kernel.get(this, "logRetention", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.RetentionDays.class));
this.retryOptions = software.amazon.jsii.Kernel.get(this, "retryOptions", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions.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.computeType = builder.computeType;
this.dockerInDocker = builder.dockerInDocker;
this.imageBuilder = builder.imageBuilder;
this.label = builder.label;
this.labels = builder.labels;
this.securityGroup = builder.securityGroup;
this.securityGroups = (java.util.List)builder.securityGroups;
this.subnetSelection = builder.subnetSelection;
this.timeout = builder.timeout;
this.vpc = builder.vpc;
this.logRetention = builder.logRetention;
this.retryOptions = builder.retryOptions;
}
@Override
public final software.amazon.awscdk.services.codebuild.ComputeType getComputeType() {
return this.computeType;
}
@Override
public final java.lang.Boolean getDockerInDocker() {
return this.dockerInDocker;
}
@Override
public final com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder getImageBuilder() {
return this.imageBuilder;
}
@Override
public final java.lang.String getLabel() {
return this.label;
}
@Override
public final java.util.List getLabels() {
return this.labels;
}
@Override
public final software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() {
return this.securityGroup;
}
@Override
public final java.util.List getSecurityGroups() {
return this.securityGroups;
}
@Override
public final software.amazon.awscdk.services.ec2.SubnetSelection getSubnetSelection() {
return this.subnetSelection;
}
@Override
public final software.amazon.awscdk.Duration getTimeout() {
return this.timeout;
}
@Override
public final software.amazon.awscdk.services.ec2.IVpc getVpc() {
return this.vpc;
}
@Override
public final software.amazon.awscdk.services.logs.RetentionDays getLogRetention() {
return this.logRetention;
}
@Override
public final com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions getRetryOptions() {
return this.retryOptions;
}
@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.getComputeType() != null) {
data.set("computeType", om.valueToTree(this.getComputeType()));
}
if (this.getDockerInDocker() != null) {
data.set("dockerInDocker", om.valueToTree(this.getDockerInDocker()));
}
if (this.getImageBuilder() != null) {
data.set("imageBuilder", om.valueToTree(this.getImageBuilder()));
}
if (this.getLabel() != null) {
data.set("label", om.valueToTree(this.getLabel()));
}
if (this.getLabels() != null) {
data.set("labels", om.valueToTree(this.getLabels()));
}
if (this.getSecurityGroup() != null) {
data.set("securityGroup", om.valueToTree(this.getSecurityGroup()));
}
if (this.getSecurityGroups() != null) {
data.set("securityGroups", om.valueToTree(this.getSecurityGroups()));
}
if (this.getSubnetSelection() != null) {
data.set("subnetSelection", om.valueToTree(this.getSubnetSelection()));
}
if (this.getTimeout() != null) {
data.set("timeout", om.valueToTree(this.getTimeout()));
}
if (this.getVpc() != null) {
data.set("vpc", om.valueToTree(this.getVpc()));
}
if (this.getLogRetention() != null) {
data.set("logRetention", om.valueToTree(this.getLogRetention()));
}
if (this.getRetryOptions() != null) {
data.set("retryOptions", om.valueToTree(this.getRetryOptions()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cloudsnorkel/cdk-github-runners.CodeBuildRunnerProviderProps"));
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;
CodeBuildRunnerProviderProps.Jsii$Proxy that = (CodeBuildRunnerProviderProps.Jsii$Proxy) o;
if (this.computeType != null ? !this.computeType.equals(that.computeType) : that.computeType != null) return false;
if (this.dockerInDocker != null ? !this.dockerInDocker.equals(that.dockerInDocker) : that.dockerInDocker != null) return false;
if (this.imageBuilder != null ? !this.imageBuilder.equals(that.imageBuilder) : that.imageBuilder != null) return false;
if (this.label != null ? !this.label.equals(that.label) : that.label != null) return false;
if (this.labels != null ? !this.labels.equals(that.labels) : that.labels != null) return false;
if (this.securityGroup != null ? !this.securityGroup.equals(that.securityGroup) : that.securityGroup != null) return false;
if (this.securityGroups != null ? !this.securityGroups.equals(that.securityGroups) : that.securityGroups != null) return false;
if (this.subnetSelection != null ? !this.subnetSelection.equals(that.subnetSelection) : that.subnetSelection != null) return false;
if (this.timeout != null ? !this.timeout.equals(that.timeout) : that.timeout != null) return false;
if (this.vpc != null ? !this.vpc.equals(that.vpc) : that.vpc != null) return false;
if (this.logRetention != null ? !this.logRetention.equals(that.logRetention) : that.logRetention != null) return false;
return this.retryOptions != null ? this.retryOptions.equals(that.retryOptions) : that.retryOptions == null;
}
@Override
public final int hashCode() {
int result = this.computeType != null ? this.computeType.hashCode() : 0;
result = 31 * result + (this.dockerInDocker != null ? this.dockerInDocker.hashCode() : 0);
result = 31 * result + (this.imageBuilder != null ? this.imageBuilder.hashCode() : 0);
result = 31 * result + (this.label != null ? this.label.hashCode() : 0);
result = 31 * result + (this.labels != null ? this.labels.hashCode() : 0);
result = 31 * result + (this.securityGroup != null ? this.securityGroup.hashCode() : 0);
result = 31 * result + (this.securityGroups != null ? this.securityGroups.hashCode() : 0);
result = 31 * result + (this.subnetSelection != null ? this.subnetSelection.hashCode() : 0);
result = 31 * result + (this.timeout != null ? this.timeout.hashCode() : 0);
result = 31 * result + (this.vpc != null ? this.vpc.hashCode() : 0);
result = 31 * result + (this.logRetention != null ? this.logRetention.hashCode() : 0);
result = 31 * result + (this.retryOptions != null ? this.retryOptions.hashCode() : 0);
return result;
}
}
}