class FeatureFlags
Language | Type name |
---|---|
.NET | Amazon.CDK.FeatureFlags |
Java | software.amazon.awscdk.core.FeatureFlags |
Python | aws_cdk.core.FeatureFlags |
TypeScript (source) | @aws-cdk/core » FeatureFlags |
Features that are implemented behind a flag in order to preserve backwards compatibility for existing apps.
The list of flags are available in the
@aws-cdk/cx-api
module.
The state of the flag for this application is stored as a CDK context variable.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from '@aws-cdk/core';
const featureFlags = cdk.FeatureFlags.of(this);
Methods
Name | Description |
---|---|
is | Check whether a feature flag is enabled. |
static of(scope) | Inspect feature flags on the construct node's context. |
isEnabled(featureFlag)
public isEnabled(featureFlag: string): boolean
Parameters
- featureFlag
string
Returns
boolean
Check whether a feature flag is enabled.
If configured, the flag is present in
the construct node context. Falls back to the defaults defined in the cx-api
module.
static of(scope)
public static of(scope: IConstruct): FeatureFlags
Parameters
- scope
IConstruct
Returns
Inspect feature flags on the construct node's context.