Skip to content

Commit

Permalink
docs(cdk-lib): fix typos (#33008)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

Closes #<issue number here>.

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*
  • Loading branch information
andyu17 authored Feb 14, 2025
1 parent 531280f commit e5e4f9b
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
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 @@ -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.');
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
22 changes: 11 additions & 11 deletions packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -167,55 +167,55 @@ 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 {
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
*/
@MethodMetadata()
public loadBalancerTarget(_options: LoadBalancerTargetOptions): IEcsLoadBalancerTarget {
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
*/
@MethodMetadata()
public registerLoadBalancerTargets(..._targets: EcsTarget[]) {
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
*/
@MethodMetadata()
public autoScaleTaskCount(_props: appscaling.EnableScalingProps): ScalableTaskCount {
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
*/
@MethodMetadata()
public enableCloudMap(_options: CloudMapOptions): cloudmap.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
*/
@MethodMetadata()
public associateCloudMapService(_options: AssociateCloudMapServiceOptions): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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 @@ -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
*/
Expand Down Expand Up @@ -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
*/
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
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 @@ -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
Expand Down

0 comments on commit e5e4f9b

Please sign in to comment.