1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. CloudBridge
  5. getEnvironments
Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi

oci.CloudBridge.getEnvironments

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi

This data source provides the list of Environments in Oracle Cloud Infrastructure Cloud Bridge service.

Returns a list of source environments.

Example Usage

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

const testEnvironments = oci.CloudBridge.getEnvironments({
    compartmentId: compartmentId,
    displayName: environmentDisplayName,
    environmentId: testEnvironment.id,
    state: environmentState,
});
Copy
import pulumi
import pulumi_oci as oci

test_environments = oci.CloudBridge.get_environments(compartment_id=compartment_id,
    display_name=environment_display_name,
    environment_id=test_environment["id"],
    state=environment_state)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/cloudbridge"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudbridge.GetEnvironments(ctx, &cloudbridge.GetEnvironmentsArgs{
			CompartmentId: compartmentId,
			DisplayName:   pulumi.StringRef(environmentDisplayName),
			EnvironmentId: pulumi.StringRef(testEnvironment.Id),
			State:         pulumi.StringRef(environmentState),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testEnvironments = Oci.CloudBridge.GetEnvironments.Invoke(new()
    {
        CompartmentId = compartmentId,
        DisplayName = environmentDisplayName,
        EnvironmentId = testEnvironment.Id,
        State = environmentState,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.CloudBridge.CloudBridgeFunctions;
import com.pulumi.oci.CloudBridge.inputs.GetEnvironmentsArgs;
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 testEnvironments = CloudBridgeFunctions.getEnvironments(GetEnvironmentsArgs.builder()
            .compartmentId(compartmentId)
            .displayName(environmentDisplayName)
            .environmentId(testEnvironment.id())
            .state(environmentState)
            .build());

    }
}
Copy
variables:
  testEnvironments:
    fn::invoke:
      function: oci:CloudBridge:getEnvironments
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${environmentDisplayName}
        environmentId: ${testEnvironment.id}
        state: ${environmentState}
Copy

Using getEnvironments

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 getEnvironments(args: GetEnvironmentsArgs, opts?: InvokeOptions): Promise<GetEnvironmentsResult>
function getEnvironmentsOutput(args: GetEnvironmentsOutputArgs, opts?: InvokeOptions): Output<GetEnvironmentsResult>
Copy
def get_environments(compartment_id: Optional[str] = None,
                     display_name: Optional[str] = None,
                     environment_id: Optional[str] = None,
                     filters: Optional[Sequence[_cloudbridge.GetEnvironmentsFilter]] = None,
                     state: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetEnvironmentsResult
def get_environments_output(compartment_id: Optional[pulumi.Input[str]] = None,
                     display_name: Optional[pulumi.Input[str]] = None,
                     environment_id: Optional[pulumi.Input[str]] = None,
                     filters: Optional[pulumi.Input[Sequence[pulumi.Input[_cloudbridge.GetEnvironmentsFilterArgs]]]] = None,
                     state: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetEnvironmentsResult]
Copy
func GetEnvironments(ctx *Context, args *GetEnvironmentsArgs, opts ...InvokeOption) (*GetEnvironmentsResult, error)
func GetEnvironmentsOutput(ctx *Context, args *GetEnvironmentsOutputArgs, opts ...InvokeOption) GetEnvironmentsResultOutput
Copy

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

public static class GetEnvironments 
{
    public static Task<GetEnvironmentsResult> InvokeAsync(GetEnvironmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetEnvironmentsResult> Invoke(GetEnvironmentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetEnvironmentsResult> getEnvironments(GetEnvironmentsArgs args, InvokeOptions options)
public static Output<GetEnvironmentsResult> getEnvironments(GetEnvironmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:CloudBridge/getEnvironments:getEnvironments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DisplayName string
A filter to return only resources that match the entire display name given.
EnvironmentId string
A filter to return only resources that match the given environment ID.
Filters Changes to this property will trigger replacement. List<GetEnvironmentsFilter>
State string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DisplayName string
A filter to return only resources that match the entire display name given.
EnvironmentId string
A filter to return only resources that match the given environment ID.
Filters Changes to this property will trigger replacement. []GetEnvironmentsFilter
State string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
displayName String
A filter to return only resources that match the entire display name given.
environmentId String
A filter to return only resources that match the given environment ID.
filters Changes to this property will trigger replacement. List<GetEnvironmentsFilter>
state String
A filter to return only resources where their lifecycleState matches the given lifecycleState.
compartmentId This property is required. string
The ID of the compartment in which to list resources.
displayName string
A filter to return only resources that match the entire display name given.
environmentId string
A filter to return only resources that match the given environment ID.
filters Changes to this property will trigger replacement. GetEnvironmentsFilter[]
state string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
compartment_id This property is required. str
The ID of the compartment in which to list resources.
display_name str
A filter to return only resources that match the entire display name given.
environment_id str
A filter to return only resources that match the given environment ID.
filters Changes to this property will trigger replacement. Sequence[cloudbridge.GetEnvironmentsFilter]
state str
A filter to return only resources where their lifecycleState matches the given lifecycleState.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
displayName String
A filter to return only resources that match the entire display name given.
environmentId String
A filter to return only resources that match the given environment ID.
filters Changes to this property will trigger replacement. List<Property Map>
state String
A filter to return only resources where their lifecycleState matches the given lifecycleState.

getEnvironments Result

The following output properties are available:

CompartmentId string
Compartment identifier.
EnvironmentCollections List<GetEnvironmentsEnvironmentCollection>
The list of environment_collection.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
Environment identifier, which can be renamed.
EnvironmentId string
Filters List<GetEnvironmentsFilter>
State string
The current state of the source environment.
CompartmentId string
Compartment identifier.
EnvironmentCollections []GetEnvironmentsEnvironmentCollection
The list of environment_collection.
Id string
The provider-assigned unique ID for this managed resource.
DisplayName string
Environment identifier, which can be renamed.
EnvironmentId string
Filters []GetEnvironmentsFilter
State string
The current state of the source environment.
compartmentId String
Compartment identifier.
environmentCollections List<GetEnvironmentsEnvironmentCollection>
The list of environment_collection.
id String
The provider-assigned unique ID for this managed resource.
displayName String
Environment identifier, which can be renamed.
environmentId String
filters List<GetEnvironmentsFilter>
state String
The current state of the source environment.
compartmentId string
Compartment identifier.
environmentCollections GetEnvironmentsEnvironmentCollection[]
The list of environment_collection.
id string
The provider-assigned unique ID for this managed resource.
displayName string
Environment identifier, which can be renamed.
environmentId string
filters GetEnvironmentsFilter[]
state string
The current state of the source environment.
compartment_id str
Compartment identifier.
environment_collections Sequence[cloudbridge.GetEnvironmentsEnvironmentCollection]
The list of environment_collection.
id str
The provider-assigned unique ID for this managed resource.
display_name str
Environment identifier, which can be renamed.
environment_id str
filters Sequence[cloudbridge.GetEnvironmentsFilter]
state str
The current state of the source environment.
compartmentId String
Compartment identifier.
environmentCollections List<Property Map>
The list of environment_collection.
id String
The provider-assigned unique ID for this managed resource.
displayName String
Environment identifier, which can be renamed.
environmentId String
filters List<Property Map>
state String
The current state of the source environment.

Supporting Types

GetEnvironmentsEnvironmentCollection

items This property is required. List<Property Map>

GetEnvironmentsEnvironmentCollectionItem

CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DefinedTags This property is required. Dictionary<string, string>
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName This property is required. string
A filter to return only resources that match the entire display name given.
FreeformTags This property is required. Dictionary<string, string>
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
Unique identifier that is immutable on creation.
LifecycleDetails This property is required. string
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
State This property is required. string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
SystemTags This property is required. Dictionary<string, string>
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
TimeCreated This property is required. string
The time when the source environment was created. An RFC3339 formatted datetime string.
TimeUpdated This property is required. string
The time when the source environment was updated. An RFC3339 formatted datetime string.
CompartmentId This property is required. string
The ID of the compartment in which to list resources.
DefinedTags This property is required. map[string]string
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName This property is required. string
A filter to return only resources that match the entire display name given.
FreeformTags This property is required. map[string]string
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
Id This property is required. string
Unique identifier that is immutable on creation.
LifecycleDetails This property is required. string
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
State This property is required. string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
SystemTags This property is required. map[string]string
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
TimeCreated This property is required. string
The time when the source environment was created. An RFC3339 formatted datetime string.
TimeUpdated This property is required. string
The time when the source environment was updated. An RFC3339 formatted datetime string.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
definedTags This property is required. Map<String,String>
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. String
A filter to return only resources that match the entire display name given.
freeformTags This property is required. Map<String,String>
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
Unique identifier that is immutable on creation.
lifecycleDetails This property is required. String
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
state This property is required. String
A filter to return only resources where their lifecycleState matches the given lifecycleState.
systemTags This property is required. Map<String,String>
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
timeCreated This property is required. String
The time when the source environment was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. String
The time when the source environment was updated. An RFC3339 formatted datetime string.
compartmentId This property is required. string
The ID of the compartment in which to list resources.
definedTags This property is required. {[key: string]: string}
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. string
A filter to return only resources that match the entire display name given.
freeformTags This property is required. {[key: string]: string}
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. string
Unique identifier that is immutable on creation.
lifecycleDetails This property is required. string
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
state This property is required. string
A filter to return only resources where their lifecycleState matches the given lifecycleState.
systemTags This property is required. {[key: string]: string}
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
timeCreated This property is required. string
The time when the source environment was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. string
The time when the source environment was updated. An RFC3339 formatted datetime string.
compartment_id This property is required. str
The ID of the compartment in which to list resources.
defined_tags This property is required. Mapping[str, str]
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name This property is required. str
A filter to return only resources that match the entire display name given.
freeform_tags This property is required. Mapping[str, str]
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. str
Unique identifier that is immutable on creation.
lifecycle_details This property is required. str
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
state This property is required. str
A filter to return only resources where their lifecycleState matches the given lifecycleState.
system_tags This property is required. Mapping[str, str]
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
time_created This property is required. str
The time when the source environment was created. An RFC3339 formatted datetime string.
time_updated This property is required. str
The time when the source environment was updated. An RFC3339 formatted datetime string.
compartmentId This property is required. String
The ID of the compartment in which to list resources.
definedTags This property is required. Map<String>
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName This property is required. String
A filter to return only resources that match the entire display name given.
freeformTags This property is required. Map<String>
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace/scope. For more information, see Resource Tags. Example: {"Department": "Finance"}
id This property is required. String
Unique identifier that is immutable on creation.
lifecycleDetails This property is required. String
A message describing the current state in more detail. For example, it can be used to provide actionable information for a resource in Failed state.
state This property is required. String
A filter to return only resources where their lifecycleState matches the given lifecycleState.
systemTags This property is required. Map<String>
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
timeCreated This property is required. String
The time when the source environment was created. An RFC3339 formatted datetime string.
timeUpdated This property is required. String
The time when the source environment was updated. An RFC3339 formatted datetime string.

GetEnvironmentsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi