@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:01:21.507Z") @Stability(value=Experimental) public abstract class Code extends software.amazon.jsii.JsiiObject
| Modifier | Constructor and Description |
|---|---|
protected |
Code() |
protected |
Code(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Code(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
abstract CodeConfig |
bind(software.constructs.Construct scope)
(experimental) Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.
|
void |
bindToResource(CfnResource _resource)
(experimental) Called after the CFN function resource has been created to allow the code class to bind to it.
|
void |
bindToResource(CfnResource _resource,
ResourceBindOptions _options)
(experimental) Called after the CFN function resource has been created to allow the code class to bind to it.
|
static AssetCode |
fromAsset(String path)
(experimental) Loads the function code from a local disk path.
|
static AssetCode |
fromAsset(String path,
AssetOptions options)
(experimental) Loads the function code from a local disk path.
|
static AssetImageCode |
fromAssetImage(String directory)
(experimental) Create an ECR image from the specified asset and bind it as the Lambda code.
|
static AssetImageCode |
fromAssetImage(String directory,
AssetImageCodeProps props)
(experimental) Create an ECR image from the specified asset and bind it as the Lambda code.
|
static S3Code |
fromBucket(IBucket bucket,
String key)
(experimental) Lambda handler code as an S3 object.
|
static S3Code |
fromBucket(IBucket bucket,
String key,
String objectVersion)
(experimental) Lambda handler code as an S3 object.
|
static CfnParametersCode |
fromCfnParameters()
(experimental) Creates a new Lambda source defined using CloudFormation parameters.
|
static CfnParametersCode |
fromCfnParameters(CfnParametersCodeProps props)
(experimental) Creates a new Lambda source defined using CloudFormation parameters.
|
static AssetCode |
fromDockerBuild(String path)
(experimental) Loads the function code from an asset created by a Docker build.
|
static AssetCode |
fromDockerBuild(String path,
DockerBuildAssetOptions options)
(experimental) Loads the function code from an asset created by a Docker build.
|
static EcrImageCode |
fromEcrImage(IRepository repository)
(experimental) Use an existing ECR image as the Lambda code.
|
static EcrImageCode |
fromEcrImage(IRepository repository,
EcrImageCodeProps props)
(experimental) Use an existing ECR image as the Lambda code.
|
static InlineCode |
fromInline(String code)
(experimental) Inline code for Lambda handler.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Code(software.amazon.jsii.JsiiObjectRef objRef)
protected Code(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) protected Code()
@Stability(value=Experimental) @NotNull public static AssetCode fromAsset(@NotNull String path, @Nullable AssetOptions options)
path - Either a directory with the Lambda code bundle or a .zip file. This parameter is required.options - @Stability(value=Experimental) @NotNull public static AssetCode fromAsset(@NotNull String path)
path - Either a directory with the Lambda code bundle or a .zip file. This parameter is required.@Stability(value=Experimental) @NotNull public static AssetImageCode fromAssetImage(@NotNull String directory, @Nullable AssetImageCodeProps props)
directory - the directory from which the asset must be created. This parameter is required.props - properties to further configure the selected image.@Stability(value=Experimental) @NotNull public static AssetImageCode fromAssetImage(@NotNull String directory)
directory - the directory from which the asset must be created. This parameter is required.@Stability(value=Experimental) @NotNull public static S3Code fromBucket(@NotNull IBucket bucket, @NotNull String key, @Nullable String objectVersion)
bucket - The S3 bucket. This parameter is required.key - The object key. This parameter is required.objectVersion - Optional S3 object version.@Stability(value=Experimental) @NotNull public static S3Code fromBucket(@NotNull IBucket bucket, @NotNull String key)
bucket - The S3 bucket. This parameter is required.key - The object key. This parameter is required.@Stability(value=Experimental) @NotNull public static CfnParametersCode fromCfnParameters(@Nullable CfnParametersCodeProps props)
props - optional construction properties of CfnParametersCode.@Stability(value=Experimental) @NotNull public static CfnParametersCode fromCfnParameters()
@Stability(value=Experimental) @NotNull public static AssetCode fromDockerBuild(@NotNull String path, @Nullable DockerBuildAssetOptions options)
By default, the asset is expected to be located at /asset in the
image.
path - The path to the directory containing the Docker file. This parameter is required.options - Docker build options.@Stability(value=Experimental) @NotNull public static AssetCode fromDockerBuild(@NotNull String path)
By default, the asset is expected to be located at /asset in the
image.
path - The path to the directory containing the Docker file. This parameter is required.@Stability(value=Experimental) @NotNull public static EcrImageCode fromEcrImage(@NotNull IRepository repository, @Nullable EcrImageCodeProps props)
repository - the ECR repository that the image is in. This parameter is required.props - properties to further configure the selected image.@Stability(value=Experimental) @NotNull public static EcrImageCode fromEcrImage(@NotNull IRepository repository)
repository - the ECR repository that the image is in. This parameter is required.@Stability(value=Experimental) @NotNull public static InlineCode fromInline(@NotNull String code)
code - The actual handler code (limited to 4KiB). This parameter is required.@Stability(value=Experimental) @NotNull public abstract CodeConfig bind(@NotNull software.constructs.Construct scope)
scope - The binding scope. This parameter is required.@Stability(value=Experimental)
public void bindToResource(@NotNull
CfnResource _resource,
@Nullable
ResourceBindOptions _options)
Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.
_resource - This parameter is required._options - @Stability(value=Experimental)
public void bindToResource(@NotNull
CfnResource _resource)
Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.
_resource - This parameter is required.Copyright © 2021. All rights reserved.