You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reverts #29513
We will want to use a property to achieve the desired behavior instead of a feature flag since we are not changing the default behavior.
- Set `introducedIn.v2` to the literal string `'V2NEXT'`.
1202
1200
- Double negatives should be avoided. If you want to add a flag that disables something that was previously
1203
1201
enabled, set `default.v2` to `true` and the `recommendedValue` to `false`. You will need to update
1204
1202
a test in `features.test.ts` -- this is okay if you have a good reason.
1205
-
In your description, be sure to cover the following:
1203
+
2. Use `FeatureFlags.of(construct).isEnabled(cxapi.ENABLE_XXX)` to check if this feature is enabled
1204
+
in your code. If it is not defined, revert to the legacy behavior.
1205
+
3. Add your feature flag to the `FLAGS` map in
1206
+
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/lib/features.ts). In
1207
+
your description, be sure to cover the following:
1206
1208
- Consciously pick the type of feature flag. Can the flag be removed in a future major version, or not?
1207
1209
- Motivate why the feature flag exists. What is the change to existing infrastructure and why is it not safe?
1208
1210
- In case of a "default change flag", describe what the user needs to do to restore the old behavior.
1209
-
3. Use `FeatureFlags.of(construct).isEnabled(cxapi.ENABLE_XXX)` to check if this feature is enabled
1210
-
in your code. If it is not defined, revert to the legacy behavior.
1211
1211
4. Add an entry for your feature flag in the [README](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/README.md) file.
1212
1212
5. In your tests, ensure that you test your feature with and without the feature flag enabled. You can do this by passing the feature flag to the `context` property when instantiating an `App`.
Copy file name to clipboardExpand all lines: packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
-17
Original file line number
Diff line number
Diff line change
@@ -67,8 +67,6 @@ Flags come in three types:
67
67
|[@aws-cdk/aws-codepipeline:crossAccountKeysDefaultValueToFalse](#aws-cdkaws-codepipelinecrossaccountkeysdefaultvaluetofalse)| Enables Pipeline to set the default value for crossAccountKeys to false. | 2.127.0 | (default) |
68
68
|[@aws-cdk/aws-codepipeline:defaultPipelineTypeToV2](#aws-cdkaws-codepipelinedefaultpipelinetypetov2)| Enables Pipeline to set the default pipeline type to V2. | 2.133.0 | (default) |
69
69
|[@aws-cdk/aws-kms:reduceCrossAccountRegionPolicyScope](#aws-cdkaws-kmsreducecrossaccountregionpolicyscope)| When enabled, IAM Policy created from KMS key grant will reduce the resource scope to this key only. | 2.134.0 | (fix) |
70
-
| [@aws-cdk/aws-elasticloadbalancingv2:ExternalApplicationListener-noRuleSuffixForAddAction](#aws-cdkaws-elasticloadbalancingv2externalapplicationlistener-norulesuffixforaddaction) | When enabled, you can switch from the `addTargetGroups()` method of declaring a `ListenerRule` to the `addAction()` method,
71
-
without changing the logicalId and replacing your resource. | V2NEXT | (fix) |
72
70
73
71
<!-- END table -->
74
72
@@ -1267,19 +1265,4 @@ When this feature flag is enabled and calling KMS key grant method, the created
Alternatively, do not enable this feature flag and instead consider the `@aws-cdk/aws-elasticloadbalancingv2:ExternalApplicationListener-noRuleSuffixForAddAction` as necessary.
summary: 'When enabled, you can switch from the \`addTargetGroups()\` method of declaring a \`ListenerRule\` to the \`addAction()\` method, without changing the logicalId and replacing your resource.',
1043
-
detailsMd: `
1044
-
When switching from a less complex to a more complex use of ALB,
1045
-
you will eventually need features not available in the \`addTargetGroups()\` convenience method.
1046
-
In this case you will want to use the \`addAction()\` method.
1047
-
Before this feature is enabled, switching over to \`addAction()\` from using \`addTargetGroups()\`
1048
-
will add a \`Rule\` suffix to the logicalId of your \`ListenerRule\`,
1049
-
causing CloudFormation to attempt to replace the resource.
1050
-
Since \`ListenerRule\`s have a unique priority,
1051
-
CloudFormation will always fail when generating the new \`ListenerRule\`.
1052
-
1053
-
Setting this feature flag will cause the \`addAction()\` method to not add the \`Rule\` suffix on the logicalId.
1054
-
This allows you to switch from the \`addTargetGroups()\` method without having CloudFormation deadlock while attempting to replace the resource.
0 commit comments