Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cdk-lib): fix typos #33008

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-python-alpha/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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.');
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ec2/lib/security-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,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;
Expand Down Expand Up @@ -139,52 +139,52 @@ 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
*/
public attachToApplicationTargetGroup(_targetGroup: elbv2.IApplicationTargetGroup): elbv2.LoadBalancerTargetProps {
throw new Error ('Application load balancer cannot be attached to an external service');
throw new Error('Application load balancer cannot be attached to an external service');
}

/**
* 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
*/
public loadBalancerTarget(_options: LoadBalancerTargetOptions): IEcsLoadBalancerTarget {
throw new Error ('External service cannot be attached as load balancer targets');
throw new Error('External service cannot be attached as load balancer targets');
}

/**
* 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
*/
public registerLoadBalancerTargets(..._targets: EcsTarget[]) {
throw new Error ('External service cannot be registered as load balancer targets');
throw new Error('External service cannot be registered as load balancer targets');
}

/**
* 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
*/
public autoScaleTaskCount(_props: appscaling.EnableScalingProps): ScalableTaskCount {
throw new Error ('Autoscaling not supported for external service');
throw new Error('Autoscaling not supported for external service');
}

/**
* 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
*/
public enableCloudMap(_options: CloudMapOptions): cloudmap.Service {
throw new Error ('Cloud map integration not supported for an external service');
throw new Error('Cloud map integration not supported for an external service');
}

/**
* 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
*/
public associateCloudMapService(_options: AssociateCloudMapServiceOptions): void {
throw new Error ('Cloud map service association is not supported for an external service');
throw new Error('Cloud map service association is not supported for an external service');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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
*/
public addInferenceAccelerator(_inferenceAccelerator: InferenceAccelerator) {
throw new Error('Cannot use inference accelerators on tasks that run on External service');
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')`;


Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,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
*/
Expand Down Expand Up @@ -965,7 +965,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see other 5 occurrences of this typo in the project. Can you please adjust those as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I fix it.

* 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
*/
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-s3/test/notification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SFN, StartExecutionInput, StartExecutionOutput } from '@aws-sdk/client-
const FRAMEWORK_HANDLER_TIMEOUT = 900000; // 15 minutes

// In order to honor the overall maximum timeout set for the target process,
// the default 2 minutes from AWS SDK has to be overriden:
// the default 2 minutes from AWS SDK has to be overridden:
// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#httpOptions-property
const awsSdkConfig = {
httpOptions: { timeout: FRAMEWORK_HANDLER_TIMEOUT },
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/cx-api/lib/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,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
Expand Down
Loading