|
| 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 | +``` |
0 commit comments