Skip to content

Commit

Permalink
Introduce ICluster/Cluster in aws-msk
Browse files Browse the repository at this point in the history
  • Loading branch information
bracki committed Feb 16, 2021
1 parent 47812f9 commit 18e4073
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/@aws-cdk/aws-msk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
>
> [CFN Resources]: https://docs.aws.amazon.com/cdk/latest/guide/constructs.html#constructs_lib
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)

> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.
---

<!--END STABILITY BANNER-->
Expand Down
34 changes: 34 additions & 0 deletions packages/@aws-cdk/aws-msk/lib/cluster.ts
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();
}
}
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-msk/lib/index.ts
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';
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-msk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"node": ">= 10.13.0 <13 || >=13.7.0"
},
"stability": "experimental",
"maturity": "cfn-only",
"maturity": "experimental",
"awscdkio": {
"announce": false
}
Expand Down

0 comments on commit 18e4073

Please sign in to comment.