@Generated(value="jsii-pacmak/0.10.5 (build 46bc9b0)", date="2019-05-06T20:53:37.750Z") public class Function extends FunctionBase
| Modifier | Constructor and Description |
|---|---|
|
Function(software.amazon.awscdk.Construct scope,
String id,
FunctionProps props) |
protected |
Function(software.amazon.jsii.JsiiObject.InitializationMode mode) |
| Modifier and Type | Method and Description |
|---|---|
Function |
addEnvironment(String key,
Object value)
Adds an environment variable to this Lambda function.
|
Function |
addLayer(ILayerVersion layer)
Adds a Lambda Layer to this Lambda function.
|
Version |
addVersion(String name)
Add a new version for this Lambda.
|
Version |
addVersion(String name,
String codeSha256)
Add a new version for this Lambda.
|
Version |
addVersion(String name,
String codeSha256,
String description)
Add a new version for this Lambda.
|
FunctionAttributes |
export()
Export this Function (without the role).
|
static IFunction |
fromFunctionArn(software.amazon.awscdk.Construct scope,
String id,
String functionArn) |
static IFunction |
fromFunctionAttributes(software.amazon.awscdk.Construct scope,
String id,
FunctionAttributes attrs)
Creates a Lambda function object which represents a function not defined within this stack.
|
protected Boolean |
getCanCreatePermissions()
Whether the addPermission() call adds any permissions.
|
String |
getFunctionArn()
ARN of this function.
|
String |
getFunctionName()
Name of this function.
|
software.amazon.awscdk.services.iam.IPrincipal |
getGrantPrincipal()
The principal this Lambda Function is running as.
|
String |
getHandler()
The name of the handler configured for this lambda.
|
software.amazon.awscdk.services.iam.IRole |
getRole()
Execution role associated with this function.
|
Runtime |
getRuntime()
The runtime configured for this lambda.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAll(String metricName)
Return the given named metric for this Lambda.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAll(String metricName,
software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Return the given named metric for this Lambda.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllConcurrentExecutions()
Metric for the number of concurrent executions across all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllConcurrentExecutions(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the number of concurrent executions across all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllDuration()
Metric for the Duration executing all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllDuration(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the Duration executing all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllErrors()
Metric for the number of Errors executing all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllErrors(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the number of Errors executing all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllInvocations()
Metric for the number of invocations of all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllInvocations(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the number of invocations of all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllThrottles()
Metric for the number of throttled invocations of all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllThrottles(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the number of throttled invocations of all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllUnreservedConcurrentExecutions()
Metric for the number of unreserved concurrent executions across all Lambdas.
|
static software.amazon.awscdk.services.cloudwatch.Metric |
metricAllUnreservedConcurrentExecutions(software.amazon.awscdk.services.cloudwatch.MetricOptions props)
Metric for the number of unreserved concurrent executions across all Lambdas.
|
Version |
newVersion()
Add a new version for this Lambda, always with a different name.
|
addEventSource, addPermission, addToRolePolicy, asBucketNotificationDestination, asStepFunctionsTaskResource, getConnections, getId, getIsBoundToVpc, grantInvoke, logSubscriptionDestination, metric, metric, metricDuration, metricDuration, metricErrors, metricErrors, metricInvocations, metricInvocations, metricThrottles, metricThrottlesgetDependencyRoots, getNode, isConstruct, prepare, toString, validatejsiiAsyncCall, jsiiCall, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticGet, jsiiStaticSetprotected Function(software.amazon.jsii.JsiiObject.InitializationMode mode)
public Function(software.amazon.awscdk.Construct scope,
String id,
FunctionProps props)
public static IFunction fromFunctionArn(software.amazon.awscdk.Construct scope, String id, String functionArn)
public static IFunction fromFunctionAttributes(software.amazon.awscdk.Construct scope, String id, FunctionAttributes attrs)
scope - The parent construct.id - The name of the lambda construct.attrs - A reference to a Lambda function.public static software.amazon.awscdk.services.cloudwatch.Metric metricAll(String metricName, @Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAll(String metricName)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllConcurrentExecutions(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllConcurrentExecutions()
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllDuration(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllDuration()
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllErrors(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllErrors()
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllInvocations(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllInvocations()
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllThrottles(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllThrottles()
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllUnreservedConcurrentExecutions(@Nullable software.amazon.awscdk.services.cloudwatch.MetricOptions props)
public static software.amazon.awscdk.services.cloudwatch.Metric metricAllUnreservedConcurrentExecutions()
public Function addEnvironment(String key, @Nullable Object value)
key - The environment variable key.value - The environment variable's value.public Function addLayer(ILayerVersion layer)
layer - the layer to be added.public Version addVersion(String name, @Nullable String codeSha256, @Nullable String description)
name - A unique name for this version.codeSha256 - The SHA-256 hash of the most recently deployed Lambda source code, or omit to skip validation.description - A description for this version.public Version addVersion(String name, @Nullable String codeSha256)
name - A unique name for this version.codeSha256 - The SHA-256 hash of the most recently deployed Lambda source code, or omit to skip validation.public Version addVersion(String name)
name - A unique name for this version.public FunctionAttributes export()
export in interface IFunctionexport in class FunctionBasepublic Version newVersion()
addVersion method,
but useful when deploying this Lambda through CodePipeline with blue/green deployments.
When using addVersion,
your Alias will not be updated until you change the name passed to addVersion in your CDK code.
When deploying through a Pipeline,
that might lead to a situation where a change to your Lambda application code will never be activated,
even though it traveled through the entire Pipeline,
because the Alias is still pointing to an old Version.
This method creates a new, unique Version every time the CDK code is executed,
and so prevents that from happening.protected Boolean getCanCreatePermissions()
getCanCreatePermissions in class FunctionBasepublic String getFunctionArn()
getFunctionArn in interface IFunctiongetFunctionArn in class FunctionBasepublic String getFunctionName()
getFunctionName in interface IFunctiongetFunctionName in class FunctionBasepublic software.amazon.awscdk.services.iam.IPrincipal getGrantPrincipal()
getGrantPrincipal in interface software.amazon.awscdk.services.iam.IGrantablegetGrantPrincipal in class FunctionBasepublic String getHandler()
public Runtime getRuntime()
@Nullable public software.amazon.awscdk.services.iam.IRole getRole()
getRole in interface IFunctiongetRole in class FunctionBaseCopyright © 2019. All rights reserved.