Skip to content

Commit

Permalink
Merge branch 'main' into 28843-ipv6InIsolatedSubnet
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorRobertson committed Feb 3, 2024
2 parents bcc69e0 + 8c79bdc commit 039f305
Show file tree
Hide file tree
Showing 350 changed files with 95,179 additions and 12,210 deletions.
34 changes: 24 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
> REPLACE THIS TEXT BLOCK
>
> Describe the reason for this change, what the solution is, and any
> important design decisions you made.
>
> Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any
> code you submit.
>
> [CONTRIBUTING GUIDE]: https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md
> [DESIGN GUIDELINES]: https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md
### Issue # (if applicable)

Closes #<issue number here>.

### Reason for this change

<!--What is the bug or use case behind this change?-->

### Description of changes

<!--What code changes did you make? Have you made any important design decisions?-->

### Description of how you validated changes

<!--Have you added any unit tests and/or integration tests?-->

### Checklist
- [ ] 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)

<!--Does this PR includes breaking changes? If it does, list them here in the following format (notice how multiple breaking changes should be formatted):
```
BREAKING CHANGE: Description of the breaking change, the previous behaviour, and the new behaviour.
* **module-name:** Another breaking change
* **module-name:** Yet another breaking change
```
-->
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
4 changes: 2 additions & 2 deletions .github/workflows/repo-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
SEARCH_QUERY: 'repo:aws/aws-cdk is:issue created:${{ env.last_month }} -reason:"not planned"'

- name: Create report for issues
uses: peter-evans/create-issue-from-file@v4
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -50,7 +50,7 @@ jobs:
SEARCH_QUERY: 'repo:aws/aws-cdk is:pr created:${{ env.last_month }} -is:draft'

- name: Create report for PRs
uses: peter-evans/create-issue-from-file@v4
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly PR metrics report
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
persist-credentials: false
- name: Find changed cli files
id: changed-cli-files
uses: tj-actions/changed-files@ae82ed4ae04587b665efad2f206578aa6f0e8539
uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files_yaml: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ RELEASE_NOTES.md

# Produced by integ tests
read*lock

# VSCode jest plugin
.test-output

21 changes: 21 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

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.126.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.125.0-alpha.0...v2.126.0-alpha.0) (2024-02-02)

## [2.125.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.124.0-alpha.0...v2.125.0-alpha.0) (2024-01-31)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **integ-runner:** Parsing of the cli input caused arguments passed after the first instance `--language <language>` to be interpreted as a language as well. This prevented passing a test name after providing cli options. To overcome this limitation, `integ-runner` now requires an explicit `--language` option for each language you want to include: `integ-runner --language javascript --language python`. This was already documented that way and always the intended way to use this feature.
* **neptune-alpha:** Corrected LogRetention IDs for DatabaseCluster. Previously, regardless of the log type, the string ‘objectObject’ was always included, but after the correction, the log type is now included.

### Features

* **app-staging-synthesizer-alpha:** encryption type for staging bucket ([#28903](https://github.com/aws/aws-cdk/issues/28903)) ([69f4b8d](https://github.com/aws/aws-cdk/commit/69f4b8d6560a293059b9e527be1fac6d1c70c971)), closes [#28815](https://github.com/aws/aws-cdk/issues/28815)
* **pipes:** EventBridge Pipes alpha module ([#28388](https://github.com/aws/aws-cdk/issues/28388)) ([2d9106b](https://github.com/aws/aws-cdk/commit/2d9106b7bd764a5bca33b7b5e3f3faffde726757)), closes [#23495](https://github.com/aws/aws-cdk/issues/23495)


### Bug Fixes

* **integ-runner:** cannot pass test name after `--language` ([#28922](https://github.com/aws/aws-cdk/issues/28922)) ([f9fbbb4](https://github.com/aws/aws-cdk/commit/f9fbbb4bd3a3ff74c3a2b34ffa333ac4fa57de2b))
* **neptune-alpha:** multiple `cloudwatchLogsExports` cannot be set when configuring log retention ([#28643](https://github.com/aws/aws-cdk/issues/28643)) ([56794fc](https://github.com/aws/aws-cdk/commit/56794fc8a0f1f5d3c1ab29e3ee0a46b138895d32)), closes [#26295](https://github.com/aws/aws-cdk/issues/26295)

## [2.124.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.123.0-alpha.0...v2.124.0-alpha.0) (2024-01-26)

## [2.123.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.122.0-alpha.0...v2.123.0-alpha.0) (2024-01-24)
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

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.126.0](https://github.com/aws/aws-cdk/compare/v2.125.0...v2.126.0) (2024-02-02)


### Features

* **migrate:** Add CDK Migrate `--from-scan` functionality ([#28962](https://github.com/aws/aws-cdk/issues/28962)) ([bbc14b3](https://github.com/aws/aws-cdk/commit/bbc14b32801f103bc465fd910d507ffa0d06b7fe))

## [2.125.0](https://github.com/aws/aws-cdk/compare/v2.124.0...v2.125.0) (2024-01-31)


### Features

* **applicationautoscaling:** validate `evaluationPeriods` and `datapointsToAlarm` for step scaling policy ([#28880](https://github.com/aws/aws-cdk/issues/28880)) ([4034adb](https://github.com/aws/aws-cdk/commit/4034adb5e4453435b959fde5eea16a7824f21e73))
* **batch:** add fargate Runtime Platform properties to ECS Fargate C… ([#28841](https://github.com/aws/aws-cdk/issues/28841)) ([ac8251f](https://github.com/aws/aws-cdk/commit/ac8251fcdb8b5cc26d917c6d4a95e5eb3ccb2316)), closes [#26484](https://github.com/aws/aws-cdk/issues/26484)
* **CLI:** Diff Supports Import Change Sets ([#28787](https://github.com/aws/aws-cdk/issues/28787)) ([d973615](https://github.com/aws/aws-cdk/commit/d97361519bfb6a3ebb53939b1e7da4db0a507dee)), closes [#28336](https://github.com/aws/aws-cdk/issues/28336)
* **cloudfront:** retrieve default distribution metrics ([#28894](https://github.com/aws/aws-cdk/issues/28894)) ([8e115db](https://github.com/aws/aws-cdk/commit/8e115dbca50479b619a3d8f79aad6bbf58f3a8fa)), closes [#28893](https://github.com/aws/aws-cdk/issues/28893)
* **cognito:** validate oidc provider name ([#28802](https://github.com/aws/aws-cdk/issues/28802)) ([534794c](https://github.com/aws/aws-cdk/commit/534794c900025b174825f82feb00671305555c0a)), closes [#28667](https://github.com/aws/aws-cdk/issues/28667)
* **sqs:** support for permission settings for dead letter source queues ([#28745](https://github.com/aws/aws-cdk/issues/28745)) ([9e21803](https://github.com/aws/aws-cdk/commit/9e21803b31e5df82f2abc7f6e7c7074a09ad7ed6)), closes [#19766](https://github.com/aws/aws-cdk/issues/19766)


### Bug Fixes

* **stepfunctions-tasks:** mediapackagevod service generates wrong action in role policy ([#28775](https://github.com/aws/aws-cdk/issues/28775)) ([305dae0](https://github.com/aws/aws-cdk/commit/305dae0743d7bf283df6a2c54c0f1ed784a56432)), closes [#28774](https://github.com/aws/aws-cdk/issues/28774)
* revert deprecation of `logRetention` properties ([#28934](https://github.com/aws/aws-cdk/issues/28934)) ([f89a7d2](https://github.com/aws/aws-cdk/commit/f89a7d2256e16d8e508a050706041292c4457e3f)), closes [#28919](https://github.com/aws/aws-cdk/issues/28919)
* **apigatewayv2:** WebSocketAwsIntegration ignores requestParameters and integrationPassThrough behaviors ([#28921](https://github.com/aws/aws-cdk/issues/28921)) ([990ead3](https://github.com/aws/aws-cdk/commit/990ead35abdb8f4860280a3c75d923b1e5f5b1ba))
* **eks:** Could not use ec2 instance type and size that their names contains dashes ([#28040](https://github.com/aws/aws-cdk/issues/28040)) ([b32f47c](https://github.com/aws/aws-cdk/commit/b32f47cfd65a5288e7bc2cc5a8a1f8e5f59032f8)), closes [#27587](https://github.com/aws/aws-cdk/issues/27587)

## [2.124.0](https://github.com/aws/aws-cdk/compare/v2.123.0...v2.124.0) (2024-01-26)


Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ Shout out to our top contributors!
- [corymhall](https://github.com/corymhall)
- [shivlaks](https://github.com/shivlaks)
- [otaviomacedo](https://github.com/otaviomacedo)
- [madeline-k](https://github.com/madeline-k)
- [mrgrain](https://github.com/mrgrain)
- [madeline-k](https://github.com/madeline-k)
- [NetaNir](https://github.com/NetaNir)
- [comcalvi](https://github.com/comcalvi)
- [robertd](https://github.com/robertd)
- [pahud](https://github.com/pahud)
- [MrArnoldPalmer](https://github.com/MrArnoldPalmer)
- [peterwoodworth](https://github.com/peterwoodworth)
- [pahud](https://github.com/pahud)
- [TheRealAmazonKendra](https://github.com/TheRealAmazonKendra)
- [peterwoodworth](https://github.com/peterwoodworth)
- [lpizzinidev](https://github.com/lpizzinidev)
- [colifran](https://github.com/colifran)
- [go-to-k](https://github.com/go-to-k)
- [colifran](https://github.com/colifran)
- [nija-at](https://github.com/nija-at)
- [hoegertn](https://github.com/hoegertn)
- [watany-dev](https://github.com/watany-dev)
- [jumic](https://github.com/jumic)


_Last updated: Mon, 01 Jan 24 00:09:50 +0000_
_Last updated: Thu, 01 Feb 24 00:09:34 +0000_
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"jsii-diff": "1.94.0",
"jsii-pacmak": "1.94.0",
"jsii-reflect": "1.94.0",
"jsii-rosetta": "~5.3.8",
"jsii-rosetta": "~5.3.9",
"lerna": "^7.4.2",
"nx": "^16.10.0",
"patch-package": "^6.5.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { AwsContext, withAws } from './with-aws';
import { withTimeout } from './with-timeout';

export const DEFAULT_TEST_TIMEOUT_S = 10 * 60;
export const EXTENDED_TEST_TIMEOUT_S = 30 * 60;

/**
* Higher order function to execute a block with a CDK app fixture
Expand Down Expand Up @@ -185,6 +186,10 @@ export function withDefaultFixture(block: (context: TestFixture) => Promise<void
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withCdkApp(block)));
}

export function withExtendedTimeoutFixture(block: (context: TestFixture) => Promise<void>) {
return withAws(withTimeout(EXTENDED_TEST_TIMEOUT_S, withCdkApp(block)));
}

export function withCDKMigrateFixture(language: string, block: (content: TestFixture) => Promise<void>) {
return withAws(withTimeout(DEFAULT_TEST_TIMEOUT_S, withCdkMigrateApp(language, block)));
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
},
"dependencies": {
"@octokit/rest": "^18.12.0",
"aws-sdk": "^2.1542.0",
"axios": "^1.6.5",
"aws-sdk": "^2.1548.0",
"axios": "^1.6.7",
"fs-extra": "^9.1.0",
"glob": "^7.2.3",
"jest": "^29.7.0",
Expand Down
28 changes: 28 additions & 0 deletions packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,35 @@ class MigrateStack extends cdk.Stack {
value: queue.node.defaultChild.logicalId,
});
}
if (process.env.SAMPLE_RESOURCES) {
const myTopic = new sns.Topic(this, 'migratetopic1', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
});
cdk.Tags.of(myTopic).add('tag1', 'value1');
const myTopic2 = new sns.Topic(this, 'migratetopic2', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
});
cdk.Tags.of(myTopic2).add('tag2', 'value2');
const myQueue = new sqs.Queue(this, 'migratequeue1', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
});
cdk.Tags.of(myQueue).add('tag3', 'value3');
}
if (process.env.LAMBDA_RESOURCES) {
const myFunction = new lambda.Function(this, 'migratefunction1', {
code: lambda.Code.fromInline('console.log("hello world")'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_18_X,
});
cdk.Tags.of(myFunction).add('lambda-tag', 'lambda-value');

const myFunction2 = new lambda.Function(this, 'migratefunction2', {
code: lambda.Code.fromInline('console.log("hello world2")'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_18_X,
});
cdk.Tags.of(myFunction2).add('lambda-tag', 'lambda-value');
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promises as fs, existsSync } from 'fs';
import * as os from 'os';
import * as path from 'path';
import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR, withCDKMigrateFixture } from '../../lib';
import { integTest, cloneDirectory, shell, withDefaultFixture, retry, sleep, randomInteger, withSamIntegrationFixture, RESOURCES_DIR, withCDKMigrateFixture, withExtendedTimeoutFixture } from '../../lib';

jest.setTimeout(2 * 60 * 60_000); // Includes the time to acquire locks, worst-case single-threaded runtime

Expand Down Expand Up @@ -571,9 +571,9 @@ integTest('deploy with role', withDefaultFixture(async (fixture) => {
}
}));

// TODO add go back in when template synths properly
// TODO add more testing that ensures the symmetry of the generated constructs to the resources.
['typescript', 'python', 'csharp', 'java'].forEach(language => {
integTest(`cdk migrate ${language}`, withCDKMigrateFixture(language, async (fixture) => {
integTest(`cdk migrate ${language} deploys successfully`, withCDKMigrateFixture(language, async (fixture) => {
if (language === 'python') {
await fixture.shell(['pip', 'install', '-r', 'requirements.txt']);
}
Expand All @@ -588,6 +588,118 @@ integTest('deploy with role', withDefaultFixture(async (fixture) => {
}));
});

integTest('cdk migrate generates migrate.json', withCDKMigrateFixture('typescript', async (fixture) => {

const migrateFile = await fs.readFile(path.join(fixture.integTestDir, 'migrate.json'), 'utf8');
const expectedFile = `{
\"//\": \"This file is generated by cdk migrate. It will be automatically deleted after the first successful deployment of this app to the environment of the original resources.\",
\"Source\": \"localfile\"
}`;
expect(JSON.parse(migrateFile)).toEqual(JSON.parse(expectedFile));
await fixture.cdkDestroy(fixture.stackNamePrefix);
}));

integTest('cdk migrate --from-scan with AND/OR filters correctly filters resources', withExtendedTimeoutFixture(async (fixture) => {
const stackName = `cdk-migrate-integ-${fixture.randomString}`;

await fixture.cdkDeploy('migrate-stack', {
modEnv: { SAMPLE_RESOURCES: '1' },
});
await fixture.cdk(
['migrate', '--stack-name', stackName, '--from-scan', 'new', '--filter', 'type=AWS::SNS::Topic,tag-key=tag1', 'type=AWS::SQS::Queue,tag-key=tag3'],
{ modEnv: { MIGRATE_INTEG_TEST: '1' }, neverRequireApproval: true, verbose: true, captureStderr: false },
);

try {
const response = await fixture.aws.cloudFormation('describeGeneratedTemplate', {
GeneratedTemplateName: stackName,
});
const resourceNames = [];
for (const resource of response.Resources || []) {
if (resource.LogicalResourceId) {
resourceNames.push(resource.LogicalResourceId);
}
}
fixture.log(`Resources: ${resourceNames}`);
expect(resourceNames.some(ele => ele && ele.includes('migratetopic1'))).toBeTruthy();
expect(resourceNames.some(ele => ele && ele.includes('migratequeue1'))).toBeTruthy();
} finally {
await fixture.cdkDestroy('migrate-stack');
await fixture.aws.cloudFormation('deleteGeneratedTemplate', {
GeneratedTemplateName: stackName,
});
}
}));

integTest('cdk migrate --from-scan for resources with Write Only Properties generates warnings', withExtendedTimeoutFixture(async (fixture) => {
const stackName = `cdk-migrate-integ-${fixture.randomString}`;

await fixture.cdkDeploy('migrate-stack', {
modEnv: {
LAMBDA_RESOURCES: '1',
},
});
await fixture.cdk(
['migrate', '--stack-name', stackName, '--from-scan', 'new', '--filter', 'type=AWS::Lambda::Function,tag-key=lambda-tag'],
{ modEnv: { MIGRATE_INTEG_TEST: '1' }, neverRequireApproval: true, verbose: true, captureStderr: false },
);

try {

const response = await fixture.aws.cloudFormation('describeGeneratedTemplate', {
GeneratedTemplateName: stackName,
});
const resourceNames = [];
for (const resource of response.Resources || []) {
if (resource.LogicalResourceId && resource.ResourceType === 'AWS::Lambda::Function') {
resourceNames.push(resource.LogicalResourceId);
}
}
fixture.log(`Resources: ${resourceNames}`);
const readmePath = path.join(fixture.integTestDir, stackName, 'README.md');
const readme = await fs.readFile(readmePath, 'utf8');
expect(readme).toContain('## Warnings');
for (const resourceName of resourceNames) {
expect(readme).toContain(`### ${resourceName}`);
}
} finally {
await fixture.cdkDestroy('migrate-stack');
await fixture.aws.cloudFormation('deleteGeneratedTemplate', {
GeneratedTemplateName: stackName,
});
}
}));

['typescript', 'python', 'csharp', 'java'].forEach(language => {
integTest(`cdk migrate --from-stack creates deployable ${language} app`, withExtendedTimeoutFixture(async (fixture) => {
const migrateStackName = fixture.fullStackName('migrate-stack');
await fixture.aws.cloudFormation('createStack', {
StackName: migrateStackName,
TemplateBody: await fs.readFile(path.join(__dirname, '..', '..', 'resources', 'templates', 'sqs-template.json'), 'utf8'),
});
try {
let stackStatus = 'CREATE_IN_PROGRESS';
while (stackStatus === 'CREATE_IN_PROGRESS') {
stackStatus = await (await (fixture.aws.cloudFormation('describeStacks', { StackName: migrateStackName }))).Stacks?.[0].StackStatus!;
await sleep(1000);
}
await fixture.cdk(
['migrate', '--stack-name', migrateStackName, '--from-stack'],
{ modEnv: { MIGRATE_INTEG_TEST: '1' }, neverRequireApproval: true, verbose: true, captureStderr: false },
);
await fixture.shell(['cd', path.join(fixture.integTestDir, migrateStackName)]);
await fixture.cdk(['deploy', migrateStackName], { neverRequireApproval: true, verbose: true, captureStderr: false });
const response = await fixture.aws.cloudFormation('describeStacks', {
StackName: migrateStackName,
});

expect(response.Stacks?.[0].StackStatus).toEqual('UPDATE_COMPLETE');
} finally {
await fixture.cdkDestroy('migrate-stack');
}
}));
});

integTest('cdk diff', withDefaultFixture(async (fixture) => {
const diff1 = await fixture.cdk(['diff', fixture.fullStackName('test-1')]);
expect(diff1).toContain('AWS::SNS::Topic');
Expand Down

0 comments on commit 039f305

Please sign in to comment.