Skip to content

Commit

Permalink
chore: add migration guide (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc authored Apr 14, 2022
1 parent 2e480f2 commit 076ab1a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
43 changes: 43 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Migrating to @aws-cdk-containers/ecs-service-extensions v2

The v2 version of this module comes with two main changes. It is now
compatible with CDK v2, and has multi-language support. It is recommended
that you migrate your own application or construct library to v2 of
`@aws-cdk-containers/ecs-service-extensions` to continue to receive
features and bug fixes.

There are no big API changes between v1 and v2. However, there may be
some small modifications necessary to get your application ready for
`@aws-cdk-containers/ecs-service-extensions` v2.

## Step 1: Migrate your CDK application or library to AWS CDK v2

See the steps [here](https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html).

## Step 2: Update dependencies in your package.json

```json
{
"dependencies": {
"@aws-cdk-containers/ecs-service-extensions": "^2.0.0",
}
}
```

## Step 3: Type Changes

If you use any of the following properties, change them to use their v2 types.

- `Environment.cluster` changes from type `ecs.Cluster` to `ecs.ICluster`.
- `InjecterExtensionProps.injectables` changes from type `Injectable[]` to `IInjectable[]`.
- `MeshProps.protocol` changes from type `appmesh.Protocol` to `Protocol`.

## Step 4: Name Changes

If you use any of the following APIs, change them to use their v2 names.

| v1 API | v2 API
|-------------------------------------|------------------------------------------------|
| `ConnectToProps.local_bind_port` | `ConnectToProps.localBindPort` |
| `Injectable` | `IInjectable` |
| `GrantInjectable` | `IGrantInjectable` |
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ import {
Service,
ServiceDescription,
XRayExtension,
} from 'cdk-ecs-service-extensions';
} from '@aws-cdk-containers/ecs-service-extensions';
```

If you are using the `@aws-cdk-containers/ecs-service-extensions` v1 and need to migrate to
v2, see the [Migration Guide](https://github.com/cdklabs/cdk-ecs-service-extensions/blob/main/MIGRATING.md).

## `Service` construct

The `Service` construct provided by this module can be extended with optional `ServiceExtension` classes that add supplemental ECS features including:

- [AWS X-Ray](https://aws.amazon.com/xray/) for tracing your application
Expand Down

0 comments on commit 076ab1a

Please sign in to comment.