1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getOrg
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

cpln.getOrg

Explore with Pulumi AI

cpln logo
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

    Output the ID and name of the current org.

    Outputs

    The following attributes are exported:

    • cpln_id (String) The ID, in GUID format, of the org.
    • name (String) The name of org.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cpln = Pulumi.Cpln;
    
    return await Deployment.RunAsync(() => 
    {
        var org = Cpln.GetOrg.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["orgId"] = org.Apply(getOrgResult => getOrgResult.Id),
            ["orgName"] = org.Apply(getOrgResult => getOrgResult.Name),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		org, err := cpln.LookupOrg(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("orgId", org.Id)
    		ctx.Export("orgName", org.Name)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.CplnFunctions;
    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 org = CplnFunctions.getOrg();
    
            ctx.export("orgId", org.applyValue(getOrgResult -> getOrgResult.id()));
            ctx.export("orgName", org.applyValue(getOrgResult -> getOrgResult.name()));
        }
    }
    
    import pulumi
    import pulumi_cpln as cpln
    
    org = cpln.get_org()
    pulumi.export("orgId", org.id)
    pulumi.export("orgName", org.name)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumi/cpln";
    
    const org = cpln.getOrg({});
    export const orgId = org.then(org => org.id);
    export const orgName = org.then(org => org.name);
    
    variables:
      org:
        fn::invoke:
          Function: cpln:getOrg
          Arguments: {}
    outputs:
      orgId: ${org.id}
      orgName: ${org.name}
    

    Using getOrg

    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 getOrg(opts?: InvokeOptions): Promise<GetOrgResult>
    function getOrgOutput(opts?: InvokeOptions): Output<GetOrgResult>
    def get_org(opts: Optional[InvokeOptions] = None) -> GetOrgResult
    def get_org_output(opts: Optional[InvokeOptions] = None) -> Output[GetOrgResult]
    func LookupOrg(ctx *Context, opts ...InvokeOption) (*LookupOrgResult, error)
    func LookupOrgOutput(ctx *Context, opts ...InvokeOption) LookupOrgResultOutput

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

    public static class GetOrg 
    {
        public static Task<GetOrgResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetOrgResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetOrgResult> getOrg(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cpln:index/getOrg:getOrg
      arguments:
        # arguments dictionary

    getOrg Result

    The following output properties are available:

    CplnId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    CplnId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    cplnId String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    cplnId string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    cpln_id str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    cplnId String
    id String
    The provider-assigned unique ID for this managed resource.
    name String

    Package Details

    Repository
    cpln pulumiverse/pulumi-cpln
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cpln Terraform Provider.
    cpln logo
    Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse