Skip to content

Commit f4cc281

Browse files
authored
Merge branch 'master' into madeline-k/assertions/ecr
2 parents 1c34463 + a2e8914 commit f4cc281

102 files changed

Lines changed: 771 additions & 6906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -803,35 +803,17 @@ The pattern is simple:
803803
with the name of the context key that **enables** this new feature (for
804804
example, `ENABLE_STACK_NAME_DUPLICATES`). The context key should be in the
805805
form `module.Type:feature` (e.g. `@aws-cdk/core:enableStackNameDuplicates`).
806-
2. Use `node.tryGetContext(cxapi.ENABLE_XXX)` to check if this feature is enabled
806+
2. Use `FeatureFlags.of(construct).isEnabled(cxapi.ENABLE_XXX)` to check if this feature is enabled
807807
in your code. If it is not defined, revert to the legacy behavior.
808808
3. Add your feature flag to the `FUTURE_FLAGS` map in
809809
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/features.ts).
810810
This map is inserted to generated `cdk.json` files for new projects created
811811
through `cdk init`.
812-
4. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:
812+
4. In your tests, use the `testFutureBehavior` and `testLegacyBehavior` [jest helper methods] to test the enabled and disabled behavior.
813+
5. In your PR title (which goes into CHANGELOG), add a `(under feature flag)` suffix. e.g:
813814

814815
`fix(core): impossible to use the same physical stack name for two stacks (under feature flag)`
815816

816-
In the [next major version of the
817-
CDK](https://github.com/aws/aws-cdk/issues/3398) we will either remove the
818-
legacy behavior or flip the logic for all these features and then
819-
reset the `FEATURE_FLAGS` map for the next cycle.
820-
821-
### Feature Flags - CDKv2
822-
823-
We have started working on the next version of the CDK, specifically CDKv2. This is currently being maintained
824-
on a separate branch `v2-main` whereas `master` continues to track versions `1.x`.
825-
826-
Feature flags introduced in the CDK 1.x and removed in 2.x, must be added to the `FUTURE_FLAGS_EXPIRED` list in
827-
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/cx-api/lib/features.ts)
828-
on the `v2-main` branch.
829-
This will make the default behaviour in CDKv2 as if the flag is enabled and also prevents users from disabling
830-
the feature flag.
831-
832-
A couple of [jest helper methods] are available for use with unit tests. These help run unit tests that test
833-
behaviour when flags are enabled or disabled in the two major versions.
834-
835817
[jest helper methods]: https://github.com/aws/aws-cdk/blob/master/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts
836818

837819
## Versioning and Release

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"@yarnpkg/lockfile": "^1.1.0",
19-
"cdk-generate-synthetic-examples": "^0.1.2",
19+
"cdk-generate-synthetic-examples": "^0.1.3",
2020
"conventional-changelog-cli": "^2.2.2",
2121
"fs-extra": "^9.1.0",
2222
"graceful-fs": "^4.2.9",

packages/@aws-cdk/assert-internal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@aws-cdk/pkglint": "0.0.0",
2929
"@types/jest": "^27.4.0",
3030
"jest": "^27.4.7",
31-
"ts-jest": "^27.1.2"
31+
"ts-jest": "^27.1.3"
3232
},
3333
"dependencies": {
3434
"@aws-cdk/cloud-assembly-schema": "0.0.0",

packages/@aws-cdk/assert/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"aws-cdk-migration": "0.0.0",
4242
"constructs": "^3.3.69",
4343
"jest": "^27.3.1",
44-
"ts-jest": "^27.1.2"
44+
"ts-jest": "^27.1.3"
4545
},
4646
"dependencies": {
4747
"@aws-cdk/cloudformation-diff": "0.0.0",

packages/@aws-cdk/assertions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@types/jest": "^27.4.0",
6969
"constructs": "^3.3.69",
7070
"jest": "^27.4.7",
71-
"ts-jest": "^27.1.2"
71+
"ts-jest": "^27.1.3"
7272
},
7373
"dependencies": {
7474
"@aws-cdk/cloud-assembly-schema": "0.0.0",

packages/@aws-cdk/aws-apigatewayv2-authorizers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"@aws-cdk/cdk-build-tools": "0.0.0",
8686
"@aws-cdk/cdk-integ-tools": "0.0.0",
8787
"@aws-cdk/pkglint": "0.0.0",
88-
"@types/aws-lambda": "^8.10.89",
88+
"@types/aws-lambda": "^8.10.90",
8989
"@types/jest": "^27.4.0"
9090
},
9191
"dependencies": {

packages/@aws-cdk/aws-certificatemanager/lambda-packages/dns_validated_certificate_handler/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"license": "Apache-2.0",
3131
"devDependencies": {
32-
"@types/aws-lambda": "^8.10.89",
32+
"@types/aws-lambda": "^8.10.90",
3333
"@types/sinon": "^9.0.11",
3434
"@aws-cdk/cdk-build-tools": "0.0.0",
3535
"aws-sdk": "^2.596.0",
@@ -44,6 +44,6 @@
4444
"lambda-tester": "^3.6.0",
4545
"sinon": "^9.2.4",
4646
"nock": "^13.2.2",
47-
"ts-jest": "^27.1.2"
47+
"ts-jest": "^27.1.3"
4848
}
4949
}

packages/@aws-cdk/aws-cloudformation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@aws-cdk/cdk-integ-tools": "0.0.0",
8080
"@aws-cdk/cfn2ts": "0.0.0",
8181
"@aws-cdk/pkglint": "0.0.0",
82-
"@types/aws-lambda": "^8.10.89",
82+
"@types/aws-lambda": "^8.10.90",
8383
"@types/jest": "^27.4.0",
8484
"jest": "^27.4.7"
8585
},

packages/@aws-cdk/aws-cloudwatch-actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"license": "Apache-2.0",
6666
"devDependencies": {
67-
"@aws-cdk/assert-internal": "0.0.0",
67+
"@aws-cdk/assertions": "0.0.0",
6868
"@aws-cdk/aws-ec2": "0.0.0",
6969
"@aws-cdk/cdk-build-tools": "0.0.0",
7070
"@aws-cdk/cdk-integ-tools": "0.0.0",

packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
33
import * as cloudwatch from '@aws-cdk/aws-cloudwatch';
44
import { Stack } from '@aws-cdk/core';
@@ -27,7 +27,7 @@ test('can use topic as alarm action', () => {
2727
alarm.addAlarmAction(new actions.ApplicationScalingAction(action));
2828

2929
// THEN
30-
expect(stack).toHaveResource('AWS::CloudWatch::Alarm', {
30+
Template.fromStack(stack).hasResourceProperties('AWS::CloudWatch::Alarm', {
3131
AlarmActions: [
3232
{ Ref: 'Action62AD07C0' },
3333
],

0 commit comments

Comments
 (0)