Skip to content

Commit

Permalink
fix awslint exclusions (#6523)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
iliapolo and mergify[bot] authored Mar 1, 2020
1 parent d5000bc commit ed6f0b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export interface AwsSdkCall {
/**
* The parameters for the service action
*
* @default - no paramters
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/index.html
*/
readonly parameters?: any;
Expand Down Expand Up @@ -114,6 +115,11 @@ export interface AwsSdkCall {
readonly outputPath?: string;
}

/**
* Properties for AwsCustomResource.
*
* Note that at least onCreate, onUpdate or onDelete must be specified.
*/
export interface AwsCustomResourceProps {
/**
* Cloudformation Resource type.
Expand All @@ -124,7 +130,6 @@ export interface AwsCustomResourceProps {

/**
* The AWS SDK call to make when the resource is created.
* At least onCreate, onUpdate or onDelete must be specified.
*
* @default - the call when the resource is updated
*/
Expand Down Expand Up @@ -177,11 +182,20 @@ export interface AwsCustomResourceProps {
readonly timeout?: cdk.Duration
}

/**
* Defines a custom resource that is materialized using specific AWS API calls.
*
* Use this to bridge any gap that might exist in the CloudFormation Coverage.
* You can specify exactly which calls are invoked for the 'CREATE', 'UPDATE' and 'DELETE' life cycle events.
*
*/
export class AwsCustomResource extends cdk.Construct implements iam.IGrantable {
public readonly grantPrincipal: iam.IPrincipal;

private readonly customResource: CustomResource;

// 'props' cannot be optional, even though all its properties are optional.
// this is because at least one sdk call must be provided.
constructor(scope: cdk.Construct, id: string, props: AwsCustomResourceProps) {
super(scope, id);

Expand Down
8 changes: 2 additions & 6 deletions packages/@aws-cdk/custom-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,7 @@
"stability": "experimental",
"awslint": {
"exclude": [
"construct-ctor-props-optional:@aws-cdk/custom-resources.AwsCustomResource",
"props-physical-name:@aws-cdk/custom-resources.AsyncCustomResourceProps",
"docs-public-apis:@aws-cdk/custom-resources.AwsCustomResource",
"docs-public-apis:@aws-cdk/custom-resources.AwsCustomResourceProps",
"props-default-doc:@aws-cdk/custom-resources.AwsSdkCall.parameters"
"construct-ctor-props-optional:@aws-cdk/custom-resources.AwsCustomResource"
]
}
}
}

0 comments on commit ed6f0b3

Please sign in to comment.