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

com.cloudsnorkel.cdk.github.runners.LambdaRunnerProviderProps 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;

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

    /**
     * (experimental) The size of the function’s /tmp directory in MiB.
     * 

* Default: 10 GiB */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Size getEphemeralStorageSize() { 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.lambdaEntrypoint} component. * The image builder determines the OS and architecture of the runner. *

* Default: LambdaRunnerProvider.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: ['lambda'] */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.util.List getLabels() { return null; } /** * (experimental) The amount of memory, in MB, that is allocated to your Lambda function. *

* Lambda uses this value to proportionally allocate the amount of CPU * power. For more information, see Resource Model in the AWS Lambda * Developer Guide. *

* Default: 2048 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) default @org.jetbrains.annotations.Nullable java.lang.Number getMemorySize() { return null; } /** * (deprecated) Security group to assign to this instance. *

* Default: public lambda 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: public lambda with no security group */ @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 function execution time (in seconds) after which Lambda terminates the function. *

* Because the execution time affects cost, set this value * based on the function's expected execution time. *

* Default: Duration.minutes(15) */ @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 LambdaRunnerProviderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) static Builder builder() { return new Builder(); } /** * A builder for {@link LambdaRunnerProviderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.Size ephemeralStorageSize; com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder imageBuilder; java.lang.String label; java.util.List labels; java.lang.Number memorySize; 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 LambdaRunnerProviderProps#getEphemeralStorageSize} * @param ephemeralStorageSize The size of the function’s /tmp directory in MiB. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder ephemeralStorageSize(software.amazon.awscdk.Size ephemeralStorageSize) { this.ephemeralStorageSize = ephemeralStorageSize; return this; } /** * Sets the value of {@link LambdaRunnerProviderProps#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.lambdaEntrypoint} component. * * 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 LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#getMemorySize} * @param memorySize The amount of memory, in MB, that is allocated to your Lambda function. * Lambda uses this value to proportionally allocate the amount of CPU * power. For more information, see Resource Model in the AWS Lambda * Developer Guide. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder memorySize(java.lang.Number memorySize) { this.memorySize = memorySize; return this; } /** * Sets the value of {@link LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#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 securityGroups) { this.securityGroups = (java.util.List)securityGroups; return this; } /** * Sets the value of {@link LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#getTimeout} * @param timeout The function execution time (in seconds) after which Lambda terminates the function. * Because the execution time affects cost, set this value * based on the function's expected execution time. * @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 LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#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 LambdaRunnerProviderProps#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 LambdaRunnerProviderProps} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public LambdaRunnerProviderProps build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link LambdaRunnerProviderProps} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements LambdaRunnerProviderProps { private final software.amazon.awscdk.Size ephemeralStorageSize; private final com.cloudsnorkel.cdk.github.runners.IRunnerImageBuilder imageBuilder; private final java.lang.String label; private final java.util.List labels; private final java.lang.Number memorySize; 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.ephemeralStorageSize = software.amazon.jsii.Kernel.get(this, "ephemeralStorageSize", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Size.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.memorySize = software.amazon.jsii.Kernel.get(this, "memorySize", software.amazon.jsii.NativeType.forClass(java.lang.Number.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.ephemeralStorageSize = builder.ephemeralStorageSize; this.imageBuilder = builder.imageBuilder; this.label = builder.label; this.labels = builder.labels; this.memorySize = builder.memorySize; 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.Size getEphemeralStorageSize() { return this.ephemeralStorageSize; } @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 java.lang.Number getMemorySize() { return this.memorySize; } @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.getEphemeralStorageSize() != null) { data.set("ephemeralStorageSize", om.valueToTree(this.getEphemeralStorageSize())); } 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.getMemorySize() != null) { data.set("memorySize", om.valueToTree(this.getMemorySize())); } 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.LambdaRunnerProviderProps")); 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; LambdaRunnerProviderProps.Jsii$Proxy that = (LambdaRunnerProviderProps.Jsii$Proxy) o; if (this.ephemeralStorageSize != null ? !this.ephemeralStorageSize.equals(that.ephemeralStorageSize) : that.ephemeralStorageSize != 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.memorySize != null ? !this.memorySize.equals(that.memorySize) : that.memorySize != 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.ephemeralStorageSize != null ? this.ephemeralStorageSize.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.memorySize != null ? this.memorySize.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; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy