1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. adb
  5. getResourceGroups
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.adb.getResourceGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides Adb Resource Group available to the user.What is Resource Group

    NOTE: Available since v1.195.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.adb.getResourceGroups({
        dbClusterId: "am-bp1a16357gty69185",
        groupName: "TESTOPENAPI",
    });
    export const alicloudAdbResourceGroupExampleId = _default.then(_default => _default.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.adb.get_resource_groups(db_cluster_id="am-bp1a16357gty69185",
        group_name="TESTOPENAPI")
    pulumi.export("alicloudAdbResourceGroupExampleId", default.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/adb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := adb.GetResourceGroups(ctx, &adb.GetResourceGroupsArgs{
    			DbClusterId: "am-bp1a16357gty69185",
    			GroupName:   pulumi.StringRef("TESTOPENAPI"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudAdbResourceGroupExampleId", _default.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Adb.GetResourceGroups.Invoke(new()
        {
            DbClusterId = "am-bp1a16357gty69185",
            GroupName = "TESTOPENAPI",
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudAdbResourceGroupExampleId"] = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Groups[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.adb.AdbFunctions;
    import com.pulumi.alicloud.adb.inputs.GetResourceGroupsArgs;
    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 default = AdbFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
                .dbClusterId("am-bp1a16357gty69185")
                .groupName("TESTOPENAPI")
                .build());
    
            ctx.export("alicloudAdbResourceGroupExampleId", default_.groups()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:adb:getResourceGroups
          Arguments:
            dbClusterId: am-bp1a16357gty69185
            groupName: TESTOPENAPI
    outputs:
      alicloudAdbResourceGroupExampleId: ${default.groups[0].id}
    

    Using getResourceGroups

    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 getResourceGroups(args: GetResourceGroupsArgs, opts?: InvokeOptions): Promise<GetResourceGroupsResult>
    function getResourceGroupsOutput(args: GetResourceGroupsOutputArgs, opts?: InvokeOptions): Output<GetResourceGroupsResult>
    def get_resource_groups(db_cluster_id: Optional[str] = None,
                            group_name: Optional[str] = None,
                            ids: Optional[Sequence[str]] = None,
                            output_file: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetResourceGroupsResult
    def get_resource_groups_output(db_cluster_id: Optional[pulumi.Input[str]] = None,
                            group_name: Optional[pulumi.Input[str]] = None,
                            ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetResourceGroupsResult]
    func GetResourceGroups(ctx *Context, args *GetResourceGroupsArgs, opts ...InvokeOption) (*GetResourceGroupsResult, error)
    func GetResourceGroupsOutput(ctx *Context, args *GetResourceGroupsOutputArgs, opts ...InvokeOption) GetResourceGroupsResultOutput

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

    public static class GetResourceGroups 
    {
        public static Task<GetResourceGroupsResult> InvokeAsync(GetResourceGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetResourceGroupsResult> Invoke(GetResourceGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourceGroupsResult> getResourceGroups(GetResourceGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:adb/getResourceGroups:getResourceGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DbClusterId string
    DBClusterId
    GroupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    Ids List<string>
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    DbClusterId string
    DBClusterId
    GroupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    Ids []string
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    dbClusterId String
    DBClusterId
    groupName String
    The name of the resource pool, which cannot exceed 64 bytes in length.
    ids List<String>
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    dbClusterId string
    DBClusterId
    groupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    ids string[]
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    db_cluster_id str
    DBClusterId
    group_name str
    The name of the resource pool, which cannot exceed 64 bytes in length.
    ids Sequence[str]
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    dbClusterId String
    DBClusterId
    groupName String
    The name of the resource pool, which cannot exceed 64 bytes in length.
    ids List<String>
    A list of AnalyticDB for MySQL (ADB) Resource Group IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getResourceGroups Result

    The following output properties are available:

    DbClusterId string
    DB cluster id.
    Groups List<Pulumi.AliCloud.Adb.Outputs.GetResourceGroupsGroup>
    A list of Resource Group Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    GroupName string
    The name of the resource pool.
    OutputFile string
    DbClusterId string
    DB cluster id.
    Groups []GetResourceGroupsGroup
    A list of Resource Group Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    GroupName string
    The name of the resource pool.
    OutputFile string
    dbClusterId String
    DB cluster id.
    groups List<GetResourceGroupsGroup>
    A list of Resource Group Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    groupName String
    The name of the resource pool.
    outputFile String
    dbClusterId string
    DB cluster id.
    groups GetResourceGroupsGroup[]
    A list of Resource Group Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    groupName string
    The name of the resource pool.
    outputFile string
    db_cluster_id str
    DB cluster id.
    groups Sequence[GetResourceGroupsGroup]
    A list of Resource Group Entries. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    group_name str
    The name of the resource pool.
    output_file str
    dbClusterId String
    DB cluster id.
    groups List<Property Map>
    A list of Resource Group Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    groupName String
    The name of the resource pool.
    outputFile String

    Supporting Types

    GetResourceGroupsGroup

    CreateTime string
    Creation time.
    DbClusterId string
    DBClusterId
    GroupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    GroupType string
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    Id string
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    NodeNum int
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    User string
    Binding User.
    CreateTime string
    Creation time.
    DbClusterId string
    DBClusterId
    GroupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    GroupType string
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    Id string
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    NodeNum int
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    User string
    Binding User.
    createTime String
    Creation time.
    dbClusterId String
    DBClusterId
    groupName String
    The name of the resource pool, which cannot exceed 64 bytes in length.
    groupType String
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    id String
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    nodeNum Integer
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    user String
    Binding User.
    createTime string
    Creation time.
    dbClusterId string
    DBClusterId
    groupName string
    The name of the resource pool, which cannot exceed 64 bytes in length.
    groupType string
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    id string
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    nodeNum number
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    user string
    Binding User.
    create_time str
    Creation time.
    db_cluster_id str
    DBClusterId
    group_name str
    The name of the resource pool, which cannot exceed 64 bytes in length.
    group_type str
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    id str
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    node_num int
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    user str
    Binding User.
    createTime String
    Creation time.
    dbClusterId String
    DBClusterId
    groupName String
    The name of the resource pool, which cannot exceed 64 bytes in length.
    groupType String
    Query type, value description:

    • etl: Batch query mode.
    • interactive: interactive Query mode
    • default_type: the default query mode.
    id String
    The key of the resource supplied above.The value is formulated as <db_cluster_id>:<group_name>.
    nodeNum Number
    The number of nodes. The default number of nodes is 0. The number of nodes must be less than or equal to the number of nodes whose resource name is USER_DEFAULT.
    user String
    Binding User.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi