1. Packages
  2. Circleci Provider
  3. API Docs
  4. EnvironmentVariable
circleci 0.6.1 published on Monday, Apr 14, 2025 by mrolla

circleci.EnvironmentVariable

Explore with Pulumi AI

circleci logo
circleci 0.6.1 published on Monday, Apr 14, 2025 by mrolla

    A CircleCI environment variable is a key value pair added to a project that will be exposed to jobs.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as circleci from "@pulumi/circleci";
    
    const token = new circleci.EnvironmentVariable("token", {
        project: "project",
        value: "secret",
    });
    
    import pulumi
    import pulumi_circleci as circleci
    
    token = circleci.EnvironmentVariable("token",
        project="project",
        value="secret")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/circleci/circleci"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := circleci.NewEnvironmentVariable(ctx, "token", &circleci.EnvironmentVariableArgs{
    			Project: pulumi.String("project"),
    			Value:   pulumi.String("secret"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Circleci = Pulumi.Circleci;
    
    return await Deployment.RunAsync(() => 
    {
        var token = new Circleci.EnvironmentVariable("token", new()
        {
            Project = "project",
            Value = "secret",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.circleci.EnvironmentVariable;
    import com.pulumi.circleci.EnvironmentVariableArgs;
    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 token = new EnvironmentVariable("token", EnvironmentVariableArgs.builder()
                .project("project")
                .value("secret")
                .build());
    
        }
    }
    
    resources:
      token:
        type: circleci:EnvironmentVariable
        properties:
          project: project
          value: secret
    

    Create EnvironmentVariable Resource

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

    Constructor syntax

    new EnvironmentVariable(name: string, args: EnvironmentVariableArgs, opts?: CustomResourceOptions);
    @overload
    def EnvironmentVariable(resource_name: str,
                            args: EnvironmentVariableArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def EnvironmentVariable(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            project: Optional[str] = None,
                            value: Optional[str] = None,
                            environment_variable_id: Optional[str] = None,
                            name: Optional[str] = None,
                            organization: Optional[str] = None,
                            timeouts: Optional[EnvironmentVariableTimeoutsArgs] = None)
    func NewEnvironmentVariable(ctx *Context, name string, args EnvironmentVariableArgs, opts ...ResourceOption) (*EnvironmentVariable, error)
    public EnvironmentVariable(string name, EnvironmentVariableArgs args, CustomResourceOptions? opts = null)
    public EnvironmentVariable(String name, EnvironmentVariableArgs args)
    public EnvironmentVariable(String name, EnvironmentVariableArgs args, CustomResourceOptions options)
    
    type: circleci:EnvironmentVariable
    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 EnvironmentVariableArgs
    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 EnvironmentVariableArgs
    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 EnvironmentVariableArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EnvironmentVariableArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EnvironmentVariableArgs
    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 environmentVariableResource = new Circleci.EnvironmentVariable("environmentVariableResource", new()
    {
        Project = "string",
        Value = "string",
        EnvironmentVariableId = "string",
        Name = "string",
        Organization = "string",
        Timeouts = new Circleci.Inputs.EnvironmentVariableTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := circleci.NewEnvironmentVariable(ctx, "environmentVariableResource", &circleci.EnvironmentVariableArgs{
    Project: pulumi.String("string"),
    Value: pulumi.String("string"),
    EnvironmentVariableId: pulumi.String("string"),
    Name: pulumi.String("string"),
    Organization: pulumi.String("string"),
    Timeouts: &.EnvironmentVariableTimeoutsArgs{
    Create: pulumi.String("string"),
    Delete: pulumi.String("string"),
    },
    })
    
    var environmentVariableResource = new EnvironmentVariable("environmentVariableResource", EnvironmentVariableArgs.builder()
        .project("string")
        .value("string")
        .environmentVariableId("string")
        .name("string")
        .organization("string")
        .timeouts(EnvironmentVariableTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    environment_variable_resource = circleci.EnvironmentVariable("environmentVariableResource",
        project="string",
        value="string",
        environment_variable_id="string",
        name="string",
        organization="string",
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const environmentVariableResource = new circleci.EnvironmentVariable("environmentVariableResource", {
        project: "string",
        value: "string",
        environmentVariableId: "string",
        name: "string",
        organization: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: circleci:EnvironmentVariable
    properties:
        environmentVariableId: string
        name: string
        organization: string
        project: string
        timeouts:
            create: string
            delete: string
        value: string
    

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

    Project string
    The project that the environment variable will be added to.
    Value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    EnvironmentVariableId string
    Name string
    Name of the environment variable.
    Organization string
    Organization where the project is defined.
    Timeouts EnvironmentVariableTimeouts
    Project string
    The project that the environment variable will be added to.
    Value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    EnvironmentVariableId string
    Name string
    Name of the environment variable.
    Organization string
    Organization where the project is defined.
    Timeouts EnvironmentVariableTimeoutsArgs
    project String
    The project that the environment variable will be added to.
    value String
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId String
    name String
    Name of the environment variable.
    organization String
    Organization where the project is defined.
    timeouts EnvironmentVariableTimeouts
    project string
    The project that the environment variable will be added to.
    value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId string
    name string
    Name of the environment variable.
    organization string
    Organization where the project is defined.
    timeouts EnvironmentVariableTimeouts
    project str
    The project that the environment variable will be added to.
    value str
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environment_variable_id str
    name str
    Name of the environment variable.
    organization str
    Organization where the project is defined.
    timeouts EnvironmentVariableTimeoutsArgs
    project String
    The project that the environment variable will be added to.
    value String
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId String
    name String
    Name of the environment variable.
    organization String
    Organization where the project is defined.
    timeouts Property Map

    Outputs

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

    Get an existing EnvironmentVariable 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?: EnvironmentVariableState, opts?: CustomResourceOptions): EnvironmentVariable
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            environment_variable_id: Optional[str] = None,
            name: Optional[str] = None,
            organization: Optional[str] = None,
            project: Optional[str] = None,
            timeouts: Optional[EnvironmentVariableTimeoutsArgs] = None,
            value: Optional[str] = None) -> EnvironmentVariable
    func GetEnvironmentVariable(ctx *Context, name string, id IDInput, state *EnvironmentVariableState, opts ...ResourceOption) (*EnvironmentVariable, error)
    public static EnvironmentVariable Get(string name, Input<string> id, EnvironmentVariableState? state, CustomResourceOptions? opts = null)
    public static EnvironmentVariable get(String name, Output<String> id, EnvironmentVariableState state, CustomResourceOptions options)
    resources:  _:    type: circleci:EnvironmentVariable    get:      id: ${id}
    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.
    The following state arguments are supported:
    EnvironmentVariableId string
    Name string
    Name of the environment variable.
    Organization string
    Organization where the project is defined.
    Project string
    The project that the environment variable will be added to.
    Timeouts EnvironmentVariableTimeouts
    Value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    EnvironmentVariableId string
    Name string
    Name of the environment variable.
    Organization string
    Organization where the project is defined.
    Project string
    The project that the environment variable will be added to.
    Timeouts EnvironmentVariableTimeoutsArgs
    Value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId String
    name String
    Name of the environment variable.
    organization String
    Organization where the project is defined.
    project String
    The project that the environment variable will be added to.
    timeouts EnvironmentVariableTimeouts
    value String
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId string
    name string
    Name of the environment variable.
    organization string
    Organization where the project is defined.
    project string
    The project that the environment variable will be added to.
    timeouts EnvironmentVariableTimeouts
    value string
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environment_variable_id str
    name str
    Name of the environment variable.
    organization str
    Organization where the project is defined.
    project str
    The project that the environment variable will be added to.
    timeouts EnvironmentVariableTimeoutsArgs
    value str
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.
    environmentVariableId String
    name String
    Name of the environment variable.
    organization String
    Organization where the project is defined.
    project String
    The project that the environment variable will be added to.
    timeouts Property Map
    value String
    The value of the environment variable. A hash of this value will be stored in state in order to detect changes, but the plain text value will not be stored.

    Supporting Types

    EnvironmentVariableTimeouts, EnvironmentVariableTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    Environment variables can be imported as $organization.$project.$name. For example:

    $ pulumi import circleci:index/environmentVariable:EnvironmentVariable token hashicorp.build.TOKEN
    

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

    Package Details

    Repository
    circleci mrolla/terraform-provider-circleci
    License
    Notes
    This Pulumi package is based on the circleci Terraform Provider.
    circleci logo
    circleci 0.6.1 published on Monday, Apr 14, 2025 by mrolla