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

alicloud.cddc.getDedicatedHostAccounts

Explore with Pulumi AI

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

    This data source provides the Cddc Dedicated Host Accounts of the current Alibaba Cloud user.

    NOTE: Available in v1.148.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.cddc.getDedicatedHostAccounts({});
    export const cddcDedicatedHostAccountId1 = ids.then(ids => ids.accounts?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.cddc.get_dedicated_host_accounts()
    pulumi.export("cddcDedicatedHostAccountId1", ids.accounts[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cddc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := cddc.GetDedicatedHostAccounts(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("cddcDedicatedHostAccountId1", ids.Accounts[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Cddc.GetDedicatedHostAccounts.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["cddcDedicatedHostAccountId1"] = ids.Apply(getDedicatedHostAccountsResult => getDedicatedHostAccountsResult.Accounts[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cddc.CddcFunctions;
    import com.pulumi.alicloud.cddc.inputs.GetDedicatedHostAccountsArgs;
    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 ids = CddcFunctions.getDedicatedHostAccounts();
    
            ctx.export("cddcDedicatedHostAccountId1", ids.applyValue(getDedicatedHostAccountsResult -> getDedicatedHostAccountsResult.accounts()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:cddc:getDedicatedHostAccounts
          Arguments: {}
    outputs:
      cddcDedicatedHostAccountId1: ${ids.accounts[0].id}
    

    Using getDedicatedHostAccounts

    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 getDedicatedHostAccounts(args: GetDedicatedHostAccountsArgs, opts?: InvokeOptions): Promise<GetDedicatedHostAccountsResult>
    function getDedicatedHostAccountsOutput(args: GetDedicatedHostAccountsOutputArgs, opts?: InvokeOptions): Output<GetDedicatedHostAccountsResult>
    def get_dedicated_host_accounts(dedicated_host_id: Optional[str] = None,
                                    ids: Optional[Sequence[str]] = None,
                                    name_regex: Optional[str] = None,
                                    output_file: Optional[str] = None,
                                    page_number: Optional[int] = None,
                                    page_size: Optional[int] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetDedicatedHostAccountsResult
    def get_dedicated_host_accounts_output(dedicated_host_id: Optional[pulumi.Input[str]] = None,
                                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                    name_regex: Optional[pulumi.Input[str]] = None,
                                    output_file: Optional[pulumi.Input[str]] = None,
                                    page_number: Optional[pulumi.Input[int]] = None,
                                    page_size: Optional[pulumi.Input[int]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetDedicatedHostAccountsResult]
    func GetDedicatedHostAccounts(ctx *Context, args *GetDedicatedHostAccountsArgs, opts ...InvokeOption) (*GetDedicatedHostAccountsResult, error)
    func GetDedicatedHostAccountsOutput(ctx *Context, args *GetDedicatedHostAccountsOutputArgs, opts ...InvokeOption) GetDedicatedHostAccountsResultOutput

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

    public static class GetDedicatedHostAccounts 
    {
        public static Task<GetDedicatedHostAccountsResult> InvokeAsync(GetDedicatedHostAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetDedicatedHostAccountsResult> Invoke(GetDedicatedHostAccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDedicatedHostAccountsResult> getDedicatedHostAccounts(GetDedicatedHostAccountsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cddc/getDedicatedHostAccounts:getDedicatedHostAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DedicatedHostId string
    The ID of the host.
    Ids List<string>
    A list of Dedicated Host Account IDs.
    NameRegex string
    A regex string to filter results by Account name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    DedicatedHostId string
    The ID of the host.
    Ids []string
    A list of Dedicated Host Account IDs.
    NameRegex string
    A regex string to filter results by Account name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    dedicatedHostId String
    The ID of the host.
    ids List<String>
    A list of Dedicated Host Account IDs.
    nameRegex String
    A regex string to filter results by Account name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    dedicatedHostId string
    The ID of the host.
    ids string[]
    A list of Dedicated Host Account IDs.
    nameRegex string
    A regex string to filter results by Account name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    dedicated_host_id str
    The ID of the host.
    ids Sequence[str]
    A list of Dedicated Host Account IDs.
    name_regex str
    A regex string to filter results by Account name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    dedicatedHostId String
    The ID of the host.
    ids List<String>
    A list of Dedicated Host Account IDs.
    nameRegex String
    A regex string to filter results by Account name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number

    getDedicatedHostAccounts Result

    The following output properties are available:

    Accounts List<Pulumi.AliCloud.Cddc.Outputs.GetDedicatedHostAccountsAccount>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    DedicatedHostId string
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    Accounts []GetDedicatedHostAccountsAccount
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    DedicatedHostId string
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    accounts List<GetDedicatedHostAccountsAccount>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    dedicatedHostId String
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    accounts GetDedicatedHostAccountsAccount[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    dedicatedHostId string
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    accounts Sequence[GetDedicatedHostAccountsAccount]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    dedicated_host_id str
    name_regex str
    output_file str
    page_number int
    page_size int
    accounts List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    dedicatedHostId String
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number

    Supporting Types

    GetDedicatedHostAccountsAccount

    AccountName string
    The name of the Dedicated host account.
    DedicatedHostId string
    The ID of the Dedicated host.
    Id string
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.
    AccountName string
    The name of the Dedicated host account.
    DedicatedHostId string
    The ID of the Dedicated host.
    Id string
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.
    accountName String
    The name of the Dedicated host account.
    dedicatedHostId String
    The ID of the Dedicated host.
    id String
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.
    accountName string
    The name of the Dedicated host account.
    dedicatedHostId string
    The ID of the Dedicated host.
    id string
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.
    account_name str
    The name of the Dedicated host account.
    dedicated_host_id str
    The ID of the Dedicated host.
    id str
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.
    accountName String
    The name of the Dedicated host account.
    dedicatedHostId String
    The ID of the Dedicated host.
    id String
    The ID of the Dedicated Host Account. The value formats as <dedicated_host_id>:<account_name>.

    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