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

circleci.getContext

Explore with Pulumi AI

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

Use this data source to get information about a CircleCI context.

Example Usage

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

const build = circleci.getContext({
    name: "build",
});
Copy
import pulumi
import pulumi_circleci as circleci

build = circleci.get_context(name="build")
Copy
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.LookupContext(ctx, &circleci.LookupContextArgs{
			Name: "build",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Circleci = Pulumi.Circleci;

return await Deployment.RunAsync(() => 
{
    var build = Circleci.GetContext.Invoke(new()
    {
        Name = "build",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.circleci.CircleciFunctions;
import com.pulumi.circleci.inputs.GetContextArgs;
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) {
        final var build = CircleciFunctions.getContext(GetContextArgs.builder()
            .name("build")
            .build());

    }
}
Copy
variables:
  build:
    fn::invoke:
      function: circleci:getContext
      arguments:
        name: build
Copy

Using getContext

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getContext(args: GetContextArgs, opts?: InvokeOptions): Promise<GetContextResult>
function getContextOutput(args: GetContextOutputArgs, opts?: InvokeOptions): Output<GetContextResult>
Copy
def get_context(id: Optional[str] = None,
                name: Optional[str] = None,
                organization: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetContextResult
def get_context_output(id: Optional[pulumi.Input[str]] = None,
                name: Optional[pulumi.Input[str]] = None,
                organization: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetContextResult]
Copy
func LookupContext(ctx *Context, args *LookupContextArgs, opts ...InvokeOption) (*LookupContextResult, error)
func LookupContextOutput(ctx *Context, args *LookupContextOutputArgs, opts ...InvokeOption) LookupContextResultOutput
Copy

> Note: This function is named LookupContext in the Go SDK.

public static class GetContext 
{
    public static Task<GetContextResult> InvokeAsync(GetContextArgs args, InvokeOptions? opts = null)
    public static Output<GetContextResult> Invoke(GetContextInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetContextResult> getContext(GetContextArgs args, InvokeOptions options)
public static Output<GetContextResult> getContext(GetContextArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: circleci:index/getContext:getContext
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name of the context.
Id string
The ID of the context.
Organization string
Organization where the context is defined.
Name This property is required. string
Name of the context.
Id string
The ID of the context.
Organization string
Organization where the context is defined.
name This property is required. String
Name of the context.
id String
The ID of the context.
organization String
Organization where the context is defined.
name This property is required. string
Name of the context.
id string
The ID of the context.
organization string
Organization where the context is defined.
name This property is required. str
Name of the context.
id str
The ID of the context.
organization str
Organization where the context is defined.
name This property is required. String
Name of the context.
id String
The ID of the context.
organization String
Organization where the context is defined.

getContext Result

The following output properties are available:

Id string
The ID of the context.
Name string
Organization string
Id string
The ID of the context.
Name string
Organization string
id String
The ID of the context.
name String
organization String
id string
The ID of the context.
name string
organization string
id str
The ID of the context.
name str
organization str
id String
The ID of the context.
name String
organization String

Package Details

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