-
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.
Introduce ICluster/Cluster in aws-msk
- Loading branch information
Showing
4 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { IResource, Resource } from '@aws-cdk/core'; | ||
import { Construct } from 'constructs'; | ||
|
||
/** | ||
* Represents an MSK cluster | ||
*/ | ||
export interface ICluster extends IResource { | ||
/** | ||
* the ARN of the MSK cluster | ||
*/ | ||
readonly clusterArn: string; | ||
} | ||
|
||
/** | ||
* An MSK cluster | ||
*/ | ||
export class Cluster { | ||
/** | ||
* Creates a Cluster construct that represents an existing MSK cluster. | ||
* @param scope | ||
* @param id | ||
* @param clusterArn | ||
*/ | ||
public static fromClusterArn(scope: Construct, id: string, clusterArn: string): ICluster { | ||
class Imported extends Resource implements ICluster { | ||
public readonly clusterArn: string; | ||
constructor() { | ||
super(scope, id); | ||
this.clusterArn = clusterArn; | ||
} | ||
} | ||
return new Imported(); | ||
} | ||
} |
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,2 +1,3 @@ | ||
export * from './cluster'; | ||
// AWS::MSK CloudFormation Resources: | ||
export * from './msk.generated'; |
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