1. Packages
  2. Packages
  3. Pulumi Cloud (Pulumi Service provider)
  4. API Docs
  5. getEnvironment

This provider is currently in preview.

Viewing docs for Pulumi Cloud v0.39.0
published on Tuesday, Apr 28, 2026 by Pulumi
pulumiservice logo

This provider is currently in preview.

Viewing docs for Pulumi Cloud v0.39.0
published on Tuesday, Apr 28, 2026 by Pulumi

    Looks up an existing ESC environment by name and returns its UUID. Use this to pin a custom RBAC role to a specific environment via a literalEnvironment expression when the environment is not managed by the current Pulumi program. Errors when the environment is not found.

    Using getEnvironment

    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 getEnvironment(args: GetEnvironmentArgs, opts?: InvokeOptions): Promise<GetEnvironmentResult>
    function getEnvironmentOutput(args: GetEnvironmentOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentResult>
    def get_environment(name: Optional[str] = None,
                        organization_name: Optional[str] = None,
                        project_name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetEnvironmentResult
    def get_environment_output(name: Optional[pulumi.Input[str]] = None,
                        organization_name: Optional[pulumi.Input[str]] = None,
                        project_name: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentResult]
    func LookupEnvironment(ctx *Context, args *LookupEnvironmentArgs, opts ...InvokeOption) (*LookupEnvironmentResult, error)
    func LookupEnvironmentOutput(ctx *Context, args *LookupEnvironmentOutputArgs, opts ...InvokeOption) LookupEnvironmentResultOutput

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

    public static class GetEnvironment 
    {
        public static Task<GetEnvironmentResult> InvokeAsync(GetEnvironmentArgs args, InvokeOptions? opts = null)
        public static Output<GetEnvironmentResult> Invoke(GetEnvironmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    public static Output<GetEnvironmentResult> getEnvironment(GetEnvironmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: pulumiservice:getEnvironment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The environment name.
    OrganizationName string
    The Pulumi Cloud organization that owns the environment.
    ProjectName string
    The ESC project name. Defaults to default.
    Name string
    The environment name.
    OrganizationName string
    The Pulumi Cloud organization that owns the environment.
    ProjectName string
    The ESC project name. Defaults to default.
    name String
    The environment name.
    organizationName String
    The Pulumi Cloud organization that owns the environment.
    projectName String
    The ESC project name. Defaults to default.
    name string
    The environment name.
    organizationName string
    The Pulumi Cloud organization that owns the environment.
    projectName string
    The ESC project name. Defaults to default.
    name str
    The environment name.
    organization_name str
    The Pulumi Cloud organization that owns the environment.
    project_name str
    The ESC project name. Defaults to default.
    name String
    The environment name.
    organizationName String
    The Pulumi Cloud organization that owns the environment.
    projectName String
    The ESC project name. Defaults to default.

    getEnvironment Result

    The following output properties are available:

    EnvironmentId string
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    Name string
    The environment name.
    OrganizationName string
    The Pulumi Cloud organization that owns the environment.
    ProjectName string
    The ESC project the environment lives in.
    EnvironmentId string
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    Name string
    The environment name.
    OrganizationName string
    The Pulumi Cloud organization that owns the environment.
    ProjectName string
    The ESC project the environment lives in.
    environmentId String
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    name String
    The environment name.
    organizationName String
    The Pulumi Cloud organization that owns the environment.
    projectName String
    The ESC project the environment lives in.
    environmentId string
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    name string
    The environment name.
    organizationName string
    The Pulumi Cloud organization that owns the environment.
    projectName string
    The ESC project the environment lives in.
    environment_id str
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    name str
    The environment name.
    organization_name str
    The Pulumi Cloud organization that owns the environment.
    project_name str
    The ESC project the environment lives in.
    environmentId String
    The environment's UUID. Use this as the identity value when pinning a custom RBAC role to this environment via a literalEnvironment expression.
    name String
    The environment name.
    organizationName String
    The Pulumi Cloud organization that owns the environment.
    projectName String
    The ESC project the environment lives in.

    Package Details

    Repository
    pulumiservice pulumi/pulumi-pulumiservice
    License
    Apache-2.0
    pulumiservice logo

    This provider is currently in preview.

    Viewing docs for Pulumi Cloud v0.39.0
    published on Tuesday, Apr 28, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.