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.40.0
published on Monday, May 11, 2026 by Pulumi
pulumiservice logo

This provider is currently in preview.

Viewing docs for Pulumi Cloud v0.40.0
published on Monday, May 11, 2026 by Pulumi

    Looks up an existing ESC environment by name and returns its UUID. Use this to scope a custom RBAC role to a specific environment — pass the returned UUID into buildEnvironmentScopedPermissions, or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions. 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: pulumi.Input[Optional[str]] = None,
                        organization_name: pulumi.Input[Optional[str]] = None,
                        project_name: pulumi.Input[Optional[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
    data "pulumiservice_getenvironment" "name" {
        # arguments
    }

    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.
    organization_name string
    The Pulumi Cloud organization that owns the environment.
    project_name 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. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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 string
    The environment's UUID. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    name string
    The environment name.
    organization_name string
    The Pulumi Cloud organization that owns the environment.
    project_name string
    The ESC project the environment lives in.
    environmentId String
    The environment's UUID. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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. Pass it to buildEnvironmentScopedPermissions (preferred) or use it as the identity field of a hand-rolled PermissionLiteralExpressionEnvironment in OrganizationRole.permissions.
    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.40.0
    published on Monday, May 11, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.