1. Packages
  2. Harness Provider
  3. API Docs
  4. platform
  5. Variables
Harness v0.7.1 published on Saturday, Mar 29, 2025 by Pulumi

harness.platform.Variables

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";

const test = new harness.platform.Variables("test", {
    identifier: "identifier",
    name: "name",
    orgId: "org_id",
    projectId: "project_id",
    type: "String",
    spec: {
        valueType: "FIXED",
        fixedValue: "fixedValue",
    },
});
Copy
import pulumi
import pulumi_harness as harness

test = harness.platform.Variables("test",
    identifier="identifier",
    name="name",
    org_id="org_id",
    project_id="project_id",
    type="String",
    spec={
        "value_type": "FIXED",
        "fixed_value": "fixedValue",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := platform.NewVariables(ctx, "test", &platform.VariablesArgs{
			Identifier: pulumi.String("identifier"),
			Name:       pulumi.String("name"),
			OrgId:      pulumi.String("org_id"),
			ProjectId:  pulumi.String("project_id"),
			Type:       pulumi.String("String"),
			Spec: &platform.VariablesSpecArgs{
				ValueType:  pulumi.String("FIXED"),
				FixedValue: pulumi.String("fixedValue"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var test = new Harness.Platform.Variables("test", new()
    {
        Identifier = "identifier",
        Name = "name",
        OrgId = "org_id",
        ProjectId = "project_id",
        Type = "String",
        Spec = new Harness.Platform.Inputs.VariablesSpecArgs
        {
            ValueType = "FIXED",
            FixedValue = "fixedValue",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.Variables;
import com.pulumi.harness.platform.VariablesArgs;
import com.pulumi.harness.platform.inputs.VariablesSpecArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test = new Variables("test", VariablesArgs.builder()
            .identifier("identifier")
            .name("name")
            .orgId("org_id")
            .projectId("project_id")
            .type("String")
            .spec(VariablesSpecArgs.builder()
                .valueType("FIXED")
                .fixedValue("fixedValue")
                .build())
            .build());

    }
}
Copy
resources:
  test:
    type: harness:platform:Variables
    properties:
      identifier: identifier
      name: name
      orgId: org_id
      projectId: project_id
      type: String
      spec:
        valueType: FIXED
        fixedValue: fixedValue
Copy

Create Variables Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Variables(name: string, args: VariablesArgs, opts?: CustomResourceOptions);
@overload
def Variables(resource_name: str,
              args: VariablesArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Variables(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              identifier: Optional[str] = None,
              spec: Optional[VariablesSpecArgs] = None,
              type: Optional[str] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              org_id: Optional[str] = None,
              project_id: Optional[str] = None)
func NewVariables(ctx *Context, name string, args VariablesArgs, opts ...ResourceOption) (*Variables, error)
public Variables(string name, VariablesArgs args, CustomResourceOptions? opts = null)
public Variables(String name, VariablesArgs args)
public Variables(String name, VariablesArgs args, CustomResourceOptions options)
type: harness:platform:Variables
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VariablesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VariablesArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VariablesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VariablesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VariablesArgs
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 variablesResource = new Harness.Platform.Variables("variablesResource", new()
{
    Identifier = "string",
    Spec = new Harness.Platform.Inputs.VariablesSpecArgs
    {
        FixedValue = "string",
        ValueType = "string",
    },
    Type = "string",
    Description = "string",
    Name = "string",
    OrgId = "string",
    ProjectId = "string",
});
Copy
example, err := platform.NewVariables(ctx, "variablesResource", &platform.VariablesArgs{
	Identifier: pulumi.String("string"),
	Spec: &platform.VariablesSpecArgs{
		FixedValue: pulumi.String("string"),
		ValueType:  pulumi.String("string"),
	},
	Type:        pulumi.String("string"),
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	OrgId:       pulumi.String("string"),
	ProjectId:   pulumi.String("string"),
})
Copy
var variablesResource = new Variables("variablesResource", VariablesArgs.builder()
    .identifier("string")
    .spec(VariablesSpecArgs.builder()
        .fixedValue("string")
        .valueType("string")
        .build())
    .type("string")
    .description("string")
    .name("string")
    .orgId("string")
    .projectId("string")
    .build());
Copy
variables_resource = harness.platform.Variables("variablesResource",
    identifier="string",
    spec={
        "fixed_value": "string",
        "value_type": "string",
    },
    type="string",
    description="string",
    name="string",
    org_id="string",
    project_id="string")
Copy
const variablesResource = new harness.platform.Variables("variablesResource", {
    identifier: "string",
    spec: {
        fixedValue: "string",
        valueType: "string",
    },
    type: "string",
    description: "string",
    name: "string",
    orgId: "string",
    projectId: "string",
});
Copy
type: harness:platform:Variables
properties:
    description: string
    identifier: string
    name: string
    orgId: string
    projectId: string
    spec:
        fixedValue: string
        valueType: string
    type: string
Copy

Variables 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 Variables resource accepts the following input properties:

Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource
Spec This property is required. VariablesSpec
List of Spec Fields.
Type This property is required. string
Type of Variable
Description string
Description of the entity
Name string
Name of the Variable
OrgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
ProjectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
Identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource
Spec This property is required. VariablesSpecArgs
List of Spec Fields.
Type This property is required. string
Type of Variable
Description string
Description of the entity
Name string
Name of the Variable
OrgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
ProjectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource
spec This property is required. VariablesSpec
List of Spec Fields.
type This property is required. String
Type of Variable
description String
Description of the entity
name String
Name of the Variable
orgId Changes to this property will trigger replacement. String
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. String
Project Identifier for the Entity
identifier
This property is required.
Changes to this property will trigger replacement.
string
Unique identifier of the resource
spec This property is required. VariablesSpec
List of Spec Fields.
type This property is required. string
Type of Variable
description string
Description of the entity
name string
Name of the Variable
orgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
identifier
This property is required.
Changes to this property will trigger replacement.
str
Unique identifier of the resource
spec This property is required. VariablesSpecArgs
List of Spec Fields.
type This property is required. str
Type of Variable
description str
Description of the entity
name str
Name of the Variable
org_id Changes to this property will trigger replacement. str
Organization Identifier for the Entity
project_id Changes to this property will trigger replacement. str
Project Identifier for the Entity
identifier
This property is required.
Changes to this property will trigger replacement.
String
Unique identifier of the resource
spec This property is required. Property Map
List of Spec Fields.
type This property is required. String
Type of Variable
description String
Description of the entity
name String
Name of the Variable
orgId Changes to this property will trigger replacement. String
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. String
Project Identifier for the Entity

Outputs

All input properties are implicitly available as output properties. Additionally, the Variables 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 Variables Resource

Get an existing Variables 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?: VariablesState, opts?: CustomResourceOptions): Variables
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        identifier: Optional[str] = None,
        name: Optional[str] = None,
        org_id: Optional[str] = None,
        project_id: Optional[str] = None,
        spec: Optional[VariablesSpecArgs] = None,
        type: Optional[str] = None) -> Variables
func GetVariables(ctx *Context, name string, id IDInput, state *VariablesState, opts ...ResourceOption) (*Variables, error)
public static Variables Get(string name, Input<string> id, VariablesState? state, CustomResourceOptions? opts = null)
public static Variables get(String name, Output<String> id, VariablesState state, CustomResourceOptions options)
resources:  _:    type: harness:platform:Variables    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Description string
Description of the entity
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource
Name string
Name of the Variable
OrgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
ProjectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
Spec VariablesSpec
List of Spec Fields.
Type string
Type of Variable
Description string
Description of the entity
Identifier Changes to this property will trigger replacement. string
Unique identifier of the resource
Name string
Name of the Variable
OrgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
ProjectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
Spec VariablesSpecArgs
List of Spec Fields.
Type string
Type of Variable
description String
Description of the entity
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource
name String
Name of the Variable
orgId Changes to this property will trigger replacement. String
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. String
Project Identifier for the Entity
spec VariablesSpec
List of Spec Fields.
type String
Type of Variable
description string
Description of the entity
identifier Changes to this property will trigger replacement. string
Unique identifier of the resource
name string
Name of the Variable
orgId Changes to this property will trigger replacement. string
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. string
Project Identifier for the Entity
spec VariablesSpec
List of Spec Fields.
type string
Type of Variable
description str
Description of the entity
identifier Changes to this property will trigger replacement. str
Unique identifier of the resource
name str
Name of the Variable
org_id Changes to this property will trigger replacement. str
Organization Identifier for the Entity
project_id Changes to this property will trigger replacement. str
Project Identifier for the Entity
spec VariablesSpecArgs
List of Spec Fields.
type str
Type of Variable
description String
Description of the entity
identifier Changes to this property will trigger replacement. String
Unique identifier of the resource
name String
Name of the Variable
orgId Changes to this property will trigger replacement. String
Organization Identifier for the Entity
projectId Changes to this property will trigger replacement. String
Project Identifier for the Entity
spec Property Map
List of Spec Fields.
type String
Type of Variable

Supporting Types

VariablesSpec
, VariablesSpecArgs

FixedValue This property is required. string
FixedValue of the variable
ValueType This property is required. string
Type of Value of the Variable. For now only FIXED is supported
FixedValue This property is required. string
FixedValue of the variable
ValueType This property is required. string
Type of Value of the Variable. For now only FIXED is supported
fixedValue This property is required. String
FixedValue of the variable
valueType This property is required. String
Type of Value of the Variable. For now only FIXED is supported
fixedValue This property is required. string
FixedValue of the variable
valueType This property is required. string
Type of Value of the Variable. For now only FIXED is supported
fixed_value This property is required. str
FixedValue of the variable
value_type This property is required. str
Type of Value of the Variable. For now only FIXED is supported
fixedValue This property is required. String
FixedValue of the variable
valueType This property is required. String
Type of Value of the Variable. For now only FIXED is supported

Import

Import account level variables

$ pulumi import harness:platform/variables:Variables example <variable_id>
Copy

Import org level variables

$ pulumi import harness:platform/variables:Variables example <ord_id>/<variable_id>
Copy

Import project level variables

$ pulumi import harness:platform/variables:Variables example <org_id>/<project_id>/<variable_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
harness pulumi/pulumi-harness
License
Apache-2.0
Notes
This Pulumi package is based on the harness Terraform Provider.