From e5e4f9b3adba1012a8b9e99d8a6aa7b349d7214a Mon Sep 17 00:00:00 2001 From: Yu Urata <77177966+andyu17@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:51:26 +0900 Subject: [PATCH] docs(cdk-lib): fix typos (#33008) ### Issue # (if applicable) Closes #. None Fixed typos in code comments. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../aws-lambda-python-alpha/lib/function.ts | 2 +- .../aws-cdk-lib/aws-ec2/lib/security-group.ts | 2 +- .../aws-ecs/lib/external/external-service.ts | 22 +++++++++---------- .../lib/external/external-task-definition.ts | 2 +- packages/aws-cdk-lib/aws-s3/README.md | 2 +- packages/aws-cdk-lib/aws-s3/lib/bucket.ts | 4 ++-- .../aws-s3/test/notification.test.ts | 6 ++--- packages/aws-cdk-lib/cx-api/lib/features.ts | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts b/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts index 2dc2fd8f06769..00ec9146d1b01 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts @@ -62,7 +62,7 @@ export class PythonFunction extends Function { throw new Error(`Cannot find index file at ${resolvedIndex}`); } - const resolvedHandler =`${index.slice(0, -3)}.${handler}`.replace(/\//g, '.'); + const resolvedHandler = `${index.slice(0, -3)}.${handler}`.replace(/\//g, '.'); if (props.runtime && props.runtime.family !== RuntimeFamily.PYTHON) { throw new Error('Only `PYTHON` runtimes are supported.'); diff --git a/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts b/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts index 33892ffa47394..7db906e861238 100644 --- a/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts +++ b/packages/aws-cdk-lib/aws-ec2/lib/security-group.ts @@ -280,7 +280,7 @@ export interface SecurityGroupProps { * Inlining rules is an optimization for producing smaller stack templates. Sometimes * this is not desirable, for example when security group access is managed via tags. * - * The default value can be overriden globally by setting the context variable + * The default value can be overridden globally by setting the context variable * '@aws-cdk/aws-ec2.securityGroupDisableInlineRules'. * * @default false diff --git a/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts b/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts index d4d454ee2ac03..eb4aebfae7e10 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts @@ -123,15 +123,15 @@ export class ExternalService extends BaseService implements IExternalService { } if (props.cluster.defaultCloudMapNamespace !== undefined) { - throw new Error (`Cloud map integration is not supported for External service ${props.cluster.defaultCloudMapNamespace}`); + throw new Error(`Cloud map integration is not supported for External service ${props.cluster.defaultCloudMapNamespace}`); } if (props.cloudMapOptions !== undefined) { - throw new Error ('Cloud map options are not supported for External service'); + throw new Error('Cloud map options are not supported for External service'); } if (props.capacityProviderStrategies !== undefined) { - throw new Error ('Capacity Providers are not supported for External service'); + throw new Error('Capacity Providers are not supported for External service'); } const propagateTagsFromSource = props.propagateTags ?? PropagatedTagSource.NONE; @@ -167,7 +167,7 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `attachToApplicationTargetGroup` is not supported for external service + * Overridden method to throw error as `attachToApplicationTargetGroup` is not supported for external service */ @MethodMetadata() public attachToApplicationTargetGroup(_targetGroup: elbv2.IApplicationTargetGroup): elbv2.LoadBalancerTargetProps { @@ -175,7 +175,7 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `loadBalancerTarget` is not supported for external service + * Overridden method to throw error as `loadBalancerTarget` is not supported for external service */ @MethodMetadata() public loadBalancerTarget(_options: LoadBalancerTargetOptions): IEcsLoadBalancerTarget { @@ -183,7 +183,7 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `registerLoadBalancerTargets` is not supported for external service + * Overridden method to throw error as `registerLoadBalancerTargets` is not supported for external service */ @MethodMetadata() public registerLoadBalancerTargets(..._targets: EcsTarget[]) { @@ -191,15 +191,15 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `configureAwsVpcNetworkingWithSecurityGroups` is not supported for external service + * Overridden method to throw error as `configureAwsVpcNetworkingWithSecurityGroups` is not supported for external service */ // eslint-disable-next-line max-len, no-unused-vars protected configureAwsVpcNetworkingWithSecurityGroups(_vpc: ec2.IVpc, _assignPublicIp?: boolean, _vpcSubnets?: ec2.SubnetSelection, _securityGroups?: ec2.ISecurityGroup[]) { - throw new Error ('Only Bridge network mode is supported for external service'); + throw new Error('Only Bridge network mode is supported for external service'); } /** - * Overriden method to throw error as `autoScaleTaskCount` is not supported for external service + * Overridden method to throw error as `autoScaleTaskCount` is not supported for external service */ @MethodMetadata() public autoScaleTaskCount(_props: appscaling.EnableScalingProps): ScalableTaskCount { @@ -207,7 +207,7 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `enableCloudMap` is not supported for external service + * Overridden method to throw error as `enableCloudMap` is not supported for external service */ @MethodMetadata() public enableCloudMap(_options: CloudMapOptions): cloudmap.Service { @@ -215,7 +215,7 @@ export class ExternalService extends BaseService implements IExternalService { } /** - * Overriden method to throw error as `associateCloudMapService` is not supported for external service + * Overridden method to throw error as `associateCloudMapService` is not supported for external service */ @MethodMetadata() public associateCloudMapService(_options: AssociateCloudMapServiceOptions): void { diff --git a/packages/aws-cdk-lib/aws-ecs/lib/external/external-task-definition.ts b/packages/aws-cdk-lib/aws-ecs/lib/external/external-task-definition.ts index 90e2cccce8357..a6de25401222a 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/external/external-task-definition.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/external/external-task-definition.ts @@ -85,7 +85,7 @@ export class ExternalTaskDefinition extends TaskDefinition implements IExternalT } /** - * Overriden method to throw error as interface accelerators are not supported for external tasks + * Overridden method to throw error as interface accelerators are not supported for external tasks */ @MethodMetadata() public addInferenceAccelerator(_inferenceAccelerator: InferenceAccelerator) { diff --git a/packages/aws-cdk-lib/aws-s3/README.md b/packages/aws-cdk-lib/aws-s3/README.md index 355f257e08f6c..e4ad8acc616a8 100644 --- a/packages/aws-cdk-lib/aws-s3/README.md +++ b/packages/aws-cdk-lib/aws-s3/README.md @@ -1005,7 +1005,7 @@ In a cross-account scenario, where the source and destination buckets are owned For more information, please refer to https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html . > **NOTE:** AWS managed keys don't allow cross-account use, and therefore can't be used to perform cross-account replication. -If you need to ovveride the bucket ownership to destination account pass the account value to the method to provide permissions to override bucket owner. +If you need to override the bucket ownership to destination account pass the account value to the method to provide permissions to override bucket owner. `addReplicationPolicy(bucket.replicationRoleArn, true, '11111111111')`; diff --git a/packages/aws-cdk-lib/aws-s3/lib/bucket.ts b/packages/aws-cdk-lib/aws-s3/lib/bucket.ts index 9889e36d289f2..f14acd3548e6b 100644 --- a/packages/aws-cdk-lib/aws-s3/lib/bucket.ts +++ b/packages/aws-cdk-lib/aws-s3/lib/bucket.ts @@ -396,7 +396,7 @@ export interface IBucket extends IResource { * Function to add required permissions to the destination bucket for cross account * replication. These permissions will be added as a resource based policy on the bucket. * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html - * If owner of the bucket needs to be overriden, set accessControlTransition to true and provide + * If owner of the bucket needs to be overridden, set accessControlTransition to true and provide * account ID in which destination bucket is hosted. For more information on accessControlTransition * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html */ @@ -966,7 +966,7 @@ export abstract class BucketBase extends Resource implements IBucket { * Function to add required permissions to the destination bucket for cross account * replication. These permissions will be added as a resource based policy on the bucket * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-walkthrough-2.html - * If owner of the bucket needs to be overriden, set accessControlTransition to true and provide + * If owner of the bucket needs to be overridden, set accessControlTransition to true and provide * account ID in which destination bucket is hosted. For more information on accessControlTransition * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-accesscontroltranslation.html */ diff --git a/packages/aws-cdk-lib/aws-s3/test/notification.test.ts b/packages/aws-cdk-lib/aws-s3/test/notification.test.ts index 3f74308cf61e0..dc1c7cdafe1b8 100644 --- a/packages/aws-cdk-lib/aws-s3/test/notification.test.ts +++ b/packages/aws-cdk-lib/aws-s3/test/notification.test.ts @@ -117,7 +117,7 @@ describe('notification', () => { }), }); - // THEN - Following is warning throwen as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 + // THEN - Following is warning thrown as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 const warningFromStack = Annotations.fromStack(stack).findWarning('*', {}); expect(warningFromStack[0]?.entry?.data).toEqual(undefined); }); @@ -161,7 +161,7 @@ describe('notification', () => { }), }); - // THEN - Following is warning throwen as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 + // THEN - Following is warning thrown as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 const warningMessage = { 'Fn::Join': ['', ["Can't combine imported IManagedPolicy: arn:", { Ref: 'AWS::Partition' }, ':iam::aws:policy/service-role/AWSLambdaBasicExecutionRole to imported role IRole: DevsNotAllowedToTouch. Use ManagedPolicy directly. [ack: @aws-cdk/aws-iam:IRoleCantBeUsedWithIManagedPolicy]']] }; const warningFromStack = Annotations.fromStack(stack).findWarning('*', {}); expect(warningFromStack[0].entry.data).toEqual(warningMessage); @@ -238,7 +238,7 @@ describe('notification', () => { }), }); - // THEN - Following is warning throwen as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 + // THEN - Following is warning thrown as a part of fix in : https://github.com/aws/aws-cdk/pull/31212 const warningFromStack = Annotations.fromStack(stack).findWarning('*', {}); expect(warningFromStack[0]?.entry?.data).toEqual(undefined); }); diff --git a/packages/aws-cdk-lib/cx-api/lib/features.ts b/packages/aws-cdk-lib/cx-api/lib/features.ts index 5aa79973fb712..6d761b056694e 100644 --- a/packages/aws-cdk-lib/cx-api/lib/features.ts +++ b/packages/aws-cdk-lib/cx-api/lib/features.ts @@ -1419,7 +1419,7 @@ export const CURRENTLY_RECOMMENDED_FLAGS = Object.fromEntries( /** * The default values of each of these flags in the current major version. * - * This is the effective value of the flag, unless it's overriden via + * This is the effective value of the flag, unless it's overridden via * context. * * Adding new flags here is only allowed during the pre-release period of a new