1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getComputeHostGroups
Oracle Cloud Infrastructure v3.3.0 published on Thursday, Jul 17, 2025 by Pulumi

oci.Core.getComputeHostGroups

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v3.3.0 published on Thursday, Jul 17, 2025 by Pulumi

    This data source provides the list of Compute Host Groups in Oracle Cloud Infrastructure Core service.

    Lists the compute host groups that match the specified criteria and compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testComputeHostGroups = oci.Core.getComputeHostGroups({
        compartmentId: compartmentId,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_compute_host_groups = oci.Core.get_compute_host_groups(compartment_id=compartment_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := core.GetComputeHostGroups(ctx, &core.GetComputeHostGroupsArgs{
    			CompartmentId: compartmentId,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testComputeHostGroups = Oci.Core.GetComputeHostGroups.Invoke(new()
        {
            CompartmentId = compartmentId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.CoreFunctions;
    import com.pulumi.oci.Core.inputs.GetComputeHostGroupsArgs;
    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 testComputeHostGroups = CoreFunctions.getComputeHostGroups(GetComputeHostGroupsArgs.builder()
                .compartmentId(compartmentId)
                .build());
    
        }
    }
    
    variables:
      testComputeHostGroups:
        fn::invoke:
          function: oci:Core:getComputeHostGroups
          arguments:
            compartmentId: ${compartmentId}
    

    Using getComputeHostGroups

    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 getComputeHostGroups(args: GetComputeHostGroupsArgs, opts?: InvokeOptions): Promise<GetComputeHostGroupsResult>
    function getComputeHostGroupsOutput(args: GetComputeHostGroupsOutputArgs, opts?: InvokeOptions): Output<GetComputeHostGroupsResult>
    def get_compute_host_groups(compartment_id: Optional[str] = None,
                                filters: Optional[Sequence[GetComputeHostGroupsFilter]] = None,
                                opts: Optional[InvokeOptions] = None) -> GetComputeHostGroupsResult
    def get_compute_host_groups_output(compartment_id: Optional[pulumi.Input[str]] = None,
                                filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetComputeHostGroupsFilterArgs]]]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetComputeHostGroupsResult]
    func GetComputeHostGroups(ctx *Context, args *GetComputeHostGroupsArgs, opts ...InvokeOption) (*GetComputeHostGroupsResult, error)
    func GetComputeHostGroupsOutput(ctx *Context, args *GetComputeHostGroupsOutputArgs, opts ...InvokeOption) GetComputeHostGroupsResultOutput

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

    public static class GetComputeHostGroups 
    {
        public static Task<GetComputeHostGroupsResult> InvokeAsync(GetComputeHostGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetComputeHostGroupsResult> Invoke(GetComputeHostGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetComputeHostGroupsResult> getComputeHostGroups(GetComputeHostGroupsArgs args, InvokeOptions options)
    public static Output<GetComputeHostGroupsResult> getComputeHostGroups(GetComputeHostGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:Core/getComputeHostGroups:getComputeHostGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    compartmentId String
    The OCID of the compartment.
    filters List<Property Map>

    getComputeHostGroups Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment that contains host group.
    ComputeHostGroupCollections List<GetComputeHostGroupsComputeHostGroupCollection>
    The list of compute_host_group_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters List<GetComputeHostGroupsFilter>
    CompartmentId string
    The OCID of the compartment that contains host group.
    ComputeHostGroupCollections []GetComputeHostGroupsComputeHostGroupCollection
    The list of compute_host_group_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    Filters []GetComputeHostGroupsFilter
    compartmentId String
    The OCID of the compartment that contains host group.
    computeHostGroupCollections List<GetComputeHostGroupsComputeHostGroupCollection>
    The list of compute_host_group_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<GetComputeHostGroupsFilter>
    compartmentId string
    The OCID of the compartment that contains host group.
    computeHostGroupCollections GetComputeHostGroupsComputeHostGroupCollection[]
    The list of compute_host_group_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    filters GetComputeHostGroupsFilter[]
    compartment_id str
    The OCID of the compartment that contains host group.
    compute_host_group_collections Sequence[GetComputeHostGroupsComputeHostGroupCollection]
    The list of compute_host_group_collection.
    id str
    The provider-assigned unique ID for this managed resource.
    filters Sequence[GetComputeHostGroupsFilter]
    compartmentId String
    The OCID of the compartment that contains host group.
    computeHostGroupCollections List<Property Map>
    The list of compute_host_group_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    filters List<Property Map>

    Supporting Types

    GetComputeHostGroupsComputeHostGroupCollection

    GetComputeHostGroupsComputeHostGroupCollectionItem

    AvailabilityDomain string
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    CompartmentId string
    The OCID of the compartment.
    Configurations List<GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration>
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID for the Customer-unique host group
    IsTargetedPlacementRequired bool
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    State string
    The lifecycle state of the host group
    SystemTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    TimeCreated string
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    AvailabilityDomain string
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    CompartmentId string
    The OCID of the compartment.
    Configurations []GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID for the Customer-unique host group
    IsTargetedPlacementRequired bool
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    State string
    The lifecycle state of the host group
    SystemTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    TimeCreated string
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    availabilityDomain String
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    compartmentId String
    The OCID of the compartment.
    configurations List<GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration>
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID for the Customer-unique host group
    isTargetedPlacementRequired Boolean
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    state String
    The lifecycle state of the host group
    systemTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    timeCreated String
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    availabilityDomain string
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    compartmentId string
    The OCID of the compartment.
    configurations GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration[]
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID for the Customer-unique host group
    isTargetedPlacementRequired boolean
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    state string
    The lifecycle state of the host group
    systemTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    timeCreated string
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated string
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    availability_domain str
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    compartment_id str
    The OCID of the compartment.
    configurations Sequence[GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration]
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID for the Customer-unique host group
    is_targeted_placement_required bool
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    state str
    The lifecycle state of the host group
    system_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    time_created str
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_updated str
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    availabilityDomain String
    The availability domain of a host group. Example: Uocm:PHX-AD-1
    compartmentId String
    The OCID of the compartment.
    configurations List<Property Map>
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID for the Customer-unique host group
    isTargetedPlacementRequired Boolean
    A flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
    state String
    The lifecycle state of the host group
    systemTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    timeCreated String
    The date and time the host group was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the host group was updated, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

    GetComputeHostGroupsComputeHostGroupCollectionItemConfiguration

    GetComputeHostGroupsFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values 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.
    oci logo
    Oracle Cloud Infrastructure v3.3.0 published on Thursday, Jul 17, 2025 by Pulumi