Skip to content

Commit

Permalink
Merge branch 'main' into iankhou-dotnet-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jan 14, 2025
2 parents 2b4dc7a + ef135ef commit 25e7b43
Show file tree
Hide file tree
Showing 51 changed files with 1,000 additions and 823 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2-alpha/lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export class VPNGatewayV2 extends Resource implements IRouteTarget {
private readonly _attachment: CfnVPCGatewayAttachment;

/**
* The VPN Gateway Route Propogation
* The VPN Gateway Route Propagation
*/
private readonly _routePropagation: CfnVPNGatewayRoutePropagation;

Expand Down Expand Up @@ -696,7 +696,7 @@ export class Route extends Resource implements IRouteV2 {
public readonly routeTable: IRouteTable;

/**
* The type of router the route is targetting
* The type of router the route is targeting
*/
public readonly targetRouterType: RouterType;

Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2-alpha/test/vpc-add-method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ describe('Vpc V2 with full control', () => {
});
});

test('Check vpngateway has routePropogation for input subnets', () => {
test('Check vpngateway has route Propagation for input subnets', () => {
myVpc.enableVpnGatewayV2({
type: VpnConnectionType.IPSEC_1,
vpnRoutePropagation: [{ subnetType: SubnetType.PUBLIC }],
Expand All @@ -382,7 +382,7 @@ describe('Vpc V2 with full control', () => {
});
});

test('Throws error when no subnet identified for route propogation', () => {
test('Throws error when no subnet identified for route propagation', () => {
expect(() => {
myVpc.enableVpnGatewayV2({
type: VpnConnectionType.IPSEC_1,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/job-executable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export interface JobExecutableConfig {
readonly script: Code;

/**
* The Scala class that serves as the entry point for the job. This applies only if your the job langauage is Scala.
* The Scala class that serves as the entry point for the job. This applies only if your the job language is Scala.
* Equivalent to a job parameter `--class`.
*
* @default - no scala className specified
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export interface SparkUILoggingLocation {
*/
export interface ContinuousLoggingProps {
/**
* Enable continouous logging.
* Enable continuous logging.
*/
readonly enabled: boolean;

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Column {
readonly type: Type;

/**
* Coment describing the column.
* Comment describing the column.
*
* @default none
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export enum FirehoseRecordSeparator {
WINDOWS_NEWLINE = '\r\n',

/**
* Separate by a commma
* Separate by a comma
*/
COMMA = ',',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface KinesisPutRecordActionProps extends CommonActionProps {
*
* @see https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html
*
* You can use the expression '${newuuid()}' if your payload does not have a high cardinarity property.
* You can use the expression '${newuuid()}' if your payload does not have a high cardinality property.
* If you use empty string, this action use no partition key and all records will put same one shard.
*
* @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html#API_PutRecord_RequestParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class StepFunctionsStateMachineAction implements iot.IAction {
private readonly role?: iam.IRole;

/**
* @param stateMachine The Step Functions Start Machine which shoud be executed.
* @param stateMachine The Step Functions Start Machine which should be executed.
* @param props Optional properties to not use default
*/
constructor(private readonly stateMachine: stepfunctions.IStateMachine, props?: StepFunctionsStateMachineActionProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ test('can set batchMode', () => {
});
});

test('can set separotor', () => {
test('can set separator', () => {
// GIVEN
const stack = new cdk.Stack();
const topicRule = new iot.TopicRule(stack, 'MyTopicRule', {
Expand Down
11 changes: 0 additions & 11 deletions packages/@aws-cdk/aws-msk-alpha/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,17 +485,6 @@ export class Cluster extends ClusterBase {
);
}

if (
!core.Token.isUnresolved(props.clusterName) &&
!/^[a-zA-Z0-9]+$/.test(props.clusterName) &&
props.clusterName.length > 64
) {
throw Error(
'The cluster name must only contain alphanumeric characters and have a maximum length of 64 characters.' +
`got: '${props.clusterName}. length: ${props.clusterName.length}'`,
);
}

if (
props.clientAuthentication?.saslProps?.iam &&
props.clientAuthentication?.saslProps?.scram
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface KafkaEventSourceProps extends BaseStreamEventSourceProps {
*/
readonly secret?: secretsmanager.ISecret;
/**
* The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a lenght between 1 and 200 and full the pattern '[a-zA-Z0-9-\/*:_+=.@-]*'.
* The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a length between 1 and 200 and full the pattern '[a-zA-Z0-9-\/*:_+=.@-]*'.
* @see https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id
*
* @default - none
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-lambda-nodejs/test/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ describe('exec', () => {
test('non zero status', () => {
const spawnSyncMock = jest.spyOn(child_process, 'spawnSync').mockReturnValue({
status: 999,
stderr: Buffer.from('error occured'),
stderr: Buffer.from('error occurred'),
stdout: Buffer.from('stdout'),
pid: 123,
output: ['stdout', 'stderr'],
signal: null,
});

expect(() => exec('cmd', ['arg1', 'arg2'])).toThrow('error occured');
expect(() => exec('cmd', ['arg1', 'arg2'])).toThrow('error occurred');

spawnSyncMock.mockRestore();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-rds/lib/database-secret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class DatabaseSecret extends secretsmanager.Secret {
const hash = md5hash(JSON.stringify({
// Use here the options that influence the password generation.
// If at some point we add other password customization options
// they sould be added here below (e.g. `passwordLength`).
// they should be added here below (e.g. `passwordLength`).
excludeCharacters,
}));
const logicalId = `${Names.uniqueId(this)}${hash}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-route53/test/route53.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe('route53', () => {
});
});

test('public hosted zone wiht caaAmazon set to true', () => {
test('public hosted zone with caaAmazon set to true', () => {
// GIVEN
const stack = new cdk.Stack();

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/scripts/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function main() {
const generated = (await generateAll(awsCdkLibDir, {
coreImport: '../../core',
cloudwatchImport: '../../aws-cloudwatch',
skippedServices: ['AWS::IoT1Click'],
skippedServices: [],
scopeMapPath,
}));

Expand Down
7 changes: 3 additions & 4 deletions packages/aws-cdk/lib/api/aws-auth/credential-plugins.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { inspect } from 'util';
import { inspect, format } from 'util';
import type { CredentialProviderSource, ForReading, ForWriting, PluginProviderResult, SDKv2CompatibleCredentials, SDKv3CompatibleCredentialProvider, SDKv3CompatibleCredentials } from '@aws-cdk/cli-plugin-contract';
import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@smithy/types';
import { credentialsAboutToExpire, makeCachingProvider } from './provider-caching';
import { debug, warning } from '../../logging';
import { debug, warning, info } from '../../logging';
import { AuthenticationError } from '../../toolkit/error';
import { formatErrorMessage } from '../../util/error';
import { Mode } from '../plugin/mode';
Expand Down Expand Up @@ -151,8 +151,7 @@ function v3ProviderFromV2Credentials(x: SDKv2CompatibleCredentials): AwsCredenti

function refreshFromPluginProvider(current: AwsCredentialIdentity, producer: () => Promise<PluginProviderResult>): AwsCredentialIdentityProvider {
return async () => {
// eslint-disable-next-line no-console
console.error(current, Date.now());
info(format(current), Date.now());
if (credentialsAboutToExpire(current)) {
const newCreds = await producer();
if (!isV3Credentials(newCreds)) {
Expand Down
8 changes: 4 additions & 4 deletions packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as cxapi from '@aws-cdk/cx-api';
import * as chalk from 'chalk';
import { minimatch } from 'minimatch';
import * as semver from 'semver';
import { error, print, warning } from '../../logging';
import { error, info, warning } from '../../logging';
import { ToolkitError } from '../../toolkit/error';
import { flatten } from '../../util';

Expand Down Expand Up @@ -264,7 +264,7 @@ export class StackCollection {
printMessage(error, 'Error', message.id, message.entry);
break;
case cxapi.SynthesisMessageLevel.INFO:
printMessage(print, 'Info', message.id, message.entry);
printMessage(info, 'Info', message.id, message.entry);
break;
}
}
Expand Down Expand Up @@ -346,7 +346,7 @@ function includeDownstreamStacks(
} while (madeProgress);

if (added.length > 0) {
print('Including depending stacks: %s', chalk.bold(added.join(', ')));
info('Including depending stacks: %s', chalk.bold(added.join(', ')));
}
}

Expand Down Expand Up @@ -376,7 +376,7 @@ function includeUpstreamStacks(
}

if (added.length > 0) {
print('Including dependency stacks: %s', chalk.bold(added.join(', ')));
info('Including dependency stacks: %s', chalk.bold(added.join(', ')));
}
}

Expand Down
16 changes: 8 additions & 8 deletions packages/aws-cdk/lib/api/deploy-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { CfnEvaluationException } from './evaluate-cloudformation-template';
import { HotswapMode, HotswapPropertyOverrides, ICON } from './hotswap/common';
import { tryHotswapDeployment } from './hotswap-deployments';
import { addMetadataAssetsToManifest } from '../assets';
import { debug, print, warning } from '../logging';
import { debug, info, warning } from '../logging';
import {
changeSetHasNoChanges,
CloudFormationStack,
Expand Down Expand Up @@ -333,7 +333,7 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
// if we can skip deployment and we are performing a hotswap, let the user know
// that no hotswap deployment happened
if (hotswapMode !== HotswapMode.FULL_DEPLOYMENT) {
print(
info(
`\n ${ICON} %s\n`,
chalk.bold('hotswap deployment skipped - no changes were detected (use --force to override)'),
);
Expand Down Expand Up @@ -379,22 +379,22 @@ export async function deployStack(options: DeployStackOptions): Promise<DeploySt
if (hotswapDeploymentResult) {
return hotswapDeploymentResult;
}
print(
info(
'Could not perform a hotswap deployment, as the stack %s contains non-Asset changes',
stackArtifact.displayName,
);
} catch (e) {
if (!(e instanceof CfnEvaluationException)) {
throw e;
}
print(
info(
'Could not perform a hotswap deployment, because the CloudFormation template could not be resolved: %s',
formatErrorMessage(e),
);
}

if (hotswapMode === HotswapMode.FALL_BACK) {
print('Falling back to doing a full deployment');
info('Falling back to doing a full deployment');
options.sdk.appendCustomUserAgent('cdk-hotswap/fallback');
} else {
return {
Expand Down Expand Up @@ -505,7 +505,7 @@ class FullCloudFormationDeployment {
}

if (!execute) {
print(
info(
'Changeset %s created and waiting in review for manual execution (--no-execute)',
changeSetDescription.ChangeSetId,
);
Expand Down Expand Up @@ -538,7 +538,7 @@ class FullCloudFormationDeployment {
await this.cleanupOldChangeset(changeSetName);

debug(`Attempting to create ChangeSet with name ${changeSetName} to ${this.verb} stack ${this.stackName}`);
print('%s: creating CloudFormation changeset...', chalk.bold(this.stackName));
info('%s: creating CloudFormation changeset...', chalk.bold(this.stackName));
const changeSet = await this.cfn.createChangeSet({
StackName: this.stackName,
ChangeSetName: changeSetName,
Expand Down Expand Up @@ -609,7 +609,7 @@ class FullCloudFormationDeployment {
}

private async directDeployment(): Promise<SuccessfulDeployStackResult> {
print('%s: %s stack...', chalk.bold(this.stackName), this.update ? 'updating' : 'creating');
info('%s: %s stack...', chalk.bold(this.stackName), this.update ? 'updating' : 'creating');

const startTime = new Date();

Expand Down
1 change: 0 additions & 1 deletion packages/aws-cdk/lib/api/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ export class Deployments {

// No need to validate anymore, we already did that during build
const publisher = this.cachedPublisher(assetManifest, stackEnv, options.stackName);
// eslint-disable-next-line no-console
await publisher.publishEntry(asset, { allowCrossAccount: await this.allowCrossAccountAssetPublishingForEnv(options.stack) });
if (publisher.hasFailures) {
throw new Error(`Failed to publish asset ${asset.id}`);
Expand Down
18 changes: 9 additions & 9 deletions packages/aws-cdk/lib/api/garbage-collection/garbage-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ImageIdentifier } from '@aws-sdk/client-ecr';
import { Tag } from '@aws-sdk/client-s3';
import * as chalk from 'chalk';
import * as promptly from 'promptly';
import { debug, print } from '../../logging';
import { debug, info } from '../../logging';
import { IECRClient, IS3Client, SDK, SdkProvider } from '../aws-auth';
import { DEFAULT_TOOLKIT_STACK_NAME, ToolkitInfo } from '../toolkit-info';
import { ProgressPrinter } from './progress-printer';
Expand Down Expand Up @@ -526,7 +526,7 @@ export class GarbageCollector {
printer.reportDeletedAsset(deletables.slice(0, deletedCount));
}
} catch (err) {
print(chalk.red(`Error deleting images: ${err}`));
info(chalk.red(`Error deleting images: ${err}`));
}
}

Expand Down Expand Up @@ -559,23 +559,23 @@ export class GarbageCollector {
printer.reportDeletedAsset(deletables.slice(0, deletedCount));
}
} catch (err) {
print(chalk.red(`Error deleting objects: ${err}`));
info(chalk.red(`Error deleting objects: ${err}`));
}
}

private async bootstrapBucketName(sdk: SDK, bootstrapStackName: string): Promise<string> {
const info = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return info.bucketName;
const toolkitInfo = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return toolkitInfo.bucketName;
}

private async bootstrapRepositoryName(sdk: SDK, bootstrapStackName: string): Promise<string> {
const info = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return info.repositoryName;
const toolkitInfo = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return toolkitInfo.repositoryName;
}

private async bootstrapQualifier(sdk: SDK, bootstrapStackName: string): Promise<string | undefined> {
const info = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return info.bootstrapStack.parameters.Qualifier;
const toolkitInfo = await ToolkitInfo.lookup(this.props.resolvedEnvironment, sdk, bootstrapStackName);
return toolkitInfo.bootstrapStack.parameters.Qualifier;
}

private async numObjectsInBucket(s3: IS3Client, bucket: string): Promise<number> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as chalk from 'chalk';
import { GcAsset as GCAsset } from './garbage-collector';
import { print } from '../../logging';
import { info } from '../../logging';

export class ProgressPrinter {
private totalAssets: number;
Expand Down Expand Up @@ -68,9 +68,9 @@ export class ProgressPrinter {
const percentage = ((this.assetsScanned / this.totalAssets) * 100).toFixed(2);
// print in MiB until we hit at least 1 GiB of data tagged/deleted
if (Math.max(this.taggedAssetsSizeMb, this.deletedAssetsSizeMb) >= 1000) {
print(chalk.green(`[${percentage}%] ${this.assetsScanned} files scanned: ${this.taggedAsset} assets (${(this.taggedAssetsSizeMb / 1000).toFixed(2)} GiB) tagged, ${this.deletedAssets} assets (${(this.deletedAssetsSizeMb / 1000).toFixed(2)} GiB) deleted.`));
info(chalk.green(`[${percentage}%] ${this.assetsScanned} files scanned: ${this.taggedAsset} assets (${(this.taggedAssetsSizeMb / 1000).toFixed(2)} GiB) tagged, ${this.deletedAssets} assets (${(this.deletedAssetsSizeMb / 1000).toFixed(2)} GiB) deleted.`));
} else {
print(chalk.green(`[${percentage}%] ${this.assetsScanned} files scanned: ${this.taggedAsset} assets (${this.taggedAssetsSizeMb.toFixed(2)} MiB) tagged, ${this.deletedAssets} assets (${this.deletedAssetsSizeMb.toFixed(2)} MiB) deleted.`));
info(chalk.green(`[${percentage}%] ${this.assetsScanned} files scanned: ${this.taggedAsset} assets (${this.taggedAssetsSizeMb.toFixed(2)} MiB) tagged, ${this.deletedAssets} assets (${this.deletedAssetsSizeMb.toFixed(2)} MiB) deleted.`));
}
}
}
Loading

0 comments on commit 25e7b43

Please sign in to comment.