Skip to content

Commit cfa4560

Browse files
authored
Merge pull request #1021 from aws-powertools/docs/remove-net6-migration-guide-v3
chore: remove dotnet6 from docs and add migration guides for v2 and v3
2 parents 4d32a19 + 58d29d7 commit cfa4560

File tree

25 files changed

+251
-105
lines changed

25 files changed

+251
-105
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
![aws provider](https://img.shields.io/badge/provider-AWS-orange?logo=amazon-aws&color=ff9900)
44
[![Build](https://github.com/aws-powertools/powertools-lambda-dotnet/actions/workflows/build.yml/badge.svg?branch=develop)](https://github.com/aws-powertools/powertools-lambda-dotnet/actions/workflows/build.yml)
55
[![codecov.io](https://codecov.io/github/aws-powertools/powertools-lambda-dotnet/branch/develop/graphs/badge.svg)](https://app.codecov.io/gh/aws-powertools/powertools-lambda-dotnet)
6-
[![dotnet support](https://img.shields.io/static/v1?label=dotnet&message=%20NET6.0|NET8.0&color=blue?style=flat-square&logo=dotnet)](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
6+
[![dotnet support](https://img.shields.io/static/v1?label=dotnet&message=%20NET8.0&color=blue?style=flat-square&logo=dotnet)](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
77
[![NuGet Downloads](https://img.shields.io/nuget/dt/AWS.Lambda.Powertools.Logging.svg)](https://www.nuget.org/packages?q=AWS.Lambda.Powertools) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/aws-powertools/powertools-lambda-dotnet/badge)](https://scorecard.dev/viewer/?uri=github.com/aws-powertools/powertools-lambda-dotnet)
8-
[![Join our Discord](https://dcbadge.vercel.app/api/server/B8zZKbbyET?style=flat-square)](https://discord.gg/B8zZKbbyET)
8+
[![Discord](https://img.shields.io/badge/Discord-Join_Community-7289da.svg)](https://discord.gg/B8zZKbbyET)
99

1010
Powertools for AWS Lambda (.NET) is a developer toolkit to implement Serverless [best practices and increase developer velocity](https://docs.powertools.aws.dev/lambda-dotnet/#features).
1111

@@ -37,7 +37,7 @@ Powertools for AWS Lambda (.NET) provides three core utilities:
3737

3838
### Installation
3939

40-
The Powertools for AWS Lambda (.NET) utilities (.NET 6 and .NET 8) are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*) or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.
40+
The Powertools for AWS Lambda (.NET) utilities are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*) or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.
4141

4242
* [AWS.Lambda.Powertools.Logging](https://www.nuget.org/packages/AWS.Lambda.Powertools.Logging):
4343

@@ -75,9 +75,22 @@ The Powertools for AWS Lambda (.NET) utilities (.NET 6 and .NET 8) are available
7575

7676
`dotnet add package AWS.Lambda.Powertools.EventHandler.Resolvers.BedrockAgentFunction`
7777

78+
* [AWS.Lambda.Powertools.Kafka.Avro](https://www.nuget.org/packages/AWS.Lambda.Powertools.Kafka.Avro):
79+
80+
`dotnet add package AWS.Lambda.Powertools.Kafka.Avro`
81+
82+
* [AWS.Lambda.Powertools.Kafka.Json](https://www.nuget.org/packages/AWS.Lambda.Powertools.Kafka.Json):
83+
84+
`dotnet add package AWS.Lambda.Powertools.Kafka.Json`
85+
86+
* [AWS.Lambda.Powertools.Kafka.Protobuf](https://www.nuget.org/packages/AWS.Lambda.Powertools.Kafka.Protobuf):
87+
88+
`dotnet add package AWS.Lambda.Powertools.Kafka.Protobuf`
89+
90+
7891
## Examples
7992

80-
We have provided examples focused specifically on each of the utilities. Each solution comes with an AWS Serverless Application Model (AWS SAM) templates to run your functions as a Zip package using the AWS Lambda .NET 6 or .NET 8 managed runtime; or as a container package using the AWS base images for .NET.
93+
We have provided examples focused specifically on each of the utilities. Each solution comes with an AWS Serverless Application Model (AWS SAM) templates to run your functions as a Zip package using the AWS Lambda .NET 8 managed runtime; or as a container package using the AWS base images for .NET.
8194

8295
* **[Logging example](examples/Logging/)**
8396
* **[Metrics example](examples/Metrics/)**

docs/core/event_handler/appsync_events.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ stateDiagram-v2
4848

4949
**[AWS AppSync Events](https://docs.aws.amazon.com/appsync/latest/eventapi/event-api-welcome.html){target="_blank"}**. A service that enables you to quickly build secure, scalable real-time WebSocket APIs without managing infrastructure or writing API code. It handles connection management, message broadcasting, authentication, and monitoring, reducing time to market and operational costs.
5050

51+
!!! warning "Migrating to v3"
52+
53+
If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration.
54+
55+
## Installation
56+
57+
Install the package via NuGet:
58+
59+
```bash
60+
dotnet add package AWS.Lambda.Powertools.EventHandler
61+
```
62+
5163
## Getting started
5264

5365
???+ tip "Tip: New to AppSync Real-time API?"

docs/core/event_handler/bedrock_agent_function.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ flowchart LR
4949

5050
**Amazon Bedrock Agent** is an Amazon Bedrock feature to build and deploy conversational agents that can interact with your customers using Large Language Models (LLM) and AWS Lambda functions.
5151

52+
!!! warning "Migrating to v3"
53+
54+
If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration.
5255

5356
## Installation
5457

docs/core/logging.md

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -25,76 +25,9 @@ The logging utility provides a Lambda optimized logger with output structured as
2525
interface
2626
* Support for message templates `{}` and `{@}` for structured logging
2727

28-
## Breaking changes from v1 (dependency updates)
29-
30-
!!! info
31-
32-
Loooking for V1 specific documentation please go to [Logging v1](/lambda/dotnet/core/logging-v1)
33-
34-
| Change | Before (v1.x) | After (v2.0) | Migration Action |
35-
|--------|---------------|--------------|-----------------|
36-
| Amazon.Lambda.Core | 2.2.0|2.5.0 | dotnet add package Amazon.Lambda.Core |
37-
| Amazon.Lambda.Serialization.SystemTextJson | 2.4.3 | 2.4.4 | dotnet add package Amazon.Lambda.Serialization.SystemTextJson |
38-
| Microsoft.Extensions.DependencyInjection | 8.0.0 | 8.0.1 | dotnet add package Microsoft.Extensions.DependencyInjection |
39-
40-
#### Extra keys - Breaking change
41-
42-
In v1.x, the extra keys were added to the log entry as a dictionary. In v2.x, the extra keys are added to the log entry as
43-
a JSON object.
44-
45-
There is no longer a method that accepts extra keys as first argument.
46-
47-
=== "Before (v1)"
48-
49-
```csharp
50-
public class User
51-
{
52-
public string Name { get; set; }
53-
public int Age { get; set; }
54-
}
55-
56-
Logger.LogInformation<User>(user, "{Name} is {Age} years old",
57-
new object[]{user.Name, user.Age});
58-
59-
var scopeKeys = new
60-
{
61-
PropOne = "Value 1",
62-
PropTwo = "Value 2"
63-
};
64-
Logger.LogInformation(scopeKeys, "message");
65-
66-
```
67-
68-
=== "After (v2)"
69-
70-
```csharp
71-
public class User
72-
{
73-
public string Name { get; set; }
74-
public int Age { get; set; }
75-
76-
public override string ToString()
77-
{
78-
return $"{Name} is {Age} years old";
79-
}
80-
}
81-
82-
// It uses the ToString() method of the object to log the message
83-
// the extra keys are added because of the {@} in the message template
84-
Logger.LogInformation("{@user}", user);
85-
86-
var scopeKeys = new
87-
{
88-
PropOne = "Value 1",
89-
PropTwo = "Value 2"
90-
};
91-
92-
// there is no longer a method that accepts extra keys as first argument.
93-
Logger.LogInformation("{@keys}", scopeKeys);
94-
```
95-
96-
This change was made to improve the performance of the logger and to make it easier to work with the extra keys.
28+
!!! warning "Migrating to v3"
9729

30+
If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration.
9831

9932
## Installation
10033

@@ -1078,7 +1011,7 @@ inheriting the ``ILogFormatter`` class and implementing the ``object FormatLogEn
10781011

10791012
=== "CustomLogFormatter.cs"
10801013

1081-
```c#
1014+
```csharp
10821015
public class CustomLogFormatter : ILogFormatter
10831016
{
10841017
public object FormatLogEntry(LogEntry logEntry)

docs/core/metrics.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,9 @@ These metrics can be visualized through [Amazon CloudWatch Console](https://aws.
1616
* Ahead-of-Time compilation to native code support [AOT](https://docs.aws.amazon.com/lambda/latest/dg/dotnet-native-aot.html) from version 1.7.0
1717
* Support for AspNetCore middleware and filters to capture metrics for HTTP requests
1818

19-
## Breaking changes from V1
19+
!!! warning "Migrating to v3"
2020

21-
!!! info
22-
23-
Loooking for v1 specific documentation please go to [Metrics v1](/lambda/dotnet/core/metrics-v1)
24-
25-
* **`Dimensions`** outputs as an array of arrays instead of an array of objects. Example: `Dimensions: [["service", "Environment"]]` instead of `Dimensions: ["service", "Environment"]`
26-
* **`FunctionName`** is not added as default dimension and only to cold start metric.
27-
* **`Default Dimensions`** can now be included in Cold Start metrics, this is a potential breaking change if you were relying on the absence of default dimensions in Cold Start metrics when searching.
28-
29-
<br />
30-
31-
<figure>
32-
<img src="../../media/metrics_utility_showcase.png" loading="lazy" alt="Screenshot of the Amazon CloudWatch Console showing an example of business metrics in the Metrics Explorer" />
33-
<figcaption>Metrics showcase - Metrics Explorer</figcaption>
34-
</figure>
21+
If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration.
3522

3623
## Installation
3724

docs/core/tracing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ a provides functionality to reduce the overhead of performing common tracing tas
1818
* Auto-disable when not running in AWS Lambda environment
1919
* Ahead-of-Time compilation to native code support [AOT](https://docs.aws.amazon.com/lambda/latest/dg/dotnet-native-aot.html) from version 1.5.0
2020

21+
!!! warning "Migrating to v3"
22+
23+
If you're upgrading to v3, please review the [Migration Guide v3](../migration-guide-v3.md) for important breaking changes including .NET 8 requirement and AWS SDK v4 migration.
24+
2125
## Installation
2226

2327
Powertools for AWS Lambda (.NET) are available as NuGet packages. You can install the packages from [NuGet Gallery](https://www.nuget.org/packages?q=AWS+Lambda+Powertools*){target="_blank"} or from Visual Studio editor by searching `AWS.Lambda.Powertools*` to see various utilities available.

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Powertools for AWS Lambda (.NET)
1010
Powertools for AWS Lambda (.NET) (which from here will be referred as Powertools) is a suite of utilities for [AWS Lambda](https://aws.amazon.com/lambda/) functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more.
1111

1212
!!! info
13-
**Supports .NET 6 and .NET 8 runtimes**
13+
**Supports .NET 8 runtime**
1414

1515
???+ tip
1616
Powertools is also available for [Python](https://docs.powertools.aws.dev/lambda/python/){target="_blank"}, [Java](https://docs.powertools.aws.dev/lambda/java/){target="_blank"}, and [TypeScript](https://docs.powertools.aws.dev/lambda/typescript/latest/){target="_blank"}.
@@ -71,14 +71,14 @@ We have provided you with a custom template for the Serverless Application Model
7171
To use the SAM CLI, you need the following tools.
7272

7373
* SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
74-
* .NET 6.0 (LTS) - [Install .NET 6.0](https://www.microsoft.com/net/download)
74+
* .NET 8.0 (LTS) - [Install .NET 8.0](https://www.microsoft.com/net/download)
7575
* Docker - [Install Docker community edition](https://hub.docker.com/search/?type=edition&offering=community)
7676

77-
Once you have SAM CLI installed, follow the these steps to initialize a .NET 6 project using Powertools for AWS (.NET)
77+
Once you have SAM CLI installed, follow the these steps to initialize a .NET 8 project using Powertools for AWS (.NET)
7878

7979
1. Run the following command in your command line
8080
```bash
81-
sam init -r dotnet6
81+
sam init -r dotnet8
8282
```
8383
2. Select option 1 as your template source
8484

docs/migration-guide-v2.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Migration Guide v2
3+
slug: migration-guide-v2
4+
description: Migration guide to upgrade to v2
5+
---
6+
7+
# Migration Guide to v2
8+
9+
This guide will help you migrate to v2
10+
11+
## Logging
12+
13+
### Breaking changes from v1 (dependency updates)
14+
15+
!!! info
16+
17+
Looking for V1 specific documentation please go to [Logging v1](/lambda/dotnet/core/logging-v1)
18+
19+
| Change | Before (v1.x) | After (v2.0) | Migration Action |
20+
|--------|---------------|--------------|-----------------|
21+
| Amazon.Lambda.Core | 2.2.0|2.5.0 | dotnet add package Amazon.Lambda.Core |
22+
| Amazon.Lambda.Serialization.SystemTextJson | 2.4.3 | 2.4.4 | dotnet add package Amazon.Lambda.Serialization.SystemTextJson |
23+
| Microsoft.Extensions.DependencyInjection | 8.0.0 | 8.0.1 | dotnet add package Microsoft.Extensions.DependencyInjection |
24+
25+
#### Extra keys - Breaking change
26+
27+
In v1.x, the extra keys were added to the log entry as a dictionary. In v2.x, the extra keys are added to the log entry as
28+
a JSON object.
29+
30+
There is no longer a method that accepts extra keys as first argument.
31+
32+
=== "Before (v1)"
33+
34+
```csharp
35+
public class User
36+
{
37+
public string Name { get; set; }
38+
public int Age { get; set; }
39+
}
40+
41+
Logger.LogInformation<User>(user, "{Name} is {Age} years old",
42+
new object[]{user.Name, user.Age});
43+
44+
var scopeKeys = new
45+
{
46+
PropOne = "Value 1",
47+
PropTwo = "Value 2"
48+
};
49+
Logger.LogInformation(scopeKeys, "message");
50+
51+
```
52+
53+
=== "After (v2)"
54+
55+
```csharp
56+
public class User
57+
{
58+
public string Name { get; set; }
59+
public int Age { get; set; }
60+
61+
public override string ToString()
62+
{
63+
return $"{Name} is {Age} years old";
64+
}
65+
}
66+
67+
// It uses the ToString() method of the object to log the message
68+
// the extra keys are added because of the {@} in the message template
69+
Logger.LogInformation("{@user}", user);
70+
71+
var scopeKeys = new
72+
{
73+
PropOne = "Value 1",
74+
PropTwo = "Value 2"
75+
};
76+
77+
// there is no longer a method that accepts extra keys as first argument.
78+
Logger.LogInformation("{@keys}", scopeKeys);
79+
```
80+
81+
This change was made to improve the performance of the logger and to make it easier to work with the extra keys.
82+
83+
## Metrics
84+
85+
### Breaking changes from V1
86+
87+
!!! info
88+
89+
Loooking for v1 specific documentation please go to [Metrics v1](/lambda/dotnet/core/metrics-v1)
90+
91+
* **`Dimensions`** outputs as an array of arrays instead of an array of objects. Example: `Dimensions: [["service", "Environment"]]` instead of `Dimensions: ["service", "Environment"]`
92+
* **`FunctionName`** is not added as default dimension and only to cold start metric.
93+
* **`Default Dimensions`** can now be included in Cold Start metrics, this is a potential breaking change if you were relying on the absence of default dimensions in Cold Start metrics when searching.
94+
95+
<br />
96+
97+
<figure>
98+
<img src="../../media/metrics_utility_showcase.png" loading="lazy" alt="Screenshot of the Amazon CloudWatch Console showing an example of business metrics in the Metrics Explorer" />
99+
<figcaption>Metrics showcase - Metrics Explorer</figcaption>
100+
</figure>
101+

0 commit comments

Comments
 (0)