From 63c6c1bc402b6230cfc70173f9e684b4ca130b89 Mon Sep 17 00:00:00 2001 From: epolon Date: Sun, 1 Mar 2020 16:10:28 +0200 Subject: [PATCH] fix awslint exclusions --- .../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 f8c17c3db0aef..19b8ee277bb7f 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 @@ -37,6 +37,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; @@ -98,6 +99,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. @@ -108,7 +114,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 */ @@ -161,11 +166,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