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

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

package com.cloudsnorkel.cdk.github.runners;

/**
 * (experimental) GitHub Actions runner provider using CodeBuild to execute jobs.
 * 

* Creates a project that gets started for each job. *

* This construct is not meant to be used by itself. It should be passed in the providers property for GitHubRunners. */ @javax.annotation.Generated(value = "jsii-pacmak/1.73.0 (build 6faeda3)", date = "2023-01-17T21:04:02.923Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Jsii(module = com.cloudsnorkel.cdk.github.runners.$Module.class, fqn = "@cloudsnorkel/cdk-github-runners.CodeBuildRunner") public class CodeBuildRunner extends software.constructs.Construct implements com.cloudsnorkel.cdk.github.runners.IRunnerProvider { protected CodeBuildRunner(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected CodeBuildRunner(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } static { LINUX_ARM64_DOCKERFILE_PATH = software.amazon.jsii.JsiiObject.jsiiStaticGet(com.cloudsnorkel.cdk.github.runners.CodeBuildRunner.class, "LINUX_ARM64_DOCKERFILE_PATH", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); LINUX_X64_DOCKERFILE_PATH = software.amazon.jsii.JsiiObject.jsiiStaticGet(com.cloudsnorkel.cdk.github.runners.CodeBuildRunner.class, "LINUX_X64_DOCKERFILE_PATH", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * @param scope This parameter is required. * @param id This parameter is required. * @param props */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public CodeBuildRunner(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProps 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.Experimental) public CodeBuildRunner(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") }); } /** * @param task This parameter is required. * @param errors This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) protected void addRetry(final @org.jetbrains.annotations.NotNull java.lang.Object task, final @org.jetbrains.annotations.NotNull java.util.List errors) { if (software.amazon.jsii.Configuration.getRuntimeTypeChecking()) { if ( !(task instanceof software.amazon.awscdk.services.stepfunctions.Parallel) && !(task instanceof software.amazon.awscdk.services.stepfunctions.TaskStateBase) ) { throw new IllegalArgumentException( new java.lang.StringBuilder("Expected ") .append("task") .append(" to be one of: software.amazon.awscdk.services.stepfunctions.Parallel, software.amazon.awscdk.services.stepfunctions.TaskStateBase; received ") .append(task.getClass()).toString()); } } software.amazon.jsii.Kernel.call(this, "addRetry", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(task, "task is required"), java.util.Objects.requireNonNull(errors, "errors is required") }); } /** * (experimental) Generate step function task(s) to start a new runner. *

* Called by GithubRunners and shouldn't be called manually. *

* @param parameters workflow job details. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.stepfunctions.IChainable getStepFunctionTask(final @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.RunnerRuntimeParameters parameters) { return software.amazon.jsii.Kernel.call(this, "getStepFunctionTask", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.stepfunctions.IChainable.class), new Object[] { java.util.Objects.requireNonNull(parameters, "parameters is required") }); } /** * (experimental) An optional method that modifies the role of the state machine after all the tasks have been generated. *

* This can be used to add additional policy * statements to the state machine role that are not automatically added by the task returned from {@link getStepFunctionTask}. *

* @param _ This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public void grantStateMachine(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable _) { software.amazon.jsii.Kernel.call(this, "grantStateMachine", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(_, "_ is required") }); } /** * @param defaultLabel This parameter is required. * @param propsLabel * @param propsLabels */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) protected @org.jetbrains.annotations.NotNull java.util.List labelsFromProperties(final @org.jetbrains.annotations.NotNull java.lang.String defaultLabel, final @org.jetbrains.annotations.Nullable java.lang.String propsLabel, final @org.jetbrains.annotations.Nullable java.util.List propsLabels) { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.call(this, "labelsFromProperties", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)), new Object[] { java.util.Objects.requireNonNull(defaultLabel, "defaultLabel is required"), propsLabel, propsLabels })); } /** * @param defaultLabel This parameter is required. * @param propsLabel */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) protected @org.jetbrains.annotations.NotNull java.util.List labelsFromProperties(final @org.jetbrains.annotations.NotNull java.lang.String defaultLabel, final @org.jetbrains.annotations.Nullable java.lang.String propsLabel) { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.call(this, "labelsFromProperties", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)), new Object[] { java.util.Objects.requireNonNull(defaultLabel, "defaultLabel is required"), propsLabel })); } /** * @param defaultLabel This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) protected @org.jetbrains.annotations.NotNull java.util.List labelsFromProperties(final @org.jetbrains.annotations.NotNull java.lang.String defaultLabel) { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.call(this, "labelsFromProperties", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)), new Object[] { java.util.Objects.requireNonNull(defaultLabel, "defaultLabel is required") })); } /** * (experimental) Return status of the runner provider to be used in the main status function. *

* Also gives the status function any needed permissions to query the Docker image or AMI. *

* @param statusFunctionRole This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.IRunnerProviderStatus status(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IGrantable statusFunctionRole) { return software.amazon.jsii.Kernel.call(this, "status", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.IRunnerProviderStatus.class), new Object[] { java.util.Objects.requireNonNull(statusFunctionRole, "statusFunctionRole is required") }); } /** * (experimental) Path to Dockerfile for Linux ARM64 with all the requirements for CodeBuild runner. *

* Use this Dockerfile unless you need to customize it further than allowed by hooks. *

* Available build arguments that can be set in the image builder: *

*

    *
  • BASE_IMAGE sets the FROM line. This should be an Ubuntu compatible image.
  • *
  • EXTRA_PACKAGES can be used to install additional packages.
  • *
  • DOCKER_CHANNEL overrides the channel from which Docker will be downloaded. Defaults to "stable".
  • *
  • DIND_COMMIT overrides the commit where dind is found.
  • *
  • DOCKER_VERSION overrides the installed Docker version.
  • *
  • DOCKER_COMPOSE_VERSION overrides the installed docker-compose version.
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static java.lang.String LINUX_ARM64_DOCKERFILE_PATH; /** * (experimental) Path to Dockerfile for Linux x64 with all the requirements for CodeBuild runner. *

* Use this Dockerfile unless you need to customize it further than allowed by hooks. *

* Available build arguments that can be set in the image builder: *

*

    *
  • BASE_IMAGE sets the FROM line. This should be an Ubuntu compatible image.
  • *
  • EXTRA_PACKAGES can be used to install additional packages.
  • *
  • DOCKER_CHANNEL overrides the channel from which Docker will be downloaded. Defaults to "stable".
  • *
  • DIND_COMMIT overrides the commit where dind is found.
  • *
  • DOCKER_VERSION overrides the installed Docker version.
  • *
  • DOCKER_COMPOSE_VERSION overrides the installed docker-compose version.
  • *
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public final static java.lang.String LINUX_X64_DOCKERFILE_PATH; /** * (experimental) The network connections associated with this resource. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ec2.Connections getConnections() { return software.amazon.jsii.Kernel.get(this, "connections", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.Connections.class)); } /** * (experimental) Grant principal used to add permissions to the runner role. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.iam.IPrincipal getGrantPrincipal() { return software.amazon.jsii.Kernel.get(this, "grantPrincipal", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IPrincipal.class)); } /** * (experimental) Docker image loaded with GitHub Actions Runner and its prerequisites. *

* The image is built by an image builder and is specific to CodeBuild. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.RunnerImage getImage() { return software.amazon.jsii.Kernel.get(this, "image", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.RunnerImage.class)); } /** * (experimental) Labels associated with this provider. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.util.List getLabels() { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "labels", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)))); } /** * (experimental) Log group where provided runners will save their logs. *

* Note that this is not the job log, but the runner itself. It will not contain output from the GitHub Action but only metadata on its execution. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.logs.ILogGroup getLogGroup() { return software.amazon.jsii.Kernel.get(this, "logGroup", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.logs.ILogGroup.class)); } /** * (experimental) CodeBuild project hosting the runner. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.codebuild.Project getProject() { return software.amazon.jsii.Kernel.get(this, "project", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.codebuild.Project.class)); } /** * (experimental) A fluent builder for {@link com.cloudsnorkel.cdk.github.runners.CodeBuildRunner}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) 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.Experimental) 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.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProps.Builder props; private Builder(final software.constructs.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; } /** * (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 *

* @return {@code this} * @param logRetention The number of days log events are kept in CloudWatch Logs. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder logRetention(final software.amazon.awscdk.services.logs.RetentionDays logRetention) { this.props().logRetention(logRetention); return this; } /** * (experimental) Options to retry operation in case of failure like missing capacity, or API quota issues. *

* Default: retry 10 times up to about 45 minutes *

* @return {@code this} * @param retryOptions Options to retry operation in case of failure like missing capacity, or API quota issues. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder retryOptions(final com.cloudsnorkel.cdk.github.runners.ProviderRetryOptions retryOptions) { this.props().retryOptions(retryOptions); return this; } /** * (experimental) The type of compute to use for this build. *

* See the {@link ComputeType} enum for the possible values. *

* Default: {@link ComputeType#SMALL} *

* @return {@code this} * @param computeType The type of compute to use for this build. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder computeType(final software.amazon.awscdk.services.codebuild.ComputeType computeType) { this.props().computeType(computeType); return this; } /** * (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 *

* @return {@code this} * @param dockerInDocker Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder dockerInDocker(final java.lang.Boolean dockerInDocker) { this.props().dockerInDocker(dockerInDocker); return this; } /** * (experimental) Image builder for CodeBuild image with GitHub runner pre-configured. *

* A user named runner is expected to exist with access to Docker-in-Docker. *

* Default: image builder with `CodeBuildRunner.LINUX_X64_DOCKERFILE_PATH` as Dockerfile *

* @return {@code this} * @param imageBuilder Image builder for CodeBuild image with GitHub runner pre-configured. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder imageBuilder(final com.cloudsnorkel.cdk.github.runners.IImageBuilder imageBuilder) { this.props().imageBuilder(imageBuilder); return this; } /** * (deprecated) GitHub Actions label used for this provider. *

* Default: undefined *

* @return {@code this} * @deprecated use {@link labels} instead * @param label GitHub Actions label used for this provider. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) @Deprecated public Builder label(final java.lang.String label) { this.props().label(label); return this; } /** * (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'] *

* @return {@code this} * @param labels GitHub Actions labels used for this provider. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder labels(final java.util.List labels) { this.props().labels(labels); return this; } /** * (deprecated) Security group to assign to this instance. *

* Default: public project with no security group *

* @return {@code this} * @deprecated use {@link securityGroups} * @param securityGroup Security group to assign to this instance. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated) @Deprecated public Builder securityGroup(final software.amazon.awscdk.services.ec2.ISecurityGroup securityGroup) { this.props().securityGroup(securityGroup); return this; } /** * (experimental) Security groups to assign to this instance. *

* Default: a new security group, if {@link vpc} is used *

* @return {@code this} * @param securityGroups Security groups to assign to this instance. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder securityGroups(final java.util.List securityGroups) { this.props().securityGroups(securityGroups); return this; } /** * (experimental) Where to place the network interfaces within the VPC. *

* Default: no subnet *

* @return {@code this} * @param subnetSelection Where to place the network interfaces within the VPC. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder subnetSelection(final software.amazon.awscdk.services.ec2.SubnetSelection subnetSelection) { this.props().subnetSelection(subnetSelection); return this; } /** * (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) *

* @return {@code this} * @param timeout The number of minutes after which AWS CodeBuild stops the build if it's not complete. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder timeout(final software.amazon.awscdk.Duration timeout) { this.props().timeout(timeout); return this; } /** * (experimental) VPC to launch the runners in. *

* Default: no VPC *

* @return {@code this} * @param vpc VPC to launch the runners in. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder vpc(final software.amazon.awscdk.services.ec2.IVpc vpc) { this.props().vpc(vpc); return this; } /** * @returns a newly built instance of {@link com.cloudsnorkel.cdk.github.runners.CodeBuildRunner}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public com.cloudsnorkel.cdk.github.runners.CodeBuildRunner build() { return new com.cloudsnorkel.cdk.github.runners.CodeBuildRunner( this.scope, this.id, this.props != null ? this.props.build() : null ); } private com.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProps.Builder props() { if (this.props == null) { this.props = new com.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProps.Builder(); } return this.props; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy