harness.platform.FeatureFlag
Explore with Pulumi AI
Resource for managing Feature Flags.
Create FeatureFlag Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FeatureFlag(name: string, args: FeatureFlagArgs, opts?: CustomResourceOptions);
@overload
def FeatureFlag(resource_name: str,
args: FeatureFlagArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FeatureFlag(resource_name: str,
opts: Optional[ResourceOptions] = None,
permanent: Optional[bool] = None,
default_on_variation: Optional[str] = None,
variations: Optional[Sequence[FeatureFlagVariationArgs]] = None,
default_off_variation: Optional[str] = None,
identifier: Optional[str] = None,
kind: Optional[str] = None,
project_id: Optional[str] = None,
org_id: Optional[str] = None,
environments: Optional[Sequence[FeatureFlagEnvironmentArgs]] = None,
owner: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Sequence[FeatureFlagTagArgs]] = None,
description: Optional[str] = None)
func NewFeatureFlag(ctx *Context, name string, args FeatureFlagArgs, opts ...ResourceOption) (*FeatureFlag, error)
public FeatureFlag(string name, FeatureFlagArgs args, CustomResourceOptions? opts = null)
public FeatureFlag(String name, FeatureFlagArgs args)
public FeatureFlag(String name, FeatureFlagArgs args, CustomResourceOptions options)
type: harness:platform:FeatureFlag
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args FeatureFlagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args FeatureFlagArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args FeatureFlagArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FeatureFlagArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FeatureFlagArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var featureFlagResource = new Harness.Platform.FeatureFlag("featureFlagResource", new()
{
Permanent = false,
DefaultOnVariation = "string",
Variations = new[]
{
new Harness.Platform.Inputs.FeatureFlagVariationArgs
{
Description = "string",
Identifier = "string",
Name = "string",
Value = "string",
},
},
DefaultOffVariation = "string",
Identifier = "string",
Kind = "string",
ProjectId = "string",
OrgId = "string",
Environments = new[]
{
new Harness.Platform.Inputs.FeatureFlagEnvironmentArgs
{
Identifier = "string",
AddTargetRules = new[]
{
new Harness.Platform.Inputs.FeatureFlagEnvironmentAddTargetRuleArgs
{
Targets = new[]
{
"string",
},
Variation = "string",
},
},
DefaultOffVariation = "string",
DefaultOnVariation = "string",
State = "string",
},
},
Owner = "string",
Name = "string",
Tags = new[]
{
new Harness.Platform.Inputs.FeatureFlagTagArgs
{
Identifier = "string",
},
},
Description = "string",
});
example, err := platform.NewFeatureFlag(ctx, "featureFlagResource", &platform.FeatureFlagArgs{
Permanent: pulumi.Bool(false),
DefaultOnVariation: pulumi.String("string"),
Variations: platform.FeatureFlagVariationArray{
&platform.FeatureFlagVariationArgs{
Description: pulumi.String("string"),
Identifier: pulumi.String("string"),
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
DefaultOffVariation: pulumi.String("string"),
Identifier: pulumi.String("string"),
Kind: pulumi.String("string"),
ProjectId: pulumi.String("string"),
OrgId: pulumi.String("string"),
Environments: platform.FeatureFlagEnvironmentArray{
&platform.FeatureFlagEnvironmentArgs{
Identifier: pulumi.String("string"),
AddTargetRules: platform.FeatureFlagEnvironmentAddTargetRuleArray{
&platform.FeatureFlagEnvironmentAddTargetRuleArgs{
Targets: pulumi.StringArray{
pulumi.String("string"),
},
Variation: pulumi.String("string"),
},
},
DefaultOffVariation: pulumi.String("string"),
DefaultOnVariation: pulumi.String("string"),
State: pulumi.String("string"),
},
},
Owner: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: platform.FeatureFlagTagArray{
&platform.FeatureFlagTagArgs{
Identifier: pulumi.String("string"),
},
},
Description: pulumi.String("string"),
})
var featureFlagResource = new FeatureFlag("featureFlagResource", FeatureFlagArgs.builder()
.permanent(false)
.defaultOnVariation("string")
.variations(FeatureFlagVariationArgs.builder()
.description("string")
.identifier("string")
.name("string")
.value("string")
.build())
.defaultOffVariation("string")
.identifier("string")
.kind("string")
.projectId("string")
.orgId("string")
.environments(FeatureFlagEnvironmentArgs.builder()
.identifier("string")
.addTargetRules(FeatureFlagEnvironmentAddTargetRuleArgs.builder()
.targets("string")
.variation("string")
.build())
.defaultOffVariation("string")
.defaultOnVariation("string")
.state("string")
.build())
.owner("string")
.name("string")
.tags(FeatureFlagTagArgs.builder()
.identifier("string")
.build())
.description("string")
.build());
feature_flag_resource = harness.platform.FeatureFlag("featureFlagResource",
permanent=False,
default_on_variation="string",
variations=[{
"description": "string",
"identifier": "string",
"name": "string",
"value": "string",
}],
default_off_variation="string",
identifier="string",
kind="string",
project_id="string",
org_id="string",
environments=[{
"identifier": "string",
"add_target_rules": [{
"targets": ["string"],
"variation": "string",
}],
"default_off_variation": "string",
"default_on_variation": "string",
"state": "string",
}],
owner="string",
name="string",
tags=[{
"identifier": "string",
}],
description="string")
const featureFlagResource = new harness.platform.FeatureFlag("featureFlagResource", {
permanent: false,
defaultOnVariation: "string",
variations: [{
description: "string",
identifier: "string",
name: "string",
value: "string",
}],
defaultOffVariation: "string",
identifier: "string",
kind: "string",
projectId: "string",
orgId: "string",
environments: [{
identifier: "string",
addTargetRules: [{
targets: ["string"],
variation: "string",
}],
defaultOffVariation: "string",
defaultOnVariation: "string",
state: "string",
}],
owner: "string",
name: "string",
tags: [{
identifier: "string",
}],
description: "string",
});
type: harness:platform:FeatureFlag
properties:
defaultOffVariation: string
defaultOnVariation: string
description: string
environments:
- addTargetRules:
- targets:
- string
variation: string
defaultOffVariation: string
defaultOnVariation: string
identifier: string
state: string
identifier: string
kind: string
name: string
orgId: string
owner: string
permanent: false
projectId: string
tags:
- identifier: string
variations:
- description: string
identifier: string
name: string
value: string
FeatureFlag Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The FeatureFlag resource accepts the following input properties:
- Default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- Default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- Identifier string
- Identifier of the Feature Flag
- Kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- Org
Id string - Organization Identifier
- Permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- Project
Id string - Project Identifier
- Variations
List<Feature
Flag Variation> - The options available for your flag
- Description string
- Description of the Feature Flag
- Environments
List<Feature
Flag Environment> - Environment Identifier
- Name string
- Name of the Feature Flag
- Owner string
- The owner of the flag
- List<Feature
Flag Tag> - The tags for the flag
- Default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- Default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- Identifier string
- Identifier of the Feature Flag
- Kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- Org
Id string - Organization Identifier
- Permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- Project
Id string - Project Identifier
- Variations
[]Feature
Flag Variation Args - The options available for your flag
- Description string
- Description of the Feature Flag
- Environments
[]Feature
Flag Environment Args - Environment Identifier
- Name string
- Name of the Feature Flag
- Owner string
- The owner of the flag
- []Feature
Flag Tag Args - The tags for the flag
- default
Off StringVariation - Which of the variations to use when the flag is toggled to off state
- default
On StringVariation - Which of the variations to use when the flag is toggled to on state
- identifier String
- Identifier of the Feature Flag
- kind String
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- org
Id String - Organization Identifier
- permanent Boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id String - Project Identifier
- variations
List<Feature
Flag Variation> - The options available for your flag
- description String
- Description of the Feature Flag
- environments
List<Feature
Flag Environment> - Environment Identifier
- name String
- Name of the Feature Flag
- owner String
- The owner of the flag
- List<Feature
Flag Tag> - The tags for the flag
- default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- identifier string
- Identifier of the Feature Flag
- kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- org
Id string - Organization Identifier
- permanent boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id string - Project Identifier
- variations
Feature
Flag Variation[] - The options available for your flag
- description string
- Description of the Feature Flag
- environments
Feature
Flag Environment[] - Environment Identifier
- name string
- Name of the Feature Flag
- owner string
- The owner of the flag
- Feature
Flag Tag[] - The tags for the flag
- default_
off_ strvariation - Which of the variations to use when the flag is toggled to off state
- default_
on_ strvariation - Which of the variations to use when the flag is toggled to on state
- identifier str
- Identifier of the Feature Flag
- kind str
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- org_
id str - Organization Identifier
- permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project_
id str - Project Identifier
- variations
Sequence[Feature
Flag Variation Args] - The options available for your flag
- description str
- Description of the Feature Flag
- environments
Sequence[Feature
Flag Environment Args] - Environment Identifier
- name str
- Name of the Feature Flag
- owner str
- The owner of the flag
- Sequence[Feature
Flag Tag Args] - The tags for the flag
- default
Off StringVariation - Which of the variations to use when the flag is toggled to off state
- default
On StringVariation - Which of the variations to use when the flag is toggled to on state
- identifier String
- Identifier of the Feature Flag
- kind String
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- org
Id String - Organization Identifier
- permanent Boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id String - Project Identifier
- variations List<Property Map>
- The options available for your flag
- description String
- Description of the Feature Flag
- environments List<Property Map>
- Environment Identifier
- name String
- Name of the Feature Flag
- owner String
- The owner of the flag
- List<Property Map>
- The tags for the flag
Outputs
All input properties are implicitly available as output properties. Additionally, the FeatureFlag resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing FeatureFlag Resource
Get an existing FeatureFlag resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: FeatureFlagState, opts?: CustomResourceOptions): FeatureFlag
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default_off_variation: Optional[str] = None,
default_on_variation: Optional[str] = None,
description: Optional[str] = None,
environments: Optional[Sequence[FeatureFlagEnvironmentArgs]] = None,
identifier: Optional[str] = None,
kind: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
owner: Optional[str] = None,
permanent: Optional[bool] = None,
project_id: Optional[str] = None,
tags: Optional[Sequence[FeatureFlagTagArgs]] = None,
variations: Optional[Sequence[FeatureFlagVariationArgs]] = None) -> FeatureFlag
func GetFeatureFlag(ctx *Context, name string, id IDInput, state *FeatureFlagState, opts ...ResourceOption) (*FeatureFlag, error)
public static FeatureFlag Get(string name, Input<string> id, FeatureFlagState? state, CustomResourceOptions? opts = null)
public static FeatureFlag get(String name, Output<String> id, FeatureFlagState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- Default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- Description string
- Description of the Feature Flag
- Environments
List<Feature
Flag Environment> - Environment Identifier
- Identifier string
- Identifier of the Feature Flag
- Kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- Name string
- Name of the Feature Flag
- Org
Id string - Organization Identifier
- Owner string
- The owner of the flag
- Permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- Project
Id string - Project Identifier
- List<Feature
Flag Tag> - The tags for the flag
- Variations
List<Feature
Flag Variation> - The options available for your flag
- Default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- Default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- Description string
- Description of the Feature Flag
- Environments
[]Feature
Flag Environment Args - Environment Identifier
- Identifier string
- Identifier of the Feature Flag
- Kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- Name string
- Name of the Feature Flag
- Org
Id string - Organization Identifier
- Owner string
- The owner of the flag
- Permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- Project
Id string - Project Identifier
- []Feature
Flag Tag Args - The tags for the flag
- Variations
[]Feature
Flag Variation Args - The options available for your flag
- default
Off StringVariation - Which of the variations to use when the flag is toggled to off state
- default
On StringVariation - Which of the variations to use when the flag is toggled to on state
- description String
- Description of the Feature Flag
- environments
List<Feature
Flag Environment> - Environment Identifier
- identifier String
- Identifier of the Feature Flag
- kind String
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- name String
- Name of the Feature Flag
- org
Id String - Organization Identifier
- owner String
- The owner of the flag
- permanent Boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id String - Project Identifier
- List<Feature
Flag Tag> - The tags for the flag
- variations
List<Feature
Flag Variation> - The options available for your flag
- default
Off stringVariation - Which of the variations to use when the flag is toggled to off state
- default
On stringVariation - Which of the variations to use when the flag is toggled to on state
- description string
- Description of the Feature Flag
- environments
Feature
Flag Environment[] - Environment Identifier
- identifier string
- Identifier of the Feature Flag
- kind string
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- name string
- Name of the Feature Flag
- org
Id string - Organization Identifier
- owner string
- The owner of the flag
- permanent boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id string - Project Identifier
- Feature
Flag Tag[] - The tags for the flag
- variations
Feature
Flag Variation[] - The options available for your flag
- default_
off_ strvariation - Which of the variations to use when the flag is toggled to off state
- default_
on_ strvariation - Which of the variations to use when the flag is toggled to on state
- description str
- Description of the Feature Flag
- environments
Sequence[Feature
Flag Environment Args] - Environment Identifier
- identifier str
- Identifier of the Feature Flag
- kind str
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- name str
- Name of the Feature Flag
- org_
id str - Organization Identifier
- owner str
- The owner of the flag
- permanent bool
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project_
id str - Project Identifier
- Sequence[Feature
Flag Tag Args] - The tags for the flag
- variations
Sequence[Feature
Flag Variation Args] - The options available for your flag
- default
Off StringVariation - Which of the variations to use when the flag is toggled to off state
- default
On StringVariation - Which of the variations to use when the flag is toggled to on state
- description String
- Description of the Feature Flag
- environments List<Property Map>
- Environment Identifier
- identifier String
- Identifier of the Feature Flag
- kind String
- The type of data the flag represents. Valid values are
boolean
,int
,string
,json
- name String
- Name of the Feature Flag
- org
Id String - Organization Identifier
- owner String
- The owner of the flag
- permanent Boolean
- Whether or not the flag is permanent. If it is, it will never be flagged as stale
- project
Id String - Project Identifier
- List<Property Map>
- The tags for the flag
- variations List<Property Map>
- The options available for your flag
Supporting Types
FeatureFlagEnvironment, FeatureFlagEnvironmentArgs
- Identifier string
- Identifier of the Environment
- Add
Target List<FeatureRules Flag Environment Add Target Rule> - The targeting rules for the flag
- Default
Off stringVariation - Default variation to be served when flag is 'off'
- Default
On stringVariation - Default variation to be served when flag is 'on'
- State string
- State of the flag in this environment. Possible values are 'on' and 'off'
- Identifier string
- Identifier of the Environment
- Add
Target []FeatureRules Flag Environment Add Target Rule - The targeting rules for the flag
- Default
Off stringVariation - Default variation to be served when flag is 'off'
- Default
On stringVariation - Default variation to be served when flag is 'on'
- State string
- State of the flag in this environment. Possible values are 'on' and 'off'
- identifier String
- Identifier of the Environment
- add
Target List<FeatureRules Flag Environment Add Target Rule> - The targeting rules for the flag
- default
Off StringVariation - Default variation to be served when flag is 'off'
- default
On StringVariation - Default variation to be served when flag is 'on'
- state String
- State of the flag in this environment. Possible values are 'on' and 'off'
- identifier string
- Identifier of the Environment
- add
Target FeatureRules Flag Environment Add Target Rule[] - The targeting rules for the flag
- default
Off stringVariation - Default variation to be served when flag is 'off'
- default
On stringVariation - Default variation to be served when flag is 'on'
- state string
- State of the flag in this environment. Possible values are 'on' and 'off'
- identifier str
- Identifier of the Environment
- add_
target_ Sequence[Featurerules Flag Environment Add Target Rule] - The targeting rules for the flag
- default_
off_ strvariation - Default variation to be served when flag is 'off'
- default_
on_ strvariation - Default variation to be served when flag is 'on'
- state str
- State of the flag in this environment. Possible values are 'on' and 'off'
- identifier String
- Identifier of the Environment
- add
Target List<Property Map>Rules - The targeting rules for the flag
- default
Off StringVariation - Default variation to be served when flag is 'off'
- default
On StringVariation - Default variation to be served when flag is 'on'
- state String
- State of the flag in this environment. Possible values are 'on' and 'off'
FeatureFlagEnvironmentAddTargetRule, FeatureFlagEnvironmentAddTargetRuleArgs
FeatureFlagTag, FeatureFlagTagArgs
- Identifier string
- The identifier of the tag
- Identifier string
- The identifier of the tag
- identifier String
- The identifier of the tag
- identifier string
- The identifier of the tag
- identifier str
- The identifier of the tag
- identifier String
- The identifier of the tag
FeatureFlagVariation, FeatureFlagVariationArgs
- Description string
- The description of the variation
- Identifier string
- The identifier of the variation
- Name string
- The user friendly name of the variation
- Value string
- The value of the variation
- Description string
- The description of the variation
- Identifier string
- The identifier of the variation
- Name string
- The user friendly name of the variation
- Value string
- The value of the variation
- description String
- The description of the variation
- identifier String
- The identifier of the variation
- name String
- The user friendly name of the variation
- value String
- The value of the variation
- description string
- The description of the variation
- identifier string
- The identifier of the variation
- name string
- The user friendly name of the variation
- value string
- The value of the variation
- description str
- The description of the variation
- identifier str
- The identifier of the variation
- name str
- The user friendly name of the variation
- value str
- The value of the variation
- description String
- The description of the variation
- identifier String
- The identifier of the variation
- name String
- The user friendly name of the variation
- value String
- The value of the variation
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.