feature_flags
Creates, updates, deletes, gets or lists a feature_flags resource.
Overview
| Name | feature_flags |
| Type | Resource |
| Id | datadog.software_delivery.feature_flags |
Fields
The following fields are returned by SELECT queries:
- get_feature_flag
- list_feature_flags
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The unique identifier of the feature flag. (example: 550e8400-e29b-41d4-a716-446655440000) |
attributes | object | Attributes of a feature flag. |
type | string | The resource type. (feature-flags) (example: feature-flags) |
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | The unique identifier of the feature flag. (example: 550e8400-e29b-41d4-a716-446655440000) |
attributes | object | Attributes of a feature flag in list responses. |
type | string | The resource type. (feature-flags) (example: feature-flags) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_feature_flag | select | feature_flag_id | Returns the details of a specific feature flag<br />including variants and environment status. | |
list_feature_flags | select | key, is_archived, limit, offset | Returns a list of feature flags for the organization.<br />Supports filtering by key and archived status. | |
create_feature_flag | insert | data | Creates a new feature flag with variants. | |
update_feature_flag | replace | feature_flag_id, data | Updates an existing feature flag's metadata such as<br /> name and description. Does not modify targeting rules or allocations. | |
archive_feature_flag | exec | feature_flag_id | Archives a feature flag. Archived flags are<br />hidden from the main list but remain accessible and can be unarchived. | |
unarchive_feature_flag | exec | feature_flag_id | Unarchives a previously archived feature flag,<br />making it visible in the main list again. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
feature_flag_id | string (uuid) | The ID of the feature flag. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
is_archived | boolean | Filter by archived status. (example: false) |
key | string | Filter feature flags by key (partial matching). (example: flag-search-term) |
limit | integer (int64) | Maximum number of results to return. (example: 10) |
offset | integer (int64) | Number of results to skip. (example: 0) |
SELECT examples
- get_feature_flag
- list_feature_flags
Returns the details of a specific feature flag<br />including variants and environment status.
SELECT
id,
attributes,
type
FROM datadog.software_delivery.feature_flags
WHERE feature_flag_id = '{{ feature_flag_id }}' -- required
;
Returns a list of feature flags for the organization.<br />Supports filtering by key and archived status.
SELECT
id,
attributes,
type
FROM datadog.software_delivery.feature_flags
WHERE key = '{{ key }}'
AND is_archived = '{{ is_archived }}'
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
;
INSERT examples
- create_feature_flag
- Manifest
Creates a new feature flag with variants.
INSERT INTO datadog.software_delivery.feature_flags (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: feature_flags
props:
- name: data
description: |
Data for creating a new feature flag.
value:
attributes:
default_variant_key: "{{ default_variant_key }}"
description: "{{ description }}"
json_schema: "{{ json_schema }}"
key: "{{ key }}"
name: "{{ name }}"
value_type: "{{ value_type }}"
variants:
- key: "{{ key }}"
name: "{{ name }}"
value: "{{ value }}"
type: "{{ type }}"
REPLACE examples
- update_feature_flag
Updates an existing feature flag's metadata such as<br /> name and description. Does not modify targeting rules or allocations.
REPLACE datadog.software_delivery.feature_flags
SET
data = '{{ data }}'
WHERE
feature_flag_id = '{{ feature_flag_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
Lifecycle Methods
EXEC variables use wire (API) names.
- archive_feature_flag
- unarchive_feature_flag
Archives a feature flag. Archived flags are<br />hidden from the main list but remain accessible and can be unarchived.
EXEC datadog.software_delivery.feature_flags.archive_feature_flag
@feature_flag_id='{{ feature_flag_id }}' --required
;
Unarchives a previously archived feature flag,<br />making it visible in the main list again.
EXEC datadog.software_delivery.feature_flags.unarchive_feature_flag
@feature_flag_id='{{ feature_flag_id }}' --required
;