Interface GoFunctionProps

All Superinterfaces:
EventInvokeConfigOptions, FunctionOptions, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
GoFunctionProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:25.973Z") @Stability(Experimental) public interface GoFunctionProps extends software.amazon.jsii.JsiiSerializable, FunctionOptions
(experimental) Properties for a GolangFunction.

Example:

 GoFunction.Builder.create(this, "handler")
         .entry("app/cmd/api")
         .bundling(BundlingOptions.builder()
                 .dockerImage(DockerImage.fromBuild("/path/to/Dockerfile"))
                 .build())
         .build();
 
  • Method Details

    • getEntry

      @Stability(Experimental) @NotNull String getEntry()
      (experimental) The path to the folder or file that contains the main application entry point files for the project.

      This accepts either a path to a directory or file.

      If a directory path is provided then it will assume there is a Go entry file (i.e. main.go) and will construct the build command using the directory path.

      For example, if you provide the entry as:

       entry: 'my-lambda-app/cmd/api'
       

      Then the go build command would be:

       `go build ./cmd/api`
       

      If a path to a file is provided then it will use the filepath in the build command.

      For example, if you provide the entry as:

       entry: 'my-lambda-app/cmd/api/main.go'
       

      Then the go build command would be:

       `go build ./cmd/api/main.go`
       
    • getBundling

      @Stability(Experimental) @Nullable default BundlingOptions getBundling()
      (experimental) Bundling options.

      Default: - use default bundling options

    • getModuleDir

      @Stability(Experimental) @Nullable default String getModuleDir()
      (experimental) Directory containing your go.mod file.

      This will accept either a directory path containing a go.mod file or a filepath to your go.mod file (i.e. path/to/go.mod).

      This will be used as the source of the volume mounted in the Docker container and will be the directory where it will run go build from.

      Default: - the path is found by walking up parent directories searching for a `go.mod` file from the location of `entry`

    • getRuntime

      @Stability(Experimental) @Nullable default Runtime getRuntime()
      (experimental) The runtime environment.

      Only runtimes of the Golang family and provided family are supported.

      Default: lambda.Runtime.PROVIDED_AL2

    • builder

      @Stability(Experimental) static GoFunctionProps.Builder builder()
      Returns:
      a GoFunctionProps.Builder of GoFunctionProps