Skip to content

Commit 76131cc

Browse files
committed
docs: compatibility table for CLI/library versions
Describe the compatibility model, and add a table linking the CLI and library versions.
1 parent f855b15 commit 76131cc

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

COMPATIBILITY.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# CDK CLI and AWS Construct Library compatibility table
2+
3+
The table below show what version of the CDK CLI is required for a particular
4+
version of the AWS Construct Library:
5+
6+
The table below contains the specific versions of the schema, along with the
7+
CLI that supports them and the Construct Library that uses them.
8+
9+
| Library version | Minimum CLI Version | Schema Version |
10+
|-----------------|---------------------|----------------|
11+
| 2.174.0 | 2.174.0 | 39 |
12+
| 2.182.0 | 2.1000.0 | 40 |
13+
| (unreleased) | 2.1003.0 | 41 |
14+
15+
How to use this table: find your library version in the leftmost column.
16+
If it's not in there, find the highest version lower than your library version.
17+
The middle column indicates the minimum version of the CDK CLI you need to use.
18+
19+
## How it works
20+
21+
(This section describes how the protocol between App and CLI is versioned and
22+
is purely for reference; the table above contains the most important information.)
23+
24+
The compatibility between the construct library and the CLI is based on the
25+
version of the [Cloud Assembly Schema](./packages/@aws-cdk/cloud-assembly-schema)
26+
used by the construct library and supported by the CLI app. The app writes
27+
a particular version `X` of the Cloud Assembly, and the CLI can read all versions
28+
up to and including the version `Y` that was current when it was released. We
29+
need `X <= Y`.
30+
31+
```
32+
┌────────┐ ┌─────────┐ ┌──────────┐
33+
│ │ (writes) │ │ (reads) │ │
34+
│ App │─────────▶│ cdk.out │◀──────────│ CLI │
35+
│ │ │ │ │ │
36+
└────────┘ schema └─────────┘ schemas └──────────┘
37+
vX <= vY
38+
```
39+
40+
### Compatibility rule for CLI < 2.1000.0
41+
42+
Before CDK CLI `2.1000.0`, the CLI and the library were released in lockstep
43+
with the same version number, and so the versions `X` and `Y` above are the
44+
same for a given version number.
45+
46+
An easy compatibility rule therefore is: the CLI supports apps written against
47+
the AWS Construct Library with the same version or lower. It might support more
48+
versions as well, but it *at least* supports those.
49+
50+
This works because `v(App) <= v(CLI)` guarantees that `X <= Y`.
51+
52+
### Compatibility rule for CLI >= 2.1000.0
53+
54+
Since CDK CLI `2.1000.0`, the CLI and construct library have two different
55+
versions. The only rule that relates `X` and `Y` involves the *release date* of
56+
the respective packages. The CLI version that supports a particular schema version
57+
is always released before a CDK app starts emitting cloud assemblies using
58+
that schema.
59+
60+
A general rule therefore is: a particular library version's Cloud Assemblies
61+
are supported by the CLI that is current at the time of the library's release,
62+
as well as every newer CLI version. It might be supported by older versions, but
63+
it is *at least* supported by those.
64+
65+
This works because the CLI that is current at time of release of a
66+
particular library version can always handle the output of that library
67+
version and every version before it.
68+
69+
In a visual example:
70+
71+
```
72+
this CLI version...
73+
74+
o
75+
CLI │ │ │ │ │ │ │ │
76+
─────┬┴─────┴┬────┴──┬────┬─┴────┬──┴──────┴┬────┴───┬──┴───→ (time)
77+
Library │ │ │ │ │ │ │
78+
⋏ ⋏ ⋏ ⋏ ⋏
79+
...supports at least these library versions
80+
```
81+
82+
And the other way around:
83+
84+
```
85+
this library version...
86+
87+
o
88+
Library │ │ │ │ │ │ │
89+
─────┴┬─────┬┴────┬──┴────┴─┬────┴──┬──────┬┴────┬───┴──┬────→ (time)
90+
CLI │ │ │ │ │ │ │ │
91+
⋏ ⋏ ⋏ ⋏ ⋏
92+
...is supported by these CLI versions
93+
```

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,12 @@ Here are the packages in this repository. See the README of each package for mor
6262
Every package comes with its own unit tests. There is a companion repository to this one containing the integration tests. You can find it here: <https://github.com/aws/aws-cdk-cli-testing>
6363

6464
See the [contributing guide](./CONTRIBUTING.md) for more information on this repository.
65+
66+
## Compatibility
67+
68+
The CLI is always able to process CDK apps using a version of the Construct Library
69+
released before it. We recommend you always keep the CLI version up-to-date to get the
70+
latest features.
71+
72+
For more details on the compatibility model and specific versions that work together,
73+
see [COMPATIBILITY.md](COMPATIBILITY.md).

0 commit comments

Comments
 (0)