Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getDedicatedHostAccounts

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

NOTE: Available in v1.148.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Cddc.GetDedicatedHostAccounts.InvokeAsync());
        this.CddcDedicatedHostAccountId1 = ids.Apply(ids => ids.Accounts?[0]?.Id);
    }

    [Output("cddcDedicatedHostAccountId1")]
    public Output<string> CddcDedicatedHostAccountId1 { get; set; }
}
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
	})
}
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()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.cddc.get_dedicated_host_accounts()
pulumi.export("cddcDedicatedHostAccountId1", ids.accounts[0].id)
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);
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 Dedicated host.

Ids List<string>

A list of Dedicated Host Account IDs.

NameRegex string

A regex string to filter results by Account name.

OutputFile string
PageNumber int
PageSize int
DedicatedHostId string

The ID of the Dedicated host.

Ids []string

A list of Dedicated Host Account IDs.

NameRegex string

A regex string to filter results by Account name.

OutputFile string
PageNumber int
PageSize int
dedicatedHostId String

The ID of the Dedicated host.

ids List<String>

A list of Dedicated Host Account IDs.

nameRegex String

A regex string to filter results by Account name.

outputFile String
pageNumber Integer
pageSize Integer
dedicatedHostId string

The ID of the Dedicated host.

ids string[]

A list of Dedicated Host Account IDs.

nameRegex string

A regex string to filter results by Account name.

outputFile string
pageNumber number
pageSize number
dedicated_host_id str

The ID of the Dedicated 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
page_number int
page_size int
dedicatedHostId String

The ID of the Dedicated host.

ids List<String>

A list of Dedicated Host Account IDs.

nameRegex String

A regex string to filter results by Account name.

outputFile String
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
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.