# ContainerDependency

The details of a dependency on another container in the task definition.

- Source: [`aws-ecs/lib/container-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/container-definition.ts#L1201)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';

declare const containerDefinition: ecs.ContainerDefinition;
const containerDependency: ecs.ContainerDependency = {
  container: containerDefinition,

  // the properties below are optional
  condition: ecs.ContainerDependencyCondition.START,
};
```

## Properties

- `condition`: [ContainerDependencyCondition](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerDependencyCondition.html) — The state the container needs to be in to satisfy the dependency and proceed with startup.

  **Default:** ContainerDependencyCondition.HEALTHY

  Valid values are ContainerDependencyCondition.START, ContainerDependencyCondition.COMPLETE,
  ContainerDependencyCondition.SUCCESS and ContainerDependencyCondition.HEALTHY.

- `container`: [ContainerDefinition](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerDefinition.html) (required) — The container to depend on.
