-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ecs): update LogDriver to new bind pattern (#2990)
Update LogDriver bind in accordance with how we do binds in the rest of the library. BREAKING CHANGES: * **ecs**: `AwsLogDriver` no longer takes construct properties.
- Loading branch information
Showing
24 changed files
with
143 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import cdk = require('@aws-cdk/cdk'); | ||
import { Construct } from '@aws-cdk/cdk'; | ||
import { ContainerDefinition } from '../container-definition'; | ||
import { CfnTaskDefinition } from '../ecs.generated'; | ||
import { AwsLogDriver, AwsLogDriverProps } from './aws-log-driver'; | ||
|
||
/** | ||
* Base class for log drivers | ||
*/ | ||
export abstract class LogDriver extends cdk.Construct { | ||
export abstract class LogDriver { | ||
/** | ||
* Return the log driver CloudFormation JSON | ||
* Create an AWS Logs logdriver | ||
*/ | ||
public abstract renderLogDriver(): CfnTaskDefinition.LogConfigurationProperty; | ||
public static awsLogs(props: AwsLogDriverProps): LogDriver { | ||
return new AwsLogDriver(props); | ||
} | ||
|
||
/** | ||
* Called when the log driver is configured on a container | ||
*/ | ||
public abstract bind(containerDefinition: ContainerDefinition): void; | ||
public abstract bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig; | ||
} | ||
|
||
/** | ||
* Configuration to create a log driver from | ||
*/ | ||
export interface LogDriverConfig { | ||
/** | ||
* Name of the log driver to use | ||
*/ | ||
readonly logDriver: string; | ||
|
||
/** | ||
* Log-driver specific option set | ||
*/ | ||
readonly options?: { [key: string]: string }; | ||
} |
Oops, something went wrong.