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

circleci.Context

Explore with Pulumi AI

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

    A CircleCI context is a named collection of environment variables that can be referenced in the configuration for workflows.

    Example Usage

    Basic usage:

    import * as pulumi from "@pulumi/pulumi";
    import * as circleci from "@pulumi/circleci";
    
    const build = new circleci.Context("build", {});
    
    import pulumi
    import pulumi_circleci as circleci
    
    build = circleci.Context("build")
    
    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.NewContext(ctx, "build", nil)
    		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 build = new Circleci.Context("build");
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.circleci.Context;
    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 build = new Context("build");
    
        }
    }
    
    resources:
      build:
        type: circleci:Context
    

    Create Context Resource

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

    Constructor syntax

    new Context(name: string, args?: ContextArgs, opts?: CustomResourceOptions);
    @overload
    def Context(resource_name: str,
                args: Optional[ContextArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Context(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                context_id: Optional[str] = None,
                name: Optional[str] = None,
                organization: Optional[str] = None)
    func NewContext(ctx *Context, name string, args *ContextArgs, opts ...ResourceOption) (*Context, error)
    public Context(string name, ContextArgs? args = null, CustomResourceOptions? opts = null)
    public Context(String name, ContextArgs args)
    public Context(String name, ContextArgs args, CustomResourceOptions options)
    
    type: circleci:Context
    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 ContextArgs
    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 ContextArgs
    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 ContextArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContextArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContextArgs
    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 contextResource = new Circleci.Context("contextResource", new()
    {
        ContextId = "string",
        Name = "string",
        Organization = "string",
    });
    
    example, err := circleci.NewContext(ctx, "contextResource", &circleci.ContextArgs{
    	ContextId:    pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Organization: pulumi.String("string"),
    })
    
    var contextResource = new Context("contextResource", ContextArgs.builder()
        .contextId("string")
        .name("string")
        .organization("string")
        .build());
    
    context_resource = circleci.Context("contextResource",
        context_id="string",
        name="string",
        organization="string")
    
    const contextResource = new circleci.Context("contextResource", {
        contextId: "string",
        name: "string",
        organization: "string",
    });
    
    type: circleci:Context
    properties:
        contextId: string
        name: string
        organization: string
    

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

    ContextId string
    The ID of the context.
    Name string
    Name of the context.
    Organization string
    Organization where the context will be defined.
    ContextId string
    The ID of the context.
    Name string
    Name of the context.
    Organization string
    Organization where the context will be defined.
    contextId String
    The ID of the context.
    name String
    Name of the context.
    organization String
    Organization where the context will be defined.
    contextId string
    The ID of the context.
    name string
    Name of the context.
    organization string
    Organization where the context will be defined.
    context_id str
    The ID of the context.
    name str
    Name of the context.
    organization str
    Organization where the context will be defined.
    contextId String
    The ID of the context.
    name String
    Name of the context.
    organization String
    Organization where the context will be defined.

    Outputs

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

    Get an existing Context 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?: ContextState, opts?: CustomResourceOptions): Context
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            context_id: Optional[str] = None,
            name: Optional[str] = None,
            organization: Optional[str] = None) -> Context
    func GetContext(ctx *Context, name string, id IDInput, state *ContextState, opts ...ResourceOption) (*Context, error)
    public static Context Get(string name, Input<string> id, ContextState? state, CustomResourceOptions? opts = null)
    public static Context get(String name, Output<String> id, ContextState state, CustomResourceOptions options)
    resources:  _:    type: circleci:Context    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:
    ContextId string
    The ID of the context.
    Name string
    Name of the context.
    Organization string
    Organization where the context will be defined.
    ContextId string
    The ID of the context.
    Name string
    Name of the context.
    Organization string
    Organization where the context will be defined.
    contextId String
    The ID of the context.
    name String
    Name of the context.
    organization String
    Organization where the context will be defined.
    contextId string
    The ID of the context.
    name string
    Name of the context.
    organization string
    Organization where the context will be defined.
    context_id str
    The ID of the context.
    name str
    Name of the context.
    organization str
    Organization where the context will be defined.
    contextId String
    The ID of the context.
    name String
    Name of the context.
    organization String
    Organization where the context will be defined.

    Import

    Contexts can be imported as $organization/$context, where “context” can be either a context name or ID. For example:

    name

    $ pulumi import circleci:index/context:Context build hashicorp/build
    

    id

    $ pulumi import circleci:index/context:Context build hashicorp/6d87b798-5edb-4d99-b424-ce73b43affb9
    

    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