Feature flag manifests in App Lifecycle Manager let you create and export flags in bulk using local JSON files that conform to the open-source OpenFeature flag manifest schema. You can push new definitions to the App Lifecycle Manager management plane or pull existing flags for OpenFeature code generation.
Prerequisites
Before you begin, ensure you have:
- A
gcloudenvironment configured to manage App Lifecycle Manager resources. - Completed the Deploy feature flags quickstart or the Deploy with the gcloud CLI quickstart.
Create flags from a manifest
The push command lets you create multiple flags at once by providing a local
JSON manifest file.
Create a file named
my_flags.jsonwith your flag definitions. This file serves as the local source of truth for your manifest.Example
my_flags.json:{ "flags": { "my-flag": { "defaultValue": "foo-bar", "description": "A description of the flag.", "flagType": "string" } } }- Run the
pushcommand specifying your manifest file and the targetedUnitKind.
gcloud beta app-lifecycle-manager flags push \ --file="my_flags.json" \ --location="global" \ --unit-kind="UNIT_KIND_NAME"- Run the
Create a manifest from existing flag configurations
The pull command fetches existing flag configurations from the
App Lifecycle Manager API and generates a local JSON manifest file. This lets
you maintain a local record of your flags or prepare them for use with
OpenFeature codegen tools.
Run the
pullcommand specifying your chosen output path.gcloud beta app-lifecycle-manager flags pull \ --location="global" \ --output-file="manifest.json" \ --unit-kind="UNIT_KIND_NAME" \ --overwrite-output-fileIf you are using type-safe flag accessors, run the OpenFeature CLI codegen utility against the new
manifest.jsonto update your application's type-safe flag accessors. This ensures the manifests match the keys and types in the management plane.
What's next
- Learn about Complex Targeting with CEL.
- Learn about Multi-Tenant Architecture.