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

com.cloudsnorkel.cdk.github.runners.LambdaAccess 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.3
Show newest version
package com.cloudsnorkel.cdk.github.runners;

/**
 * (experimental) Access configuration options for Lambda functions like setup and webhook function. Use this to limit access to these functions.
 * 

* If you need a custom access point, you can implement this abstract class yourself. Note that the Lambda functions expect API Gateway v1 or v2 input. They also expect every URL under the constructed URL to point to the function. */ @javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-29T21:58:33.758Z") @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.LambdaAccess") public abstract class LambdaAccess extends software.amazon.jsii.JsiiObject { protected LambdaAccess(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected LambdaAccess(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) protected LambdaAccess() { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); } /** * (experimental) Provide access using API Gateway. *

* This is the most secure option, but requires additional configuration. It allows you to limit access to specific IP addresses and even to a specific VPC. *

* To limit access to GitHub.com use: *

*

     * LambdaAccess.apiGateway({
     *   allowedIps: LambdaAccess.githubWebhookIps(),
     * });
     * 
*

* Alternatively, get and manually update the list manually with: *

*

     * curl https://api.github.com/meta | jq .hooks
     * 
*

* @param props */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.LambdaAccess apiGateway(final @org.jetbrains.annotations.Nullable com.cloudsnorkel.cdk.github.runners.ApiGatewayAccessProps props) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class, "apiGateway", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class), new Object[] { props }); } /** * (experimental) Provide access using API Gateway. *

* This is the most secure option, but requires additional configuration. It allows you to limit access to specific IP addresses and even to a specific VPC. *

* To limit access to GitHub.com use: *

*

     * LambdaAccess.apiGateway({
     *   allowedIps: LambdaAccess.githubWebhookIps(),
     * });
     * 
*

* Alternatively, get and manually update the list manually with: *

*

     * curl https://api.github.com/meta | jq .hooks
     * 
*/ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.LambdaAccess apiGateway() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class, "apiGateway", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class)); } /** * (experimental) Downloads the list of IP addresses used by GitHub.com for webhooks. *

* Note that downloading dynamic data during deployment is not recommended in CDK. This is a workaround for the lack of a better solution. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull java.util.List githubWebhookIps() { return java.util.Collections.unmodifiableList(software.amazon.jsii.JsiiObject.jsiiStaticCall(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class, "githubWebhookIps", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)))); } /** * (experimental) Provide access using Lambda URL. *

* This is the default and simplest option. It puts no limits on the requester, but the Lambda functions themselves authenticate every request. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.LambdaAccess lambdaUrl() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class, "lambdaUrl", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class)); } /** * (experimental) Disables access to the configured Lambda function. *

* This is useful for the setup function after setup is done. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull com.cloudsnorkel.cdk.github.runners.LambdaAccess noAccess() { return software.amazon.jsii.JsiiObject.jsiiStaticCall(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class, "noAccess", software.amazon.jsii.NativeType.forClass(com.cloudsnorkel.cdk.github.runners.LambdaAccess.class)); } /** * (experimental) Creates all required resources and returns access URL or empty string if disabled. *

* @return access URL or empty string if disabled * @param scope This parameter is required. * @param id This parameter is required. * @param lambdaFunction This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public abstract @org.jetbrains.annotations.NotNull java.lang.String bind(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Function lambdaFunction); /** * A proxy class which represents a concrete javascript instance of this type. */ @software.amazon.jsii.Internal private static final class Jsii$Proxy extends com.cloudsnorkel.cdk.github.runners.LambdaAccess { protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } /** * (experimental) Creates all required resources and returns access URL or empty string if disabled. *

* @return access URL or empty string if disabled * @param scope This parameter is required. * @param id This parameter is required. * @param lambdaFunction This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public final @org.jetbrains.annotations.NotNull java.lang.String bind(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.Function lambdaFunction) { return software.amazon.jsii.Kernel.call(this, "bind", software.amazon.jsii.NativeType.forClass(java.lang.String.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(lambdaFunction, "lambdaFunction is required") }); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy