Feature flags
Feature flags makes it possible to fine tune given functionality in the Amplify CLI.
They are grouped into sections based on the area of the functionality. An area can be a category or some other scope. There are different type of feature flags defined, their lifetime is controlled the lifecycle process.
These types of feature flags are used to enable or disable a given functionality in Amplify CLI that is under active development. These feature flags are removed and become unsupported once a feature has been shipped.
During the history of the Amplify CLI there are enhancements that can benefit for new projects but potentially can cause breaking changes in existing deployments. These feature flags are controlled by the lifecycle process to provide time for mitigation and migration. These type of flags are disabled for existing projects and enabled for new ones.
Examples
- Breaking existing projects by generating different code and would require a backend deployment.
- The push operation of a changed resource would require a resource recreation that could lead to data loss.
- The push operation of a changed resource would require data backfill to make the client application operable.
- The generated code for client applications would require a rebuild and republish to be compatible with the newly pushed backend.
Experimental feature flags are to enable experimentation with given functionality, to provide feedback to the Amplify CLI team. Enabling these feature in production is highly discouraged.
The outcome of experimental features can be:
- The feature will make into the product so it will be turned into a Release type feature flag.
- The experimental feature is not making into the product and removed from the codebase together with the code itself.
Each type of feature flags are managed under a lifecycle management process. When a feature flag is added to the Amplify CLI it will be mentioned in the release notes and also this page will be updated with the detailed information. After adding a feature flag this page will contain information about what version a feature flag was added, what is the planned deprecation date - if there is one -, in which version the feature flag was deprecated, in which version the feature flag was removed.
When a feature flag is deprecated it still can be used but when used a warning will be printed on the screen during the execution of Amplify CLI commands.
Before removal a removal date is added to the feature flag, and after a feature flag is removed Amplify CLI will shows an error message about it and the version the feature flag was removed added to the page.
Configuration of feature flags are primarily done by having an cli.json
file in the project's amplify
folder. If the file does not exist Amplify CLI creates it during the amplify init
command. The emitted values are representing the default values for new projects. This file must be under version control, to make sure that the same features are used locally, in CI/CD environments, between team members. If an environment specific file exists for the currently checked out environment, during amplify env add
command the same file will be copied for the newly created environment as well.
Example configuration file
If for some reason different functionality is needed to be enabled for a given Amplify CLI environment a copy can be made of the project level file with the following naming convention: cli.{environment name}.json
.
Amplify CLI supports the definition and override of feature flags values from environment variables and .env
files as well.
The environment variables must follow a naming convention, to be picked up by Amplify CLI:
- Project level override:
AMPLIFYCLI_{SECTION}__{PROPERTY}
, for example: AMPLIFYCLI_GRAPHQLTRANSFORMER__TRANSFORMERVERSION
- Environment specific override:
AMPLIFYCLI_{ENVNAME}_{SECTION}__{PROPERTY}
, for example: AMPLIFYCLI_PROD_GRAPHQLTRANSFORMER__TRANSFORMERVERSION
If a .env
file is used in the project's root folder, then it is being merged on top of the current process' environment variables, overwriting those.
Due to the multiple levels of configuration options and overrides, Amplify CLI does a top-to-bottom evaluation as follows:
cli.json
cli.{environment name}.json
- Project level environment variables
- CLI Environment level environment variables
Note: feature flags are case-insensitive, however are described here in camelCase for readability
Feature Flags related to AppSync backed APIs.
Changes the permission format to grant access to graphql operations instead of appsync control plane operations
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.42.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Creates IAM policies to allow Query/Mutations | | ✅ |
false | Uses previous policy format which allows control plane access to AppSync | ✅ | |
Feature Flag related to GraphQL Transformer
Automatically add owner field to type when owner fields are not in the type
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.30.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Inserts the owner field from auth rules when its missing in type | | ✅ |
false | Doesn't insert the owner field automatically | ✅ | |
Use word specific pluralization instead of only appending an "s" to every word. Note: this feature flag is only respected when using GraphQL Transformer v1.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.0.2 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | When pluralizing values i.e. for list resolvers, 'Match' becomes 'Matches' | | |
false | When pluralizing values i.e. for list resolvers, 'Match' becomes 'Matchs' | ✅ | ✅ |
Throw an error when compiling the GraphQL schema if a type name is a reserved word.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.32.1 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Throws an error if a type name is a reserved word. | ✅ | ✅ |
false | Allows compilation to pass with reserved words as type names. However, you may encounter downstream GraphQL errors. | | |
Use pipeline resolver-based GraphQL Transformer (GraphQL Transformer vNext).
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.32.4 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Enable pipeline resolver-based GraphQL Transformer (GraphQL Transformer vNext). | | |
false | Disables pipeline resolver-based GraphQL Transformer. | ✅ | ✅ |
Enable multiple GSI updates through iterative incremental deployments.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.38.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | GraphQL schemas changes can contain multiple GSI changes. | | ✅ |
false | Throws Error when mutating more than 1 GSIs in update flow. . | ✅ | |
Changes the behaviour of @key directive to always create GSIs.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.41.x | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | @key will always create GSIs for named keys. | | ✅ |
false | @key create an LSI when the named key includes a primary field. | ✅ | |
If a custom mutation is defined on a model, prevent the regeneration of that mutation
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.45.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | If a custom create, update, or delete mutation is defined on a model, the input will not be regenerated | | ✅ |
false | The GraphQL Transformer will recreate inputs for models even if they have the custom mutations specified | ✅ | |
Sets which version of the GraphQL Transformer will be used
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.4.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
1 | The GraphQL Transformer V1 will be used | ✅ | |
2 | The GraphQL Transformer V2 will be used | | ✅ |
Prevent the CLI from prompting for schema migration
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.4.0 | November 10th 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | GraphQL Transformer V1 projects will not be prompted to migrate to V2 | ✅ | ✅ |
false | GraphQL Transformer V1 projects will be prompted to migrate to V2 | | |
Adds notification of @auth updates to improve security for @primaryKey and @index
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 7.6.12 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | A notification with a prompt will appear, after which security updates are automatically applied and no further prompt will appear | ✅ | |
false | There is no notification of security updates | | ✅ |
Adds a notification of @auth security change.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 7.6.15 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | A notification with a prompt will appear, after which security updates are automatically applied and no further prompt will appear | ✅ | |
false | There is no notification of security updates | | ✅ |
Changes the default identity claim to for owner-based @auth from 'username' to 'sub::username'
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 8.x | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Uses a default owner field format of '<sub>::<username>' to write records and reads both '<username>' and '<sub>::<username>' | ✅ | ✅ |
false | Uses a default owner field format of '<username>' to write records and reads '<username>' | | |
Changes the naming convention for primary key connection fields.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 8.3.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Uses 'Id' in the name. (Type + RelatedType + Id) | | |
false | Uses the related type field name in the name. (Type + RelatedType + RelatedTypeFieldName) | ✅ | ✅ |
Changes the behaviour of @index directive to auto-generate Queries for indexes if no 'queryField' is provided.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 8.5.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | An empty 'queryField' will cause a Query to be auto-generated. Explicit null value will disable this functionality | | ✅ |
false | A Query will only be created if the 'queryField' is explicitly set | ✅ | |
Changes the behavior of relational directives on model types that contain a custom primary key by generating connection fields that respect the attributes of the primary key and sort key fields. The changes include naming convention, the number of connected fields, and their field types. In addition, this changes the code generation for DataStore models of all platforms to enable the custom primary key feature.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 10.0.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
false | Only one connection field with type ID generated on connected models. Model-gen with custom primary key feature is disabled. | ✅ | |
true | Connection field(s) are generated respecting the attributes of priamry key and sort key fields. Model-gen with custom primary key feature is enabled. | | ✅ |
Performs a deep merge with default directives and custom directives.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 9.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
false | Merge default directives and custom directives with a single level depth. Custom directives will take precedent. | ✅ | ✅ |
true | Merge default directives and custom directives with unlimitted depth. Custom directives will take precedent. | | |
Populates the owner field automatically if the user is already authorized by static user pool authorization rules
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 9.2.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | If the user is authorized, the owner field is automatically populated | ✅ | |
false | If the user is authorized by static user pool authorization rules, the owner field needs to be explicitly set by the developer | | ✅ |
Toggles whether subscriptions will inherit related authorization when relational fields are set as required
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 12.12.4 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Subscriptions will inherit the primary model authorization rules for the relational fields | | |
false | Relational fields will be redacted in mutation response when there is a difference between auth rules between primary and related models. | ✅ | ✅ |
Feature Flag related to iOS projects
Automatically add DataStore / API models to the Xcode project.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | All newly generated DataStore/API models are auto-added to the Xcode project | | ✅ |
false | All newly generated DataStore/API models are NOT auto-added to the Xcode project. | ✅ | |
Feature Flag related to auth
Toggles case insensitivity for Cognito login mechanisms (username, email etc..)
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Emails and usernames are case insensitive | | ✅ |
false | Emails and usernames are case sensitive. | ✅ | |
Toggles terminology used for allow and deny lists.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.47.0 | April 1st 2022 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | The terms allowlist and denylist are used. | | ✅ |
false | The legacy terms whitelist and blacklist are used. | ✅ | |
Toggles the creation of auth triggers
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.51.0 | December 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Creates auth triggers as custom Lambdas to be used with Apis and Storage. | | ✅ |
false | Creates auth triggers via Cognito CloudFormation | ✅ | |
Forces the use of aliasAttributes with Cognito rather than usernameAttributes
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.0.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Forces the CLI to use aliasAttributes when creating auth, allowing for a preferred_username | | |
false | Continue to use usernameAttributes with Cognito | ✅ | ✅ |
Allows the use of only TOTP if only phone_number is configured, if another attribute is added SMS MFA is enabled
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.3.1 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Allow TOTP to be configured for login by itself | | |
false | TOTP cannot be used alone for login with Cognito | ✅ | ✅ |
Feature Flag related to Codegen
Choose between implementations of internal DataStore model generator package. Refer https://github.com/aws-amplify/amplify-codegen/blob/main/FeatureFlags.md
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Use the models generator internal package implementation at https://github.com/aws-amplify/amplify-codegen/tree/main/packages/appsync-modelgen-plugin | | ✅ |
false | Use the deprecated models generator package implementation at https://github.com/aws-amplify/amplify-cli/tree/main/packages/amplify-codegen-appsync-model-plugin | ✅ | |
Choose between implementations of internal GraphQL documents generator package. Refer https://github.com/aws-amplify/amplify-codegen/blob/main/FeatureFlags.md
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Use the GraphQL documents generator internal package implementation at https://github.com/aws-amplify/amplify-codegen | | ✅ |
false | Use the deprecated GraphQL documents generation package implementation at https://github.com/aws-amplify/amplify-cli/tree/main/packages/amplify-graphql-docs-generator | ✅ | |
Choose between implementations of internal GraphQL types generator package. Refer https://github.com/aws-amplify/amplify-codegen/blob/main/FeatureFlags.md
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Use the types generator internal package implementation at https://github.com/aws-amplify/amplify-codegen | | ✅ |
false | Use the deprecated types generation package implementation at https://github.com/aws-amplify/amplify-cli/tree/main/packages/amplify-graphql-types-generator | ✅ | |
Clears the generated models folder before they are re-generated.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Recommended to be set true when there are no hand-written files in the modelgen output folder. | | ✅ |
false | Does not remove pre-existing files from the modelgen output folder. This would retain the generated models even after the corresponding types are removed from the GraphQL schema. | ✅ | |
Retains the case style developer uses while naming the GraphQL types in schema
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.40.0 | May 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | Retain the case style used for naming the GraphQL types in the schema. Refer https://github.com/aws-amplify/amplify-codegen/pull/89 | | ✅ |
false | Generate camelCase/PascalCase variable names for types irrespective of the case style used for naming the types. | ✅ | |
Add read-only timestamp fields in modelgen. For more infomation please refer change logs of amplify repos
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 4.51.2 | Nov 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Add read-only timestamp `createdAt` and `updatedAt` fields in modelgen. Minimum version for amplify library: amplify-ios@1.9.0, amplify-android@1.17.2 | | ✅ |
false | No read-only timestamp fields will be added | ✅ | |
Generate Dart models with null safety for Flutter applications using DataStore.
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.1.0 | Jan 1st 2022 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Generate Dart models with null safety. Minimum supported version for Amplify library: amplify-flutter is 0.2.0 | | ✅ |
false | Generate Dart models without null safety | ✅ | |
Configure the nullability of the List and List components in Datastore Models generation
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.1.2 | Nov 1st 2021 | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Respect the nullability of List types as specified in the GraphQL schema. Refer https://docs.amplify.aws/cli/migration/list-nullability for more information. | | ✅ |
false | Use the nullability specification of list components to decide the nullability of List. | ✅ | |
Adds auth provider details to iOS models
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.0.2 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Adds auth provider details to iOS models | | ✅ |
false | iOS models will not be able to access auth provider details | ✅ | |
Adds key/index details to iOS models
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 5.0.2 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Adds key/index details to iOS models | | ✅ |
false | iOS models will not be able to access key/index details | ✅ | |
Generate models for lazy loading and custom selection set
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | x.x.x | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | [Recommended] Add support for lazy loading and custom selection set. | | |
false | models will not support selection set customization and lazy loading. | ✅ | |
Feature Flags related to region mapping support.
Controls Comprehend region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | us-west-1, eu-west-3, eu-north-1, ap-northeast-1, ap-northeast-2, ap-south-1, me-south-1, and sa-east-1 are mapped to other regions. | ✅ | |
1 | us-west-1, eu-west-3, eu-north-1, me-south-1, and sa-east-1 are mapped to other regions. | | ✅ |
Controls Pinpoint region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, cn-north-1, cn-northwest-1, eu-north-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, and us-west-1 are mapped to other regions. | ✅ | |
1 | ap-northeast-3, cn-north-1, cn-northwest-1, eu-north-1, eu-west-3, me-south-1, sa-east-1, us-east-2, and us-west-1 are mapped to other regions. | | ✅ |
Controls Rekognition region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | ca-central-1, eu-north-1, eu-west-3, me-south-1, and sa-east-1 are mapped to other regions. | ✅ | |
1 | eu-north-1, eu-west-3, me-south-1, and sa-east-1 are mapped to other regions. | | ✅ |
Controls Textract region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | ap-northeast-1, ap-northeast-2, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, eu-central-1, eu-north-1, eu-west-2, eu-west-3, me-south-1, and sa-east-1 are mapped to other regions. | ✅ | |
1 | ap-northeast-1, eu-north-1, eu-west-3, me-south-1, and sa-east-1 are mapped to other regions. | | ✅ |
Controls Transcribe region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | eu-north-1 and ap-northeast-1 are mapped to other regions. | ✅ | |
1 | eu-north-1 is mapped to another region. | | ✅ |
Controls Translate region mapping
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 6.1.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
0 | ap-southeast-2, eu-west-2, me-south-1, sa-east-1, and us-east-2 are mapped to other regions. | ✅ | |
1 | ap-southeast-2, eu-west-2, and us-east-2 are mapped to other regions. | | ✅ |
Enables support for overrides, prevents using unsupported versions of the CLI with overridden resources
Enables support for overrides
Type | Added | Deprecation date | Deprecated | Removal date | Removed |
---|
Feature | 7.3.0 | | | | |
Value | Description | Default for existing projects | Default for new projects |
---|
true | The CLI ignores the value of this flag | ✅ | ✅ |
false | The CLI ignores the value of this flag | | |