All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudsnorkel.cdk.github.runners.CodeBuildImageBuilderProps Maven / Gradle / Ivy

Go to download

CDK construct to create GitHub Actions self-hosted runners. A webhook listens to events and creates ephemeral runners on the fly.

There is a newer version: 0.14.6
Show newest version
package com.cloudsnorkel.cdk.github.runners;

/**
 * (experimental) Properties for CodeBuildImageBuilder construct.
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-14T02:42:19.386Z")
@software.amazon.jsii.Jsii(module = com.cloudsnorkel.cdk.github.runners.$Module.class, fqn = "@cloudsnorkel/cdk-github-runners.CodeBuildImageBuilderProps")
@software.amazon.jsii.Jsii.Proxy(CodeBuildImageBuilderProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CodeBuildImageBuilderProps extends software.amazon.jsii.JsiiSerializable {

    /**
     * (experimental) Path to Dockerfile to be built.
     * 

* It can be a path to a Dockerfile, a folder containing a Dockerfile, or a zip file containing a Dockerfile. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @org.jetbrains.annotations.NotNull java.lang.String getDockerfilePath(); /** * (experimental) Image architecture. *

* Default: Architecture.X86_64 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.Architecture getArchitecture() { return null; } /** * (experimental) Build image to use in CodeBuild. *

* This is the image that's going to run the code that builds the runner image. *

* The only action taken in CodeBuild is running docker build. You would therefore not need to change this setting often. *

* Default: Ubuntu 22.04 for x64 and Amazon Linux 2 for ARM64 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.codebuild.IBuildImage getBuildImage() { return null; } /** * (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) Removal policy for logs of image builds. *

* If deployment fails on the custom resource, try setting this to RemovalPolicy.RETAIN. This way the CodeBuild logs can still be viewed, and you can see why the build failed. *

* We try to not leave anything behind when removed. But sometimes a log staying behind is useful. *

* Default: RemovalPolicy.DESTROY */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.RemovalPolicy getLogRemovalPolicy() { return null; } /** * (experimental) 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. *

* Default: logs.RetentionDays.ONE_MONTH */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.logs.RetentionDays getLogRetention() { return null; } /** * (experimental) Image OS. *

* Default: OS.LINUX */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.Os getOs() { return null; } /** * (experimental) Schedule the image to be rebuilt every given interval. *

* Useful for keeping the image up-do-date with the latest GitHub runner version and latest OS updates. *

* Set to zero to disable. *

* Default: Duration.days(7) */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getRebuildInterval() { return null; } /** * (experimental) Version of GitHub Runners to install. *

* Default: latest version available */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.RunnerVersion getRunnerVersion() { return null; } /** * (experimental) Security Group to assign to this instance. *

* Default: public project with no security group */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() { 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 build the image 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 CodeBuildImageBuilderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link CodeBuildImageBuilderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { java.lang.String dockerfilePath; com.cloudsnorkel.cdk.github.runners.Architecture architecture; software.amazon.awscdk.services.codebuild.IBuildImage buildImage; software.amazon.awscdk.services.codebuild.ComputeType computeType; software.amazon.awscdk.RemovalPolicy logRemovalPolicy; software.amazon.awscdk.services.logs.RetentionDays logRetention; com.cloudsnorkel.cdk.github.runners.Os os; software.amazon.awscdk.Duration rebuildInterval; com.cloudsnorkel.cdk.github.runners.RunnerVersion runnerVersion; software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup; software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection; software.amazon.awscdk.Duration timeout; software.amazon.awscdk.services.ec2.IVpc vpc; /** * Sets the value of {@link CodeBuildImageBuilderProps#getDockerfilePath} * @param dockerfilePath Path to Dockerfile to be built. This parameter is required. * It can be a path to a Dockerfile, a folder containing a Dockerfile, or a zip file containing a Dockerfile. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dockerfilePath(java.lang.String dockerfilePath) { this.dockerfilePath = dockerfilePath; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#getArchitecture} * @param architecture Image architecture. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder architecture(com.cloudsnorkel.cdk.github.runners.Architecture architecture) { this.architecture = architecture; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#getBuildImage} * @param buildImage Build image to use in CodeBuild. * This is the image that's going to run the code that builds the runner image. *

* The only action taken in CodeBuild is running docker build. You would therefore not need to change this setting often. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder buildImage(software.amazon.awscdk.services.codebuild.IBuildImage buildImage) { this.buildImage = buildImage; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#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 CodeBuildImageBuilderProps#getLogRemovalPolicy} * @param logRemovalPolicy Removal policy for logs of image builds. * If deployment fails on the custom resource, try setting this to RemovalPolicy.RETAIN. This way the CodeBuild logs can still be viewed, and you can see why the build failed. *

* We try to not leave anything behind when removed. But sometimes a log staying behind is useful. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder logRemovalPolicy(software.amazon.awscdk.RemovalPolicy logRemovalPolicy) { this.logRemovalPolicy = logRemovalPolicy; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#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 CodeBuildImageBuilderProps#getOs} * @param os Image OS. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder os(com.cloudsnorkel.cdk.github.runners.Os os) { this.os = os; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#getRebuildInterval} * @param rebuildInterval Schedule the image to be rebuilt every given interval. * Useful for keeping the image up-do-date with the latest GitHub runner version and latest OS updates. *

* Set to zero to disable. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder rebuildInterval(software.amazon.awscdk.Duration rebuildInterval) { this.rebuildInterval = rebuildInterval; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#getRunnerVersion} * @param runnerVersion Version of GitHub Runners to install. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder runnerVersion(com.cloudsnorkel.cdk.github.runners.RunnerVersion runnerVersion) { this.runnerVersion = runnerVersion; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#getSecurityGroup} * @param securityGroup Security Group to assign to this instance. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder securityGroup(software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup) { this.securityGroup = securityGroup; return this; } /** * Sets the value of {@link CodeBuildImageBuilderProps#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 CodeBuildImageBuilderProps#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 CodeBuildImageBuilderProps#getVpc} * @param vpc VPC to build the image 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; } /** * Builds the configured instance. * @return a new instance of {@link CodeBuildImageBuilderProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public CodeBuildImageBuilderProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link CodeBuildImageBuilderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CodeBuildImageBuilderProps { private final java.lang.String dockerfilePath; private final com.cloudsnorkel.cdk.github.runners.Architecture architecture; private final software.amazon.awscdk.services.codebuild.IBuildImage buildImage; private final software.amazon.awscdk.services.codebuild.ComputeType computeType; private final software.amazon.awscdk.RemovalPolicy logRemovalPolicy; private final software.amazon.awscdk.services.logs.RetentionDays logRetention; private final com.cloudsnorkel.cdk.github.runners.Os os; private final software.amazon.awscdk.Duration rebuildInterval; private final com.cloudsnorkel.cdk.github.runners.RunnerVersion runnerVersion; private final software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup; 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; /** * 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.dockerfilePath = software.amazon.jsii.Kernel.get(this, "dockerfilePath", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.architecture = software.amazon.jsii.Kernel.get(this, "architecture", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.Architecture.class)); this.buildImage = software.amazon.jsii.Kernel.get(this, "buildImage", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.IBuildImage.class)); this.computeType = software.amazon.jsii.Kernel.get(this, "computeType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.ComputeType.class)); this.logRemovalPolicy = software.amazon.jsii.Kernel.get(this, "logRemovalPolicy", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.RemovalPolicy.class)); this.logRetention = software.amazon.jsii.Kernel.get(this, "logRetention", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.RetentionDays.class)); this.os = software.amazon.jsii.Kernel.get(this, "os", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.Os.class)); this.rebuildInterval = software.amazon.jsii.Kernel.get(this, "rebuildInterval", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class)); this.runnerVersion = software.amazon.jsii.Kernel.get(this, "runnerVersion", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.RunnerVersion.class)); this.securityGroup = software.amazon.jsii.Kernel.get(this, "securityGroup", 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)); } /** * 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.dockerfilePath = java.util.Objects.requireNonNull(builder.dockerfilePath, "dockerfilePath is required"); this.architecture = builder.architecture; this.buildImage = builder.buildImage; this.computeType = builder.computeType; this.logRemovalPolicy = builder.logRemovalPolicy; this.logRetention = builder.logRetention; this.os = builder.os; this.rebuildInterval = builder.rebuildInterval; this.runnerVersion = builder.runnerVersion; this.securityGroup = builder.securityGroup; this.subnetSelection = builder.subnetSelection; this.timeout = builder.timeout; this.vpc = builder.vpc; } @Override public final java.lang.String getDockerfilePath() { return this.dockerfilePath; } @Override public final com.cloudsnorkel.cdk.github.runners.Architecture getArchitecture() { return this.architecture; } @Override public final software.amazon.awscdk.services.codebuild.IBuildImage getBuildImage() { return this.buildImage; } @Override public final software.amazon.awscdk.services.codebuild.ComputeType getComputeType() { return this.computeType; } @Override public final software.amazon.awscdk.RemovalPolicy getLogRemovalPolicy() { return this.logRemovalPolicy; } @Override public final software.amazon.awscdk.services.logs.RetentionDays getLogRetention() { return this.logRetention; } @Override public final com.cloudsnorkel.cdk.github.runners.Os getOs() { return this.os; } @Override public final software.amazon.awscdk.Duration getRebuildInterval() { return this.rebuildInterval; } @Override public final com.cloudsnorkel.cdk.github.runners.RunnerVersion getRunnerVersion() { return this.runnerVersion; } @Override public final software.amazon.awscdk.services.ec2.ISecurityGroup getSecurityGroup() { return this.securityGroup; } @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 @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("dockerfilePath", om.valueToTree(this.getDockerfilePath())); if (this.getArchitecture() != null) { data.set("architecture", om.valueToTree(this.getArchitecture())); } if (this.getBuildImage() != null) { data.set("buildImage", om.valueToTree(this.getBuildImage())); } if (this.getComputeType() != null) { data.set("computeType", om.valueToTree(this.getComputeType())); } if (this.getLogRemovalPolicy() != null) { data.set("logRemovalPolicy", om.valueToTree(this.getLogRemovalPolicy())); } if (this.getLogRetention() != null) { data.set("logRetention", om.valueToTree(this.getLogRetention())); } if (this.getOs() != null) { data.set("os", om.valueToTree(this.getOs())); } if (this.getRebuildInterval() != null) { data.set("rebuildInterval", om.valueToTree(this.getRebuildInterval())); } if (this.getRunnerVersion() != null) { data.set("runnerVersion", om.valueToTree(this.getRunnerVersion())); } if (this.getSecurityGroup() != null) { data.set("securityGroup", om.valueToTree(this.getSecurityGroup())); } 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())); } 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.CodeBuildImageBuilderProps")); 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; CodeBuildImageBuilderProps.Jsii$Proxy that = (CodeBuildImageBuilderProps.Jsii$Proxy) o; if (!dockerfilePath.equals(that.dockerfilePath)) return false; if (this.architecture != null ? !this.architecture.equals(that.architecture) : that.architecture != null) return false; if (this.buildImage != null ? !this.buildImage.equals(that.buildImage) : that.buildImage != null) return false; if (this.computeType != null ? !this.computeType.equals(that.computeType) : that.computeType != null) return false; if (this.logRemovalPolicy != null ? !this.logRemovalPolicy.equals(that.logRemovalPolicy) : that.logRemovalPolicy != null) return false; if (this.logRetention != null ? !this.logRetention.equals(that.logRetention) : that.logRetention != null) return false; if (this.os != null ? !this.os.equals(that.os) : that.os != null) return false; if (this.rebuildInterval != null ? !this.rebuildInterval.equals(that.rebuildInterval) : that.rebuildInterval != null) return false; if (this.runnerVersion != null ? !this.runnerVersion.equals(that.runnerVersion) : that.runnerVersion != null) return false; if (this.securityGroup != null ? !this.securityGroup.equals(that.securityGroup) : that.securityGroup != 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; return this.vpc != null ? this.vpc.equals(that.vpc) : that.vpc == null; } @Override public final int hashCode() { int result = this.dockerfilePath.hashCode(); result = 31 * result + (this.architecture != null ? this.architecture.hashCode() : 0); result = 31 * result + (this.buildImage != null ? this.buildImage.hashCode() : 0); result = 31 * result + (this.computeType != null ? this.computeType.hashCode() : 0); result = 31 * result + (this.logRemovalPolicy != null ? this.logRemovalPolicy.hashCode() : 0); result = 31 * result + (this.logRetention != null ? this.logRetention.hashCode() : 0); result = 31 * result + (this.os != null ? this.os.hashCode() : 0); result = 31 * result + (this.rebuildInterval != null ? this.rebuildInterval.hashCode() : 0); result = 31 * result + (this.runnerVersion != null ? this.runnerVersion.hashCode() : 0); result = 31 * result + (this.securityGroup != null ? this.securityGroup.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); return result; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy