You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description **Documentation Change Type:** - [ ] Typo/grammar fix - [x] Clarification or minor improvement - [ ] New example or code snippet - [ ] New section or topic - [ ] Major restructuring or enhancement **Affected Documentation Page(s):** https://docs.aws.amazon.com/cdk/v2/guide/versioning.html ## Description of Changes Adds a description and clarification of how the AWS CDK Team has interpreted semantic versioning since forever. Also includes minor corrections to the terminology of Lib and CLI. ## Motivation and Context The semver spec has some gaps and leaves room for interpretation. With this we are more accurately describing the CDK's approach to it. ## How Has This Been Validated? Yes ## Screenshots (if appropriate) View on GitHub: https://github.com/awsdocs/aws-cdk-guide/blob/mrgrain-patch-1/v2/guide/versioning.adoc ## Checklist - [x] My changes follow the [AsciiDoc syntax](./CONTRIBUTING.md#asciidoc-syntax-reference) guidelines - [x] I have previewed my changes using GitHub's preview or a local AsciiDoc renderer - [x] My changes maintain consistent formatting with the rest of the documentation - [x] I have checked that all links work correctly ## Additional Information n/a --------- Co-authored-by: Rico Hermans <rix0rrr@gmail.com> Co-authored-by: Kristina Peterson <63321758+KristinaPeterson@users.noreply.github.com> Co-authored-by: Kristina Peterson <kripet@amazon.com>
Copy file name to clipboardExpand all lines: v2/guide/versioning.adoc
+36-10Lines changed: 36 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,26 +17,26 @@ This topic provides reference information on how the {aws} Cloud Development Kit
17
17
18
18
This topic provides reference information on how the {aws} Cloud Development Kit ({aws} CDK) handles versioning.
19
19
20
-
Version numbers consist of three numeric version parts: _major_._minor_._patch_, and strictly adhere to the https://semver.org[semantic versioning] model. This means that breaking changes to stable APIs are limited to major releases.
20
+
Version numbers consist of three numeric version parts: _major_._minor_._patch_, and broadly follow https://semver.org[semantic versioning] principles with a few caveats described in https://docs.aws.amazon.com/cdk/v2/guide/versioning.html#aws-construct-lib-semver[{aws} Construct Library semantic versioning clarifications]. This means that breaking changes to APIs we consider stable are limited to major releases.
21
21
22
-
Minor and patch releases are backward compatible. The code written in a previous version with the same major version can be upgraded to a newer version within the same major version. It will also continue to build and run, producing the same output.
22
+
Minor and patch releases are backward compatible. The code written in a previous version with the same major version can be upgraded to a newer version within the same major version. It will continue to build and run, producing a functionally equivalent result. For some advanced use cases, small changes to your code will be required as noted in the next topic.
23
23
24
24
[#cdk-toolkit-versioning]
25
-
== {aws} CDK CLI compatibility
25
+
== {aws} CDK Toolkit compatibility
26
26
27
-
Each version of the main {aws}CDK library (`aws-cdk-lib`) is compatible with the {aws} CDK CLI (`aws-cdk-cli`) version that was current at the time of the CDK library's release. It is also compatible with any newer version of the CDK CLI. Each version of the CDK library maintains this compatibility until the library's _End of Life_ date. Therefore, as long as you're using a supported CDK library version, it is always safe to upgrade your CDK CLI version.
27
+
Each version of the main {aws}Construct Library (`aws-cdk-lib`) is compatible with the {aws} CDK Toolkit CLI (`aws-cdk-cli`) and Toolkit Library (`@aws-cdk/toolkit-lib`) version that was current at the time of the {aws} Construct Library's release. It is also compatible with any newer version of the {aws}CDK Toolkit. Each version of the {aws} Construct Library maintains this compatibility until the library's _End of Life_ date. Therefore, as long as you're using a supported {aws} Construct Library version, it is always safe to upgrade your {aws}CDK Toolkit version.
28
28
29
-
Each version of the CDK library may also work with CDK CLI versions older than the version that was current at the time of the CDK library's release. However, this is not guaranteed. Compatibility depends on the CDK library's cloud assembly schema version. The {aws} CDK generates a cloud assembly during synthesis and the CDK CLI consumes it for deployment. The schema that defines the format of the cloud assembly is strictly specified and versioned. Therefore, an older version of the CDK CLI would need to support the cloud assembly schema version of the CDK library for them to be compatible.
29
+
Each version of the {aws} Construct Library might also work with {aws}CDK Toolkit versions older than the version that was current at the time of the {aws} Construct Library's release. However, this is not guaranteed. Compatibility depends on the {aws} Construct Library's cloud assembly schema version. The {aws} CDK generates a cloud assembly during synthesis and the {aws}CDK Toolkit consumes it for deployment. The schema that defines the format of the cloud assembly is strictly specified and versioned. Therefore, an older version of the {aws}CDK Toolkit would need to support the cloud assembly schema version of the {aws} Construct Library for them to be compatible.
30
30
31
-
When the cloud assembly version required by the CDK library is not compatible with the version supported by the CDK CLI, you receive an error message like the following:
31
+
When the cloud assembly version required by the {aws} Construct Library is not compatible with the version supported by the {aws}CDK Toolkit, you receive an error message like the following:
32
32
33
33
[source,none,subs="verbatim,attributes"]
34
34
----
35
35
Cloud assembly schema version mismatch: Maximum schema version supported is 3.0.0, but found 4.0.0.
36
36
Please upgrade your CLI in order to interact with this app.
37
37
----
38
38
39
-
To resolve this error, update the CDK CLI to a version compatible with the required cloud assembly version, or to the latest available version. The alternative (downgrading the construct library modules your app uses) is generally not recommended.
39
+
To resolve this error, update the {aws}CDK Toolkit to a version compatible with the required cloud assembly version, or to the latest available version. The alternative (downgrading the {aws} Construct Library modules your app uses) is generally not recommended.
40
40
41
41
[NOTE]
42
42
====
@@ -50,12 +50,38 @@ For more information on the exact combinations of versions that work together, s
50
50
51
51
The modules in the {aws} Construct Library move through various stages as they are developed from concept to mature API. Different stages offer varying degrees of API stability in subsequent versions of the {aws} CDK.
52
52
53
-
APIs in the main {aws}CDK library, `aws-cdk-lib`, are stable, and the library is fully semantically versioned. This package includes {aws} CloudFormation (L1) constructs for all {aws} servicesand all stable higher-level (L2 and L3) modules. (It also includes the core CDK classes like `App` and `Stack`). APIs will not be removed from this package (though they may be deprecated) until the next major release of the CDK. No individual API will ever have breaking changes. When a breaking change is required, an entirely new API will be added.
53
+
Except for scenarios where the caveats documented in the next topic apply, APIs in the main {aws}Construct Library (`aws-cdk-lib`) are stable, and the library broadly follows semantic versioning principles. The library includes {aws} CloudFormation (L1) constructs for all {aws} services, which are auto-generated from https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/resource-type-schemas.html[CloudFormation resource provider schemas] and might sometimes include backward incompatible updates. It also includes higher-level (L2 and L3) constructs and the core CDK classes like `App` and `Stack`, which are all stable. APIs will not be removed from this package (though they might be deprecated) until the next major release of the CDK. When a breaking change is required to a stable API, an entirely new API will be added.
54
54
55
-
New APIs under development for a service already incorporated in `aws-cdk-lib` are identified using a `Beta<N>` suffix, where `N` starts at 1 and is incremented with each breaking change to the new API. `Beta<N>` APIs are never removed, only deprecated, so your existing app continues to work with newer versions of ``aws-cdk-lib``. When the API is deemed stable, a new API without the `Beta<N>` suffix is added.
55
+
New APIs under development for a service already incorporated in `aws-cdk-lib` are identified using a `Beta<N>` suffix, where `N` starts at 1 and is incremented with each breaking change to the new API. `Beta<N>` APIs are never removed, only deprecated, so your existing app continues to work with newer versions of `aws-cdk-lib`. When the API is deemed stable, a new API without the `Beta<N>` suffix is added.
56
56
57
57
When higher-level (L2 or L3) APIs begin to be developed for an {aws} service that previously had only L1 APIs, those APIs are initially distributed in a separate package. The name of such a package has an "Alpha" suffix, and its version matches the first version of `aws-cdk-lib` it is compatible with, with an `alpha` sub-version. When the module supports the intended use cases, its APIs are added to `aws-cdk-lib`.
While the {aws} Construct Library broadly follows semantic versioning principles, there are some important caveats specific to our implementation. In general the {aws} Construct Library maintains stability for API consumers, but sometimes adds additional burdens to construct authors to enable the necessary evolution of the framework.
63
+
64
+
* **Security impacting changes**
65
+
+
66
+
To meet our security bar, we might be required to change APIs in backward incompatible ways or remove them entirely. This prevents affected APIs from being used and forces implementations to be updated.
67
+
* **Features are described by intent**
68
+
+
69
+
We aim to minimize unexpected changes, but will favor _intent over implementation stability_. The {aws} Construct Library does not guarantee that constructs always synthesize to the exact same CloudFormation template or use the exact same set of resources. This especially applies to higher-level constructs, where the same goal can often be achieved in different ways.
70
+
* **Implementing Interfaces and Abstract Classes**
71
+
+
72
+
Interfaces and abstract classes in the {aws} Construct Library are stable for *consumers*, but not for *implementors*. This means that you can safely rely on interfaces like `s3.IBucket` to provide at least the same functionality as at the time ({aws} Construct Library version) that you started consuming the interface or abstract class. However, periodically, new (abstract) members will be added to interfaces and abstract classes. For anyone *implementing* them, this creates an additional implementation burden to consider when upgrading, since the implementation wouldn't be implementing the new members yet. Strictly treating additions to interfaces and abstract classes for implementors as breaking changes would unduly limit the evolvability of the {aws} Construct Library. In most cases, implementors should prefer to extend concrete classes like `s3.Bucket`.
73
+
* **L1 constructs, generated code, and other APIs marked as external**
74
+
+
75
+
Parts of the {aws} Construct Library are generated from data sources coming directly from {aws} services. To keep these APIs aligned with reality, generated code might contain backward incompatible changes. Most of the time, data sources are updated to correctly reflect reality and rectify incorrect representation. _Your IDE's IntelliSense will display external APIs with the `@stability — external` annotation._
76
+
* **Specific language bindings**
77
+
+
78
+
Language bindings can contain backward incompatible changes in a very limited number of situations. These are caused by upstream type changes that are backward compatible in other supported languages. These types changes are allowed, as doing otherwise would severely limit the evolvability of the library.
79
+
+
80
+
The following list describes all known instances:
81
+
+
82
+
****Golang - Changing from typed slice to any slice: **
83
+
A list of a single type is changing to a list of multiple types (union types in TypeScript). In `Go`, these are typed as a slice of any (`\*[]any`). Due to Go’s typing assignment rules, changing from `*[]*string` to `*[]any` is not an automatic conversion. Therefore, this type widening requires consumer code to change. See https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-go.html#go-cdk-idioms[Working with any slice] for strategies.
84
+
59
85
[#aws-construct-lib-versioning-binding]
60
86
== Language binding stability
61
87
@@ -83,4 +109,4 @@ Over time, we might add support to the {aws} CDK for additional programming lang
0 commit comments