alicloud.bastionhost.getHostAccounts
This data source provides the Bastionhost Host Accounts of the current Alibaba Cloud user.
NOTE: Available in v1.135.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.BastionHost.GetHostAccounts.Invoke(new()
{
HostId = "15",
InstanceId = "example_value",
Ids = new[]
{
"1",
"2",
},
});
var nameRegex = AliCloud.BastionHost.GetHostAccounts.Invoke(new()
{
HostId = "15",
InstanceId = "example_value",
NameRegex = "^my-HostAccount",
});
return new Dictionary<string, object?>
{
["bastionhostHostAccountId1"] = ids.Apply(getHostAccountsResult => getHostAccountsResult.Accounts[0]?.Id),
["bastionhostHostAccountId2"] = nameRegex.Apply(getHostAccountsResult => getHostAccountsResult.Accounts[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/bastionhost"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := bastionhost.GetHostAccounts(ctx, &bastionhost.GetHostAccountsArgs{
HostId: "15",
InstanceId: "example_value",
Ids: []string{
"1",
"2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostHostAccountId1", ids.Accounts[0].Id)
nameRegex, err := bastionhost.GetHostAccounts(ctx, &bastionhost.GetHostAccountsArgs{
HostId: "15",
InstanceId: "example_value",
NameRegex: pulumi.StringRef("^my-HostAccount"),
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostHostAccountId2", nameRegex.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.bastionhost.BastionhostFunctions;
import com.pulumi.alicloud.bastionhost.inputs.GetHostAccountsArgs;
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 = BastionhostFunctions.getHostAccounts(GetHostAccountsArgs.builder()
.hostId("15")
.instanceId("example_value")
.ids(
"1",
"2")
.build());
ctx.export("bastionhostHostAccountId1", ids.applyValue(getHostAccountsResult -> getHostAccountsResult.accounts()[0].id()));
final var nameRegex = BastionhostFunctions.getHostAccounts(GetHostAccountsArgs.builder()
.hostId("15")
.instanceId("example_value")
.nameRegex("^my-HostAccount")
.build());
ctx.export("bastionhostHostAccountId2", nameRegex.applyValue(getHostAccountsResult -> getHostAccountsResult.accounts()[0].id()));
}
}
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.bastionhost.get_host_accounts(host_id="15",
instance_id="example_value",
ids=[
"1",
"2",
])
pulumi.export("bastionhostHostAccountId1", ids.accounts[0].id)
name_regex = alicloud.bastionhost.get_host_accounts(host_id="15",
instance_id="example_value",
name_regex="^my-HostAccount")
pulumi.export("bastionhostHostAccountId2", name_regex.accounts[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.bastionhost.getHostAccounts({
hostId: "15",
instanceId: "example_value",
ids: [
"1",
"2",
],
});
export const bastionhostHostAccountId1 = ids.then(ids => ids.accounts?.[0]?.id);
const nameRegex = alicloud.bastionhost.getHostAccounts({
hostId: "15",
instanceId: "example_value",
nameRegex: "^my-HostAccount",
});
export const bastionhostHostAccountId2 = nameRegex.then(nameRegex => nameRegex.accounts?.[0]?.id);
variables:
ids:
fn::invoke:
Function: alicloud:bastionhost:getHostAccounts
Arguments:
hostId: '15'
instanceId: example_value
ids:
- '1'
- '2'
nameRegex:
fn::invoke:
Function: alicloud:bastionhost:getHostAccounts
Arguments:
hostId: '15'
instanceId: example_value
nameRegex: ^my-HostAccount
outputs:
bastionhostHostAccountId1: ${ids.accounts[0].id}
bastionhostHostAccountId2: ${nameRegex.accounts[0].id}
Using getHostAccounts
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 getHostAccounts(args: GetHostAccountsArgs, opts?: InvokeOptions): Promise<GetHostAccountsResult>
function getHostAccountsOutput(args: GetHostAccountsOutputArgs, opts?: InvokeOptions): Output<GetHostAccountsResult>
def get_host_accounts(host_account_name: Optional[str] = None,
host_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
protocol_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetHostAccountsResult
def get_host_accounts_output(host_account_name: Optional[pulumi.Input[str]] = None,
host_id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
protocol_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetHostAccountsResult]
func GetHostAccounts(ctx *Context, args *GetHostAccountsArgs, opts ...InvokeOption) (*GetHostAccountsResult, error)
func GetHostAccountsOutput(ctx *Context, args *GetHostAccountsOutputArgs, opts ...InvokeOption) GetHostAccountsResultOutput
> Note: This function is named GetHostAccounts
in the Go SDK.
public static class GetHostAccounts
{
public static Task<GetHostAccountsResult> InvokeAsync(GetHostAccountsArgs args, InvokeOptions? opts = null)
public static Output<GetHostAccountsResult> Invoke(GetHostAccountsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetHostAccountsResult> getHostAccounts(GetHostAccountsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:bastionhost/getHostAccounts:getHostAccounts
arguments:
# arguments dictionary
The following arguments are supported:
- Host
Id string Specifies the database where you want to create your hosting account's host ID.
- Instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- Host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- Ids List<string>
A list of Host Account IDs.
- Name
Regex string A regex string to filter results by Host Account name.
- Output
File string - Protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- Host
Id string Specifies the database where you want to create your hosting account's host ID.
- Instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- Host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- Ids []string
A list of Host Account IDs.
- Name
Regex string A regex string to filter results by Host Account name.
- Output
File string - Protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- host
Id String Specifies the database where you want to create your hosting account's host ID.
- instance
Id String Specifies the database where you want to create your hosting account's host bastion host ID of.
- host
Account StringName Specify the new hosting account's name, support the longest 128 characters.
- ids List<String>
A list of Host Account IDs.
- name
Regex String A regex string to filter results by Host Account name.
- output
File String - protocol
Name String Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- host
Id string Specifies the database where you want to create your hosting account's host ID.
- instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- ids string[]
A list of Host Account IDs.
- name
Regex string A regex string to filter results by Host Account name.
- output
File string - protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- host_
id str Specifies the database where you want to create your hosting account's host ID.
- instance_
id str Specifies the database where you want to create your hosting account's host bastion host ID of.
- host_
account_ strname Specify the new hosting account's name, support the longest 128 characters.
- ids Sequence[str]
A list of Host Account IDs.
- name_
regex str A regex string to filter results by Host Account name.
- output_
file str - protocol_
name str Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- host
Id String Specifies the database where you want to create your hosting account's host ID.
- instance
Id String Specifies the database where you want to create your hosting account's host bastion host ID of.
- host
Account StringName Specify the new hosting account's name, support the longest 128 characters.
- ids List<String>
A list of Host Account IDs.
- name
Regex String A regex string to filter results by Host Account name.
- output
File String - protocol
Name String Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
getHostAccounts Result
The following output properties are available:
- Accounts
List<Pulumi.
Ali Cloud. Bastion Host. Outputs. Get Host Accounts Account> - Host
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Instance
Id string - Names List<string>
- Host
Account stringName - Name
Regex string - Output
File string - Protocol
Name string
- Accounts
[]Get
Host Accounts Account - Host
Id string - Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
- Instance
Id string - Names []string
- Host
Account stringName - Name
Regex string - Output
File string - Protocol
Name string
- accounts
List<Get
Host Accounts Account> - host
Id String - id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - names List<String>
- host
Account StringName - name
Regex String - output
File String - protocol
Name String
- accounts
Get
Host Accounts Account[] - host
Id string - id string
The provider-assigned unique ID for this managed resource.
- ids string[]
- instance
Id string - names string[]
- host
Account stringName - name
Regex string - output
File string - protocol
Name string
- accounts
Sequence[Get
Host Accounts Account] - host_
id str - id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instance_
id str - names Sequence[str]
- host_
account_ strname - name_
regex str - output_
file str - protocol_
name str
- accounts List<Property Map>
- host
Id String - id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - names List<String>
- host
Account StringName - name
Regex String - output
File String - protocol
Name String
Supporting Types
GetHostAccountsAccount
- Has
Password bool Whether to set a new password.
- Host
Account stringId Hosting account ID.
- Host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- Host
Id string Specifies the database where you want to create your hosting account's host ID.
- Id string
The ID of the Host Account.
- Instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- Private
Key stringFingerprint The situation where the private keys of the fingerprint information.
- Protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- Has
Password bool Whether to set a new password.
- Host
Account stringId Hosting account ID.
- Host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- Host
Id string Specifies the database where you want to create your hosting account's host ID.
- Id string
The ID of the Host Account.
- Instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- Private
Key stringFingerprint The situation where the private keys of the fingerprint information.
- Protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- has
Password Boolean Whether to set a new password.
- host
Account StringId Hosting account ID.
- host
Account StringName Specify the new hosting account's name, support the longest 128 characters.
- host
Id String Specifies the database where you want to create your hosting account's host ID.
- id String
The ID of the Host Account.
- instance
Id String Specifies the database where you want to create your hosting account's host bastion host ID of.
- private
Key StringFingerprint The situation where the private keys of the fingerprint information.
- protocol
Name String Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- has
Password boolean Whether to set a new password.
- host
Account stringId Hosting account ID.
- host
Account stringName Specify the new hosting account's name, support the longest 128 characters.
- host
Id string Specifies the database where you want to create your hosting account's host ID.
- id string
The ID of the Host Account.
- instance
Id string Specifies the database where you want to create your hosting account's host bastion host ID of.
- private
Key stringFingerprint The situation where the private keys of the fingerprint information.
- protocol
Name string Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- has_
password bool Whether to set a new password.
- host_
account_ strid Hosting account ID.
- host_
account_ strname Specify the new hosting account's name, support the longest 128 characters.
- host_
id str Specifies the database where you want to create your hosting account's host ID.
- id str
The ID of the Host Account.
- instance_
id str Specifies the database where you want to create your hosting account's host bastion host ID of.
- private_
key_ strfingerprint The situation where the private keys of the fingerprint information.
- protocol_
name str Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
- has
Password Boolean Whether to set a new password.
- host
Account StringId Hosting account ID.
- host
Account StringName Specify the new hosting account's name, support the longest 128 characters.
- host
Id String Specifies the database where you want to create your hosting account's host ID.
- id String
The ID of the Host Account.
- instance
Id String Specifies the database where you want to create your hosting account's host bastion host ID of.
- private
Key StringFingerprint The situation where the private keys of the fingerprint information.
- protocol
Name String Specify the new hosting account of the agreement name. Valid values: USING SSH and RDP.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.