Show / Hide Table of Contents

Class FunctionBase

Inheritance
System.Object
Construct
Resource
FunctionBase
Function
QualifiedFunctionBase
SingletonFunction
Implements
IFunction
IResource
IConstruct
Constructs.IConstruct
IDependable
IConnectable
IGrantable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Validate()
Construct.Node
Namespace: Amazon.CDK.AWS.Lambda
Assembly: Amazon.CDK.AWS.Lambda.dll
Syntax (csharp)
public abstract class FunctionBase : Resource, IFunction, IResource, IConstruct, IConstruct, IDependable, IConnectable, IGrantable
Syntax (vb)
Public MustInherit Class FunctionBase
    Inherits Resource
    Implements IFunction, IResource, IConstruct, IConstruct, IDependable, IConnectable, IGrantable

Synopsis

Constructors

FunctionBase(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

FunctionBase(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

FunctionBase(Construct, String, IResourceProps)

Properties

CanCreatePermissions

Whether the addPermission() call adds any permissions.

Connections

Access the Connections object.

FunctionArn

The ARN fo the function.

FunctionName

The name of the function.

GrantPrincipal

The principal this Lambda Function is running as.

IsBoundToVpc

Whether or not this Lambda function was bound to a VPC.

LatestVersion

The $LATEST version of this function.

PermissionsNode

The construct node where permissions are attached.

Role

The IAM role associated with this function.

Methods

AddEventSource(IEventSource)

Adds an event source to this function.

AddEventSourceMapping(String, IEventSourceMappingOptions)

Adds an event source that maps to this AWS Lambda function.

AddPermission(String, IPermission)

Adds a permission to the Lambda resource policy.

AddToRolePolicy(PolicyStatement)

Adds a statement to the IAM role assumed by the instance.

ConfigureAsyncInvoke(IEventInvokeConfigOptions)

Configures options for asynchronous invocation.

GrantInvoke(IGrantable)

Grant the given identity permissions to invoke this Lambda.

Metric(String, IMetricOptions)

Return the given named metric for this Function.

MetricDuration(IMetricOptions)

How long execution of this Lambda takes.

MetricErrors(IMetricOptions)

How many invocations of this Lambda fail.

MetricInvocations(IMetricOptions)

How often this Lambda is invoked.

MetricThrottles(IMetricOptions)

How often this Lambda is throttled.

Constructors

FunctionBase(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected FunctionBase(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

FunctionBase(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected FunctionBase(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

FunctionBase(Construct, String, IResourceProps)

protected FunctionBase(Construct scope, string id, IResourceProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IResourceProps

Properties

CanCreatePermissions

Whether the addPermission() call adds any permissions.

protected abstract bool CanCreatePermissions { get; }
Property Value

System.Boolean

Remarks

True for new Lambdas, false for version $LATEST and imported Lambdas from different accounts.

Connections

Access the Connections object.

public virtual Connections_ Connections { get; }
Property Value

Connections_

Remarks

Will fail if not a VPC-enabled Lambda Function

FunctionArn

The ARN fo the function.

public abstract string FunctionArn { get; }
Property Value

System.String

FunctionName

The name of the function.

public abstract string FunctionName { get; }
Property Value

System.String

GrantPrincipal

The principal this Lambda Function is running as.

public abstract IPrincipal GrantPrincipal { get; }
Property Value

IPrincipal

IsBoundToVpc

Whether or not this Lambda function was bound to a VPC.

public virtual bool IsBoundToVpc { get; }
Property Value

System.Boolean

Remarks

If this is is false, trying to access the connections object will fail.

LatestVersion

The $LATEST version of this function.

public virtual IVersion LatestVersion { get; }
Property Value

IVersion

Remarks

Note that this is reference to a non-specific AWS Lambda version, which means the function this version refers to can return different results in different invocations.

To obtain a reference to an explicit version which references the current function configuration, use lambdaFunction.currentVersion instead.

PermissionsNode

The construct node where permissions are attached.

public abstract ConstructNode PermissionsNode { get; }
Property Value

ConstructNode

Role

The IAM role associated with this function.

public abstract IRole Role { get; }
Property Value

IRole

Remarks

Undefined if the function was imported without a role.

Methods

AddEventSource(IEventSource)

Adds an event source to this function.

public virtual void AddEventSource(IEventSource source)
Parameters
source IEventSource
Remarks

Event sources are implemented in the @aws-cdk/aws-lambda-event-sources module.

The following example adds an SQS Queue as an event source:

import { SqsEventSource } from '@aws-cdk/aws-lambda-event-sources';
myFunction.addEventSource(new SqsEventSource(myQueue));

AddEventSourceMapping(String, IEventSourceMappingOptions)

Adds an event source that maps to this AWS Lambda function.

public virtual EventSourceMapping AddEventSourceMapping(string id, IEventSourceMappingOptions options)
Parameters
id System.String
options IEventSourceMappingOptions
Returns

EventSourceMapping

AddPermission(String, IPermission)

Adds a permission to the Lambda resource policy.

public virtual void AddPermission(string id, IPermission permission)
Parameters
id System.String

The id ƒor the permission construct.

permission IPermission

The permission to grant to this Lambda function.

Remarks

See: Permission for details.

AddToRolePolicy(PolicyStatement)

Adds a statement to the IAM role assumed by the instance.

public virtual void AddToRolePolicy(PolicyStatement statement)
Parameters
statement PolicyStatement

ConfigureAsyncInvoke(IEventInvokeConfigOptions)

Configures options for asynchronous invocation.

public virtual void ConfigureAsyncInvoke(IEventInvokeConfigOptions options)
Parameters
options IEventInvokeConfigOptions

GrantInvoke(IGrantable)

Grant the given identity permissions to invoke this Lambda.

public virtual Grant GrantInvoke(IGrantable grantee)
Parameters
grantee IGrantable
Returns

Grant

Metric(String, IMetricOptions)

Return the given named metric for this Function.

public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
metricName System.String
props IMetricOptions
Returns

Metric

MetricDuration(IMetricOptions)

How long execution of this Lambda takes.

public virtual Metric MetricDuration(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Average over 5 minutes

MetricErrors(IMetricOptions)

How many invocations of this Lambda fail.

public virtual Metric MetricErrors(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Sum over 5 minutes

MetricInvocations(IMetricOptions)

How often this Lambda is invoked.

public virtual Metric MetricInvocations(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Sum over 5 minutes

MetricThrottles(IMetricOptions)

How often this Lambda is throttled.

public virtual Metric MetricThrottles(IMetricOptions props = null)
Parameters
props IMetricOptions
Returns

Metric

Remarks

Sum over 5 minutes

Implements

IFunction
IResource
IConstruct
Constructs.IConstruct
IDependable
IConnectable
IGrantable
Back to top Generated by DocFX