Skip to content

Commit 292fefb

Browse files
Merge branch 'dev'
2 parents 4b4ef6b + 7600d6d commit 292fefb

25 files changed

+692
-27
lines changed

.github/workflows/aws-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Configure AWS Credentials
19-
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4
19+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v4
2020
with:
2121
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }}
2222
role-duration-seconds: 7200
@@ -29,7 +29,7 @@ jobs:
2929
$roleArn=$(cat ./response.json)
3030
"roleArn=$($roleArn -replace '"', '')" >> $env:GITHUB_OUTPUT
3131
- name: Configure Test Runner Credentials
32-
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4
32+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v4
3333
with:
3434
role-to-assume: ${{ steps.lambda.outputs.roleArn }}
3535
role-duration-seconds: 7200

.github/workflows/change-file-in-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515

1616
steps:
1717
- name: Checkout PR code
18-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
18+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
1919

2020
- name: Get List of Changed Files
2121
id: changed-files
22-
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 #v45
22+
uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 #v45
2323

2424
- name: Check for Change File(s) in .autover/changes/
2525
run: |

.github/workflows/create-release-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
# Assume an AWS Role that provides access to the Access Token
2727
- name: Configure AWS Credentials
28-
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4
28+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v4
2929
with:
3030
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3131
aws-region: us-west-2
@@ -38,13 +38,13 @@ jobs:
3838
parse-json-secrets: true
3939
# Checkout a full clone of the repo
4040
- name: Checkout
41-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
41+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
4242
with:
4343
fetch-depth: '0'
4444
token: ${{ env.AWS_SECRET_TOKEN }}
4545
# Install .NET8 which is needed for AutoVer
4646
- name: Setup .NET 8.0
47-
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d #v5.0.0
47+
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 #v5.0.1
4848
with:
4949
dotnet-version: 8.0.x
5050
# Install AutoVer to automate versioning and changelog creation

.github/workflows/doc-site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pinning V4 #v4.2.2
29+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pinning V4 #v6.0.1
3030
- name: Dotnet Setup
31-
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # pinning V4 #v5.0.0
31+
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 # pinning V4 #v5.0.1
3232
with:
3333
dotnet-version: 8.x
3434

.github/workflows/semgrep-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
if: (github.actor != 'dependabot[bot]')
2626
steps:
2727
# Fetch project source
28-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
28+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
2929

3030
- run: semgrep ci --sarif > semgrep.sarif
3131
env:
@@ -35,7 +35,7 @@ jobs:
3535
p/owasp-top-ten
3636
3737
- name: Upload SARIF file for GitHub Advanced Security Dashboard
38-
uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 #v3.30.5
38+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 #v4.31.9
3939
with:
4040
sarif_file: semgrep.sarif
4141
if: always()

.github/workflows/stale_issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
name: Stale issue job
1616
steps:
17-
- uses: aws-actions/stale-issue-cleanup@5650b49bcd757a078f6ca06c373d7807b773f9bc #v7.1.0
17+
- uses: aws-actions/stale-issue-cleanup@0604f2edf84a3a66bc0dfb4a30eb07814cbdf440 #v7.1.1
1818
with:
1919
# Setting messages to an empty string will cause the automation to skip
2020
# that category

.github/workflows/sync-main-dev.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
# Assume an AWS Role that provides access to the Access Token
2929
- name: Configure AWS Credentials
30-
uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df #v4
30+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 #v4
3131
with:
3232
role-to-assume: ${{ secrets.RELEASE_WORKFLOW_ACCESS_TOKEN_ROLE_ARN }}
3333
aws-region: us-west-2
@@ -40,14 +40,14 @@ jobs:
4040
parse-json-secrets: true
4141
# Checkout a full clone of the repo
4242
- name: Checkout code
43-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
43+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
4444
with:
4545
ref: dev
4646
fetch-depth: 0
4747
token: ${{ env.AWS_SECRET_TOKEN }}
4848
# Install .NET8 which is needed for AutoVer
4949
- name: Setup .NET 8.0
50-
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d #v5.0.0
50+
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 #v5.0.1
5151
with:
5252
dotnet-version: 8.0.x
5353
# Install AutoVer which is needed to retrieve information about the current release.
@@ -107,13 +107,13 @@ jobs:
107107
steps:
108108
# Checkout a full clone of the repo
109109
- name: Checkout code
110-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
110+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
111111
with:
112112
ref: releases/next-release
113113
fetch-depth: 0
114114
# Install .NET8 which is needed for AutoVer
115115
- name: Setup .NET 8.0
116-
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d #v5.0.0
116+
uses: actions/setup-dotnet@2016bd2012dba4e32de620c46fe006a3ac9f0602 #v5.0.1
117117
with:
118118
dotnet-version: 8.0.x
119119
# Install AutoVer which is needed to retrieve information about the current release.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Release 2026-01-22
2+
3+
### AWS.Messaging (1.1.0)
4+
* Added support for pollers that are tied to a single message type. This change also allows processing messages that use the CloudEvents envelope as well as those that do not.
5+
* Add SentTimestamp to SQSMetadata
6+
17
## Release 2025-11-17
28

39
### AWS.Messaging.Lambda (1.0.2)

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,78 @@ await Host.CreateDefaultBuilder(args)
245245
.RunAsync();
246246
```
247247

248+
### Consuming AWS service events (raw JSON payloads)
249+
Many AWS services can deliver events to SQS (directly, via SNS, or via EventBridge rules). These payloads are typically *raw JSON* and do not include the framework's CloudEvents envelope.
250+
251+
To consume raw JSON payloads, configure the SQS poller for a *single message type* and disable envelope support via `MessageEnvelopeMode.NotSupported`.
252+
253+
#### Example: Consume S3 event notifications from SQS
254+
If you configure an S3 bucket to send event notifications directly to an SQS queue (for example, `s3:ObjectCreated:*`), the message body contains an S3 event notification JSON document.
255+
256+
You can model this payload yourself, but you can also reuse the strongly-typed event classes from the AWS Lambda .NET packages.
257+
258+
Add the S3 events package:
259+
```
260+
dotnet add package Amazon.Lambda.S3Events
261+
```
262+
263+
The following example uses `Amazon.Lambda.S3Events.S3Event` and configures JSON deserialization to be case-insensitive (S3 event JSON uses a mix of `Records` and camelCase properties).
264+
265+
```csharp
266+
using System.Text.Json;
267+
using AWS.Messaging;
268+
using AWS.Messaging.Configuration;
269+
using Amazon.Lambda.S3Events;
270+
using Microsoft.Extensions.Hosting;
271+
272+
public sealed class S3EventNotificationHandler : IMessageHandler<S3Event>
273+
{
274+
public Task<MessageProcessStatus> HandleAsync(
275+
MessageEnvelope<S3Event> messageEnvelope,
276+
CancellationToken token = default)
277+
{
278+
var record = messageEnvelope.Message.Records?.FirstOrDefault();
279+
var bucket = record?.S3?.Bucket?.Name;
280+
var key = record?.S3?.Object?.Key;
281+
282+
Console.WriteLine($"S3 event: bucket='{bucket}', key='{key}', eventName='{record?.EventName}'");
283+
284+
return Task.FromResult(MessageProcessStatus.Success());
285+
}
286+
}
287+
288+
await Host.CreateDefaultBuilder(args)
289+
.ConfigureServices(services =>
290+
{
291+
services.AddAWSMessageBus(builder =>
292+
{
293+
// The poller is tied to a single message type and expects raw JSON.
294+
// This is a good fit for a queue dedicated to a single AWS service event.
295+
builder.AddSQSPoller<S3Event>(
296+
"https://sqs.us-west-2.amazonaws.com/012345678910/MyAppProd",
297+
messageEnvelopeMode: MessageEnvelopeMode.NotSupported);
298+
299+
// Recommended for AWS service event JSON: be lenient about casing.
300+
builder.ConfigureSerializationOptions(options =>
301+
{
302+
options.SystemTextJsonOptions = new JsonSerializerOptions
303+
{
304+
PropertyNameCaseInsensitive = true
305+
};
306+
});
307+
308+
builder.AddMessageHandler<S3EventNotificationHandler, S3Event>();
309+
});
310+
})
311+
.Build()
312+
.RunAsync();
313+
```
314+
315+
Notes:
316+
* Without the CloudEvents envelope, the framework cannot type-route messages by a `'type'` discriminator. Use a dedicated queue per message type (or configure multiple pollers).
317+
* The S3-to-SQS notification format can include additional properties not modeled above; that's fine as long as your handler reads the fields it needs.
318+
* This same approach works with other AWS Lambda .NET event packages (for example, `Amazon.Lambda.SNSEvents`, etc.) when the SQS message body is raw JSON for that event type.
319+
248320
### Configuring the SQS Message Poller
249321
The SQS message poller can be configured by the `SQSMessagePollerOptions` when calling `AddSQSPoller`.
250322
* `MaxNumberOfConcurrentMessages` - The maximum number of messages from the queue to process concurrently. The default value is `10`.

src/AWS.Messaging/AWS.Messaging.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<NoWarn>CS1591</NoWarn>
1919
<SignAssembly>true</SignAssembly>
2020
<AssemblyOriginatorKeyFile>..\..\public.snk</AssemblyOriginatorKeyFile>
21-
<Version>1.0.2</Version>
21+
<Version>1.1.0</Version>
2222
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2323
<EmbedUntrackedSources>true</EmbedUntrackedSources>
2424
<IncludeSymbols>true</IncludeSymbols>

0 commit comments

Comments
 (0)