-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: aws resource api linting (breaking changes) (#1434)
Fixes #742 Built on top of #1428 BREAKING CHANGE: AWS resource-related classes have been changed to conform to API guidelines: - `XxxRef` abstract classes are now `IXxx` interfaces - `XxxRefProps` are now `XxxImportProps` - `XxxRef.import(...)` are now `Xxx.import(...)` accept `XxxImportProps` and return `IXxx` - `export(): XxxImportProps` is now defined in `IXxx` and implemented by imported resources - Lambda's static "metric" methods moved from `lambda.FunctionRef` to `lambda.Function`. - Route53 record classes now require a `zone` when created (not assuming zone is the parent construct).
- Loading branch information
Elad Ben-Israel
authored
Dec 28, 2018
1 parent
0d2b633
commit 8c17ca7
Showing
142 changed files
with
2,540 additions
and
1,360 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +0,0 @@ | ||
import cdk = require('@aws-cdk/cdk'); | ||
|
||
export interface RestApiRefProps { | ||
/** | ||
* The REST API ID of an existing REST API resource. | ||
*/ | ||
restApiId: string; | ||
} | ||
|
||
export abstract class RestApiRef extends cdk.Construct { | ||
|
||
/** | ||
* Imports an existing REST API resource. | ||
* @param parent Parent construct | ||
* @param id Construct ID | ||
* @param props Imported rest API properties | ||
*/ | ||
public static import(parent: cdk.Construct, id: string, props: RestApiRefProps): RestApiRef { | ||
return new ImportedRestApi(parent, id, props); | ||
} | ||
|
||
/** | ||
* The ID of this API Gateway RestApi. | ||
*/ | ||
public readonly abstract restApiId: string; | ||
|
||
/** | ||
* Exports a REST API resource from this stack. | ||
* @returns REST API props that can be imported to another stack. | ||
*/ | ||
public export(): RestApiRefProps { | ||
return { | ||
restApiId: new cdk.Output(this, 'RestApiId', { value: this.restApiId }).makeImportValue().toString() | ||
}; | ||
} | ||
} | ||
|
||
class ImportedRestApi extends RestApiRef { | ||
public restApiId: string; | ||
|
||
constructor(parent: cdk.Construct, id: string, props: RestApiRefProps) { | ||
super(parent, id); | ||
|
||
this.restApiId = props.restApiId; | ||
} | ||
} | ||
Oops, something went wrong.