From ed6f0b35c1788e84b243a502683226b012f7fbba Mon Sep 17 00:00:00 2001 From: Eli Polonsky Date: Sun, 1 Mar 2020 19:38:16 +0200 Subject: [PATCH] fix awslint exclusions (#6523) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../aws-custom-resource/aws-custom-resource.ts | 16 +++++++++++++++- packages/@aws-cdk/custom-resources/package.json | 8 ++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts index 46fc02f013ec8..4ebcf8e9e1bbf 100644 --- a/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts +++ b/packages/@aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts @@ -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; @@ -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. @@ -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 */ @@ -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); diff --git a/packages/@aws-cdk/custom-resources/package.json b/packages/@aws-cdk/custom-resources/package.json index d116f20df6062..2c2f3aef67a67 100644 --- a/packages/@aws-cdk/custom-resources/package.json +++ b/packages/@aws-cdk/custom-resources/package.json @@ -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" ] - } + } } \ No newline at end of file