Interface ILambdaFunctionDependencyProvider
The ILambda
Namespace: LambdaSharp
Assembly: LambdaSharp.dll
Syntax
public interface ILambdaFunctionDependencyProvider
Properties
ConfigSource
Retrieves the ILambda
Declaration
ILambdaConfigSource ConfigSource { get; }
Property Value
Type | Description |
---|---|
ILambda |
The ILambda |
DebugLoggingEnabled
The Debug
Declaration
bool DebugLoggingEnabled { get; }
Property Value
Type | Description |
---|---|
System. |
Boolean indicating if requests and responses are logged |
UtcNow
Retrieves the current date-time in UTC timezone.
Declaration
DateTime UtcNow { get; }
Property Value
Type | Description |
---|---|
System. |
Current System. |
Methods
DecryptSecretAsync(Byte[], Dictionary<String, String>, CancellationToken)
Decrypt a sequence of bytes with an optional encryption context. The Lambda function
requires permission to use the kms:Decrypt
operation on the KMS key used to
encrypt the original message.
Declaration
Task<byte[]> DecryptSecretAsync(byte[] secretBytes, Dictionary<string, string> encryptionContext = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System. |
secretBytes | Array containing the encrypted bytes. |
System. |
encryptionContext | An optional encryption context. Can be |
System. |
cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
EncryptSecretAsync(Byte[], String, Dictionary<String, String>, CancellationToken)
Encrypt a sequence of bytes using the specified KMS key. The Lambda function requires
permission to use the kms:Encrypt
opeartion on the specified KMS key.
Declaration
Task<byte[]> EncryptSecretAsync(byte[] plaintextBytes, string encryptionKeyId, Dictionary<string, string> encryptionContext = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System. |
plaintextBytes | Array containing plaintext byte to encrypt. |
System. |
encryptionKeyId | The KMS key ID used encrypt the plaintext bytes. |
System. |
encryptionContext | An optional encryption context. Can be |
System. |
cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |
Log(String)
Write a message to the log stream. In production, this should be the CloudWatch log associated with the Lambda function.
Declaration
void Log(string message)
Parameters
Type | Name | Description |
---|---|---|
System. |
message | Message to write to the log stream. |
SendEventAsync(DateTimeOffset, String, String, String, String, IEnumerable<String>, CancellationToken)
Send a CloudWatch event with optional event details and resources it applies to. This event will be forwarded to the default EventBridge by LambdaSharp.Core (requires Core Services to be enabled).
Declaration
Task SendEventAsync(DateTimeOffset timestamp, string eventbus, string source, string detailType, string detail, IEnumerable<string> resources, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System. |
timestamp | The timestamp of the event. |
System. |
eventbus | The event bus that will receive the event. |
System. |
source | The source application of the event. |
System. |
detailType | Free-form string used to decide what fields to expect in the event detail. |
System. |
detail | Optional data-structure serialized as JSON string. There is no other schema imposed. The data-structure may contain fields and nested subobjects. |
System. |
resources | Optional AWS or custom resources, identified by unique identifier (e.g. ARN), which the event primarily concerns. Any number, including zero, may be present. |
System. |
cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System. |
SendMessageToQueueAsync(String, String, IEnumerable<KeyValuePair<String, String>>, CancellationToken)
Send a message to the specified SQS queue. The Lambda function requires sqs:SendMessage
permission
on the specified SQS queue.
Declaration
Task SendMessageToQueueAsync(string queueUrl, string message, IEnumerable<KeyValuePair<string, string>> messageAttributes = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System. |
queueUrl | The SQS queue URL. |
System. |
message | The message to send. |
System. |
messageAttributes | Optional attributes for the message. |
System. |
cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
System. |
The task object representing the asynchronous operation. |