Skip to content

Commit

Permalink
Merge branch 'main' into issue_8307
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinZZ authored Dec 5, 2024
2 parents f5066af + f4c19c7 commit 36deb38
Show file tree
Hide file tree
Showing 1,757 changed files with 316,420 additions and 1,646 deletions.
17 changes: 10 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ FROM jsii/superchain:1-bookworm-slim-node20

USER root

# Setup oh-my-zsh
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends zsh vim \
&& rm -rf /var/lib/apt/lists/* \
&& chsh -s $(which zsh) superchain

# Required, otherwise shell is extermly slow due the size of the aws-cdk
RUN sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig'

# Change uid/guid of superchain so it can work with the docker-in-docker feature
RUN groupmod --gid 1000 superchain \
&& usermod --uid 1000 --gid 1000 superchain \
Expand All @@ -10,10 +19,4 @@ RUN groupmod --gid 1000 superchain \
USER superchain

# Setup oh-my-zsh
RUN sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& sudo apt-get -y install --no-install-recommends zsh vim \
&& sudo rm -rf /var/lib/apt/lists/* \
&& sudo chsh -s $(which zsh) $(whoami)
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
# Required, otherwise shell is extermly slow due the size of the aws-cdk
&& sudo sh -c 'echo "[oh-my-zsh]\n hide-dirty = 1" > /etc/gitconfig'
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
"build": {
"dockerfile": "Dockerfile"
},

"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint"]
"extensions": [
"dbaeumer.vscode-eslint"
]
}
},

"postCreateCommand": "yarn install",
"remoteUser": "superchain",
"features": {
"docker-in-docker": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": true
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: cd packages/aws-cdk && yarn test

- name: Upload results to Codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v4
with:
directory: packages/aws-cdk/coverage
fail_ci_if_error: true
Expand Down
16 changes: 9 additions & 7 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.171.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.171.0-alpha.0...v2.171.1-alpha.0) (2024-11-27)

## [2.171.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.170.0-alpha.0...v2.171.0-alpha.0) (2024-11-25)

## [2.170.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.169.0-alpha.0...v2.170.0-alpha.0) (2024-11-22)
Expand Down Expand Up @@ -80,7 +82,7 @@ All notable changes to this project will be documented in this file. See [standa

### Bug Fixes

* **location:** remove base class from PlaceIndex class ([#31287](https://github.com/aws/aws-cdk/issues/31287)) ([bc67866](https://github.com/aws/aws-cdk/commit/bc67866f579c401556d427eb150bcd118d69bd17)), closes [#30711](https://github.com/aws/aws-cdk/issues/30711) [#30682](https://github.com/aws/aws-cdk/issues/30682)
* **location:** remove base class from PlaceIndex class ([#31287](https://github.com/aws/aws-cdk/issues/31287)) ([bc67866](https://github.com/aws/aws-cdk/commit/bc67866f579c401556d427eb150bcd118d69bd17)), closes [#30711](https://github.com/aws/aws-cdk/issues/30711) [#30682](https://github.com/aws/aws-cdk/issues/30682)
* **scheduler-alpha:** scheduler input always get transformed to string with extra double quotes ([#31894](https://github.com/aws/aws-cdk/issues/31894)) ([186b8ab](https://github.com/aws/aws-cdk/commit/186b8abfab8452b31cba13b56998242f63c43159))
* **scheduler-alpha:** too many KMS permissions granted ([#31923](https://github.com/aws/aws-cdk/issues/31923)) ([06678a3](https://github.com/aws/aws-cdk/commit/06678a39e029582af14c8b021f946b9ce9cac9be)), closes [#31785](https://github.com/aws/aws-cdk/issues/31785)

Expand Down Expand Up @@ -148,10 +150,10 @@ All notable changes to this project will be documented in this file. See [standa

### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **kinesisfirehose-destinations:** the `logging` and `logGroup` properties in `DestinationLoggingProps` have been removed and replaced with a single optional property `loggingConfig` which accepts a class of type `LoggingConfig`.
* **kinesisfirehose-destinations:** the `logging` and `logGroup` properties in `DestinationLoggingProps` have been removed and replaced with a single optional property `loggingConfig` which accepts a class of type `LoggingConfig`.

#### Details
Combine the `logging` and `logGroup` properties into a single new optional property called `loggingConfig` which accepts a class of type `LoggingConfig`.
Combine the `logging` and `logGroup` properties into a single new optional property called `loggingConfig` which accepts a class of type `LoggingConfig`.

`LoggingConfig` is an abstract class which can be instantiated through either an instance of `EnableLogging` or `DisableLogging` which can be used in the following 3 ways:

Expand Down Expand Up @@ -222,7 +224,7 @@ unit + integ test

### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **kinesisfirehose-alpha:** `encryptionKey` property is removed and `encryption` property type has changed from the `StreamEncryption` enum to the `StreamEncryption` class.
* **kinesisfirehose-alpha:** `encryptionKey` property is removed and `encryption` property type has changed from the `StreamEncryption` enum to the `StreamEncryption` class.

To pass in a KMS key for the customer managed key case, use `StreamEncryption.customerManagedKey(key)`

Expand All @@ -234,12 +236,12 @@ StreamEncryption.awsOwnedKey()
StreamEncryption.customerManagedKey(key?: IKey)
```

This makes it so it's not longer possible to pass in a key when the encryption type is AWS owned or unencrypted. The `key` is an optional parameter in `StreamEncryption.customerManagedKey(key?: IKey)` so following the previous behaviour, if a key is provided it will be used, otherwise a key will be created for the user.
This makes it so it's not longer possible to pass in a key when the encryption type is AWS owned or unencrypted. The `key` is an optional parameter in `StreamEncryption.customerManagedKey(key?: IKey)` so following the previous behaviour, if a key is provided it will be used, otherwise a key will be created for the user.
### Description of how you validated changes

Generated templates do not change so behaviour remains the same.
Generated templates do not change so behaviour remains the same.

Updated integ/unit tests.
Updated integ/unit tests.

### 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)
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.171.1](https://github.com/aws/aws-cdk/compare/v2.171.0...v2.171.1) (2024-11-27)


### Bug Fixes

* **cli:** lambda hotswap fails if `lambda:GetFunctionConfiguration` action is not allowed ([#32301](https://github.com/aws/aws-cdk/issues/32301)) ([a073e93](https://github.com/aws/aws-cdk/commit/a073e9302dbd4213275e99c86476ab8152af7caf)), closes [/github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdatedV2.ts#L10](https://github.com/aws//github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdatedV2.ts/issues/L10) [/github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdated.ts#L13](https://github.com/aws//github.com/aws/aws-sdk-js-v3/blob/main/clients/client-lambda/src/waiters/waitForFunctionUpdated.ts/issues/L13)

## [2.171.0](https://github.com/aws/aws-cdk/compare/v2.170.0...v2.171.0) (2024-11-25)


Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ Shout out to our top contributors!
- [TheRealAmazonKendra](https://github.com/TheRealAmazonKendra)
- [comcalvi](https://github.com/comcalvi)
- [madeline-k](https://github.com/madeline-k)
- [NetaNir](https://github.com/NetaNir)
- [mazyu36](https://github.com/mazyu36)
- [go-to-k](https://github.com/go-to-k)
- [NetaNir](https://github.com/NetaNir)
- [robertd](https://github.com/robertd)
- [mazyu36](https://github.com/mazyu36)
- [badmintoncryer](https://github.com/badmintoncryer)
- [MrArnoldPalmer](https://github.com/MrArnoldPalmer)
- [lpizzinidev](https://github.com/lpizzinidev)
- [peterwoodworth](https://github.com/peterwoodworth)
- [badmintoncryer](https://github.com/badmintoncryer)
- [colifran](https://github.com/colifran)
- [msambol](https://github.com/msambol)
- [colifran](https://github.com/colifran)
- [watany-dev](https://github.com/watany-dev)


_Last updated: Fri, 01 Nov 24 00:12:22 +0000_
_Last updated: Sun, 01 Dec 24 00:14:16 +0000_
1 change: 1 addition & 0 deletions aws-cdk.code-workspace
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"folders": [{ "path": "." }],
"settings": {
"files.insertFinalNewline": true,
"jest.jestCommandLine": "node_modules/.bin/jest",
"jest.autoRun": "off",
"jest.virtualFolders": [
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@
"@aws-cdk/aws-cognito/punycode/**",
"@aws-cdk/aws-ecr-assets/minimatch",
"@aws-cdk/aws-ecr-assets/minimatch/**",
"@aws-cdk/aws-eks/semver",
"@aws-cdk/aws-eks/semver/**",
"@aws-cdk/aws-eks/yaml",
"@aws-cdk/aws-eks/yaml/**",
"@aws-cdk/aws-eks-v2-alpha/semver",
"@aws-cdk/aws-eks-v2-alpha/semver/**",
"@aws-cdk/aws-eks-v2-alpha/yaml",
"@aws-cdk/aws-eks-v2-alpha/yaml/**",
"@aws-cdk/aws-events-targets/aws-sdk",
"@aws-cdk/aws-events-targets/aws-sdk/**",
"@aws-cdk/aws-iot-actions-alpha/case",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/bin/test-root.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as path from 'path';
// eslint-disable-next-line no-console
console.log(path.resolve(__dirname, '..'));
console.log(path.resolve(__dirname, '..'));
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/eventually.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ const eventually = async <T>(call: () => Promise<T>, options?: EventuallyOptions
throw new Error('An unexpected error has occurred.');
};

export default eventually;
export default eventually;
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ export async function fetchPreviousVersion(token: string, options?: {
if (previousMVRelease) { return previousMVRelease; }

throw new Error(`Unable to find previous version given ${JSON.stringify(options)}`);
};
};
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export * from './with-aws';
export * from './with-cdk-app';
export * from './with-packages';
export * from './with-temporary-directory';
export * from './resources';
export * from './resources';
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/lists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export function chunk<A>(n: number, xs: A[]): A[][] {
}

return ret;
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/memoize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export function memoize0<A>(fn: () => Promise<A>): () => Promise<A> {
}
return promise;
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ export class ReleasePackageSource implements IPackageSource {
return `${frameworkVersion}-alpha.0`;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ child.once('close', code => {
if (code) {
process.exitCode = code;
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export interface IPackageSource {
* Not all tests will respect this.
*/
requestedAlphaVersion(): string;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export function packageSourceInSubprocess(): IPackageSource {
case 'release': return new ReleasePackageSource();
default: throw new Error(`Unrecognized package source: ${process.env.PACKAGE_SOURCE}`);
}
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ async function writeNpmLoginToken(usageDir: UsageDir, endpoint: string, token: s
return rcFile;
}

// Environment variable, .npmrc in same directory as package.json or in home dir
// Environment variable, .npmrc in same directory as package.json or in home dir
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ async function writeNuGetConfigFile(filename: string, login: LoginInformation) {
</configuration>`);
}

// NuGet.Config in current directory
// NuGet.Config in current directory
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ export async function parallelShell<A>(
}));

await q.onEmpty();
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export async function uploadPythonPackages(packages: string[], login: LoginInfor
}
return 'fail';
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ export class UsageDir {
// eslint-disable-next-line no-console
console.log(` source ${this.directory}/activate.bash`);
}
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/with-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export function withPackages<A extends object>(block: (context: A & PackageConte
packages: packageSourceInSubprocess(),
});
};
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/with-timeout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export function withTimeout<A>(seconds: number, block: (x: A) => Promise<void>)
timeOut,
]);
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ function* range(n: number) {
for (let i = 0; i < n; i++) {
yield i;
}
}
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/test/xpmutex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ function waitFor(pred: () => boolean): Promise<void> {
}
}, 5);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { existsSync, promises as fs } from 'fs';
import * as querystring from 'node:querystring';
import * as os from 'os';
import * as path from 'path';
import {
Expand All @@ -23,6 +24,7 @@ import { PutObjectLockConfigurationCommand } from '@aws-sdk/client-s3';
import { CreateTopicCommand, DeleteTopicCommand } from '@aws-sdk/client-sns';
import { AssumeRoleCommand, GetCallerIdentityCommand } from '@aws-sdk/client-sts';
import * as mockttp from 'mockttp';
import { CompletedRequest } from 'mockttp';
import {
cloneDirectory,
integTest,
Expand Down Expand Up @@ -2846,10 +2848,19 @@ integTest('requests go through a proxy when configured',
});
} finally {
await fs.rm(certDir, { recursive: true, force: true });
await proxyServer.stop();
}

// Checking that there was some interaction with the proxy
const requests = await endpoint.getSeenRequests();
expect(requests.length).toBeGreaterThan(0);
const actionsUsed = actions(await endpoint.getSeenRequests());
expect(actionsUsed).toContain('AssumeRole');
expect(actionsUsed).toContain('CreateChangeSet');
}),
);

function actions(requests: CompletedRequest[]): string[] {
return [...new Set(requests
.map(req => req.body.buffer.toString('utf-8'))
.map(body => querystring.decode(body))
.map(x => x.Action as string)
.filter(action => action != null))];
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ import { integTest, withTemporaryDirectory, ShellHelper, withPackages } from '..
await shell.shell([`${venvPath}/bin/pytest`], { modEnv: venv });
await shell.shell(['cdk', 'synth'], { modEnv: venv });
})));
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ async function removeDevDependencies(context: TemporaryDirectoryContext) {
const pj = JSON.parse(await fs.readFile(filename, { encoding: 'utf-8' }));
delete pj.devDependencies;
await fs.writeFile(filename, JSON.stringify(pj, undefined, 2), { encoding: 'utf-8' });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ integTest('typescript init lib', withTemporaryDirectory(withPackages(async (cont
await shell.shell(['npm', 'ls']); // this will fail if we have unmet peer dependencies
await shell.shell(['npm', 'run', 'build']);
await shell.shell(['npm', 'run', 'test']);
})));
})));
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ exports.handler = async (evt: any) => {
'Access-Control-Allow-Origin': '*',
},
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ new integ.IntegTest(app, 'LambdaTest', {
testCases: [stack],
});

app.synth();
app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ new integ.IntegTest(app, 'specrestapi-import-deployment-stage', {
testCases: [stack],
});

app.synth();
app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ const app = new cdk.App();
const testCase = new Test(app, 'test-apigateway-spec-restapi');
new IntegTest(app, 'apigateway-spec-restapi', {
testCases: [testCase],
});
});
Loading

0 comments on commit 36deb38

Please sign in to comment.