software.amazon.awscdk.services.lambda.ILayerVersion Maven / Gradle / Ivy
Show all versions of lambda Show documentation
package software.amazon.awscdk.services.lambda;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.74.0 (build 6d08790)", date = "2023-03-14T16:25:29.815Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.lambda.$Module.class, fqn = "@aws-cdk/aws-lambda.ILayerVersion")
@software.amazon.jsii.Jsii.Proxy(ILayerVersion.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface ILayerVersion extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.core.IResource {
/**
* The ARN of the Lambda Layer version that this Layer defines.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getLayerVersionArn();
/**
* The runtimes compatible with this Layer.
*
* Default: Runtime.All
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getCompatibleRuntimes() {
return null;
}
/**
* Add permission for this layer version to specific entities.
*
* Usage within
* the same account where the layer is defined is always allowed and does not
* require calling this method. Note that the principal that creates the
* Lambda function using the layer (for example, a CloudFormation changeset
* execution role) also needs to have the lambda:GetLayerVersion
* permission on the layer version.
*
* @param id the ID of the grant in the construct tree. This parameter is required.
* @param permission the identification of the grantee. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
void addPermission(final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.LayerVersionPermission permission);
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.lambda.ILayerVersion.Jsii$Default {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
/**
* The construct tree node for this construct.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.ConstructNode getNode() {
return software.amazon.jsii.Kernel.get(this, "node", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.ConstructNode.class));
}
/**
* The environment this resource belongs to.
*
* For resources that are created and managed by the CDK
* (generally, those created by creating new class instances like Role, Bucket, etc.),
* this is always the same as the environment of the stack they belong to;
* however, for imported resources
* (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
* that might be different than the stack they were imported into.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.ResourceEnvironment getEnv() {
return software.amazon.jsii.Kernel.get(this, "env", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.ResourceEnvironment.class));
}
/**
* The stack in which this resource is defined.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Stack getStack() {
return software.amazon.jsii.Kernel.get(this, "stack", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.Stack.class));
}
/**
* The ARN of the Lambda Layer version that this Layer defines.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final @org.jetbrains.annotations.NotNull java.lang.String getLayerVersionArn() {
return software.amazon.jsii.Kernel.get(this, "layerVersionArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The runtimes compatible with this Layer.
*
* Default: Runtime.All
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public final @org.jetbrains.annotations.Nullable java.util.List getCompatibleRuntimes() {
return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "compatibleRuntimes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Runtime.class))))).map(java.util.Collections::unmodifiableList).orElse(null);
}
/**
* Apply the given removal policy to this resource.
*
* The Removal Policy controls what happens to this resource when it stops
* being managed by CloudFormation, either because you've removed it from the
* CDK application or because you've made a change that requires the resource
* to be replaced.
*
* The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
* account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
*
* @param policy This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public final void applyRemovalPolicy(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.RemovalPolicy policy) {
software.amazon.jsii.Kernel.call(this, "applyRemovalPolicy", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(policy, "policy is required") });
}
/**
* Add permission for this layer version to specific entities.
*
* Usage within
* the same account where the layer is defined is always allowed and does not
* require calling this method. Note that the principal that creates the
* Lambda function using the layer (for example, a CloudFormation changeset
* execution role) also needs to have the lambda:GetLayerVersion
* permission on the layer version.
*
* @param id the ID of the grant in the construct tree. This parameter is required.
* @param permission the identification of the grantee. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public final void addPermission(final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.LayerVersionPermission permission) {
software.amazon.jsii.Kernel.call(this, "addPermission", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(permission, "permission is required") });
}
}
/**
* Internal default implementation for {@link ILayerVersion}.
*/
@software.amazon.jsii.Internal
interface Jsii$Default extends ILayerVersion, software.amazon.awscdk.core.IResource.Jsii$Default {
/**
* The construct tree node for this construct.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.ConstructNode getNode() {
return software.amazon.jsii.Kernel.get(this, "node", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.ConstructNode.class));
}
/**
* The environment this resource belongs to.
*
* For resources that are created and managed by the CDK
* (generally, those created by creating new class instances like Role, Bucket, etc.),
* this is always the same as the environment of the stack they belong to;
* however, for imported resources
* (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
* that might be different than the stack they were imported into.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.ResourceEnvironment getEnv() {
return software.amazon.jsii.Kernel.get(this, "env", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.ResourceEnvironment.class));
}
/**
* The stack in which this resource is defined.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.Stack getStack() {
return software.amazon.jsii.Kernel.get(this, "stack", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.Stack.class));
}
/**
* The ARN of the Lambda Layer version that this Layer defines.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.NotNull java.lang.String getLayerVersionArn() {
return software.amazon.jsii.Kernel.get(this, "layerVersionArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* The runtimes compatible with this Layer.
*
* Default: Runtime.All
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getCompatibleRuntimes() {
return java.util.Optional.ofNullable((java.util.List)(software.amazon.jsii.Kernel.get(this, "compatibleRuntimes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.lambda.Runtime.class))))).map(java.util.Collections::unmodifiableList).orElse(null);
}
/**
* Apply the given removal policy to this resource.
*
* The Removal Policy controls what happens to this resource when it stops
* being managed by CloudFormation, either because you've removed it from the
* CDK application or because you've made a change that requires the resource
* to be replaced.
*
* The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
* account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
*
* @param policy This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
default void applyRemovalPolicy(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.core.RemovalPolicy policy) {
software.amazon.jsii.Kernel.call(this, "applyRemovalPolicy", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(policy, "policy is required") });
}
/**
* Add permission for this layer version to specific entities.
*
* Usage within
* the same account where the layer is defined is always allowed and does not
* require calling this method. Note that the principal that creates the
* Lambda function using the layer (for example, a CloudFormation changeset
* execution role) also needs to have the lambda:GetLayerVersion
* permission on the layer version.
*
* @param id the ID of the grant in the construct tree. This parameter is required.
* @param permission the identification of the grantee. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
default void addPermission(final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.lambda.LayerVersionPermission permission) {
software.amazon.jsii.Kernel.call(this, "addPermission", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(permission, "permission is required") });
}
}
}