Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.bastionhost.getHostShareKeys
Explore with Pulumi AI
This data source provides the Bastionhost Host Share Keys of the current Alibaba Cloud user.
NOTE: Available in v1.165.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.bastionhost.getHostShareKeys({
instanceId: "example_value",
ids: [
"example_value-1",
"example_value-2",
],
});
export const bastionhostHostShareKeyId1 = ids.then(ids => ids.keys?.[0]?.id);
const nameRegex = alicloud.bastionhost.getHostShareKeys({
instanceId: "example_value",
nameRegex: "^my-HostShareKey",
});
export const bastionhostHostShareKeyId2 = nameRegex.then(nameRegex => nameRegex.keys?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.bastionhost.get_host_share_keys(instance_id="example_value",
ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("bastionhostHostShareKeyId1", ids.keys[0].id)
name_regex = alicloud.bastionhost.get_host_share_keys(instance_id="example_value",
name_regex="^my-HostShareKey")
pulumi.export("bastionhostHostShareKeyId2", name_regex.keys[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.GetHostShareKeys(ctx, &bastionhost.GetHostShareKeysArgs{
InstanceId: "example_value",
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostHostShareKeyId1", ids.Keys[0].Id)
nameRegex, err := bastionhost.GetHostShareKeys(ctx, &bastionhost.GetHostShareKeysArgs{
InstanceId: "example_value",
NameRegex: pulumi.StringRef("^my-HostShareKey"),
}, nil)
if err != nil {
return err
}
ctx.Export("bastionhostHostShareKeyId2", nameRegex.Keys[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
{
InstanceId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.BastionHost.GetHostShareKeys.Invoke(new()
{
InstanceId = "example_value",
NameRegex = "^my-HostShareKey",
});
return new Dictionary<string, object?>
{
["bastionhostHostShareKeyId1"] = ids.Apply(getHostShareKeysResult => getHostShareKeysResult.Keys[0]?.Id),
["bastionhostHostShareKeyId2"] = nameRegex.Apply(getHostShareKeysResult => getHostShareKeysResult.Keys[0]?.Id),
};
});
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.GetHostShareKeysArgs;
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.getHostShareKeys(GetHostShareKeysArgs.builder()
.instanceId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("bastionhostHostShareKeyId1", ids.applyValue(getHostShareKeysResult -> getHostShareKeysResult.keys()[0].id()));
final var nameRegex = BastionhostFunctions.getHostShareKeys(GetHostShareKeysArgs.builder()
.instanceId("example_value")
.nameRegex("^my-HostShareKey")
.build());
ctx.export("bastionhostHostShareKeyId2", nameRegex.applyValue(getHostShareKeysResult -> getHostShareKeysResult.keys()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:bastionhost:getHostShareKeys
Arguments:
instanceId: example_value
ids:
- example_value-1
- example_value-2
nameRegex:
fn::invoke:
Function: alicloud:bastionhost:getHostShareKeys
Arguments:
instanceId: example_value
nameRegex: ^my-HostShareKey
outputs:
bastionhostHostShareKeyId1: ${ids.keys[0].id}
bastionhostHostShareKeyId2: ${nameRegex.keys[0].id}
Using getHostShareKeys
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 getHostShareKeys(args: GetHostShareKeysArgs, opts?: InvokeOptions): Promise<GetHostShareKeysResult>
function getHostShareKeysOutput(args: GetHostShareKeysOutputArgs, opts?: InvokeOptions): Output<GetHostShareKeysResult>
def get_host_share_keys(enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetHostShareKeysResult
def get_host_share_keys_output(enable_details: Optional[pulumi.Input[bool]] = 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,
opts: Optional[InvokeOptions] = None) -> Output[GetHostShareKeysResult]
func GetHostShareKeys(ctx *Context, args *GetHostShareKeysArgs, opts ...InvokeOption) (*GetHostShareKeysResult, error)
func GetHostShareKeysOutput(ctx *Context, args *GetHostShareKeysOutputArgs, opts ...InvokeOption) GetHostShareKeysResultOutput
> Note: This function is named GetHostShareKeys
in the Go SDK.
public static class GetHostShareKeys
{
public static Task<GetHostShareKeysResult> InvokeAsync(GetHostShareKeysArgs args, InvokeOptions? opts = null)
public static Output<GetHostShareKeysResult> Invoke(GetHostShareKeysInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetHostShareKeysResult> getHostShareKeys(GetHostShareKeysArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:bastionhost/getHostShareKeys:getHostShareKeys
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id string - The ID of the Bastion instance.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of Host Share Key IDs.
- Name
Regex string - A regex string to filter results by Host Share Key name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Id string - The ID of the Bastion instance.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids []string
- A list of Host Share Key IDs.
- Name
Regex string - A regex string to filter results by Host Share Key name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - The ID of the Bastion instance.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Host Share Key IDs.
- name
Regex String - A regex string to filter results by Host Share Key name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Id string - The ID of the Bastion instance.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of Host Share Key IDs.
- name
Regex string - A regex string to filter results by Host Share Key name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
id str - The ID of the Bastion instance.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - ids Sequence[str]
- A list of Host Share Key IDs.
- name_
regex str - A regex string to filter results by Host Share Key name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Id String - The ID of the Bastion instance.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Host Share Key IDs.
- name
Regex String - A regex string to filter results by Host Share Key name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getHostShareKeys Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Instance
Id string - Keys
List<Pulumi.
Ali Cloud. Bastion Host. Outputs. Get Host Share Keys Key> - Names List<string>
- Enable
Details bool - Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Instance
Id string - Keys
[]Get
Host Share Keys Key - Names []string
- Enable
Details bool - Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - keys
List<Get
Host Share Keys Key> - names List<String>
- enable
Details Boolean - name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- instance
Id string - keys
Get
Host Share Keys Key[] - names string[]
- enable
Details boolean - name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- instance_
id str - keys
Sequence[Get
Host Share Keys Key] - names Sequence[str]
- enable_
details bool - name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- instance
Id String - keys List<Property Map>
- names List<String>
- enable
Details Boolean - name
Regex String - output
File String
Supporting Types
GetHostShareKeysKey
- string
- The first ID of the resource.
- string
- The name of the host shared key.
- Id string
- The ID of the Host Share Key.
- Instance
Id string - The ID of the Bastion instance.
- Private
Key stringFinger Print - The fingerprint of the private key.
- string
- The first ID of the resource.
- string
- The name of the host shared key.
- Id string
- The ID of the Host Share Key.
- Instance
Id string - The ID of the Bastion instance.
- Private
Key stringFinger Print - The fingerprint of the private key.
- String
- The first ID of the resource.
- String
- The name of the host shared key.
- id String
- The ID of the Host Share Key.
- instance
Id String - The ID of the Bastion instance.
- private
Key StringFinger Print - The fingerprint of the private key.
- string
- The first ID of the resource.
- string
- The name of the host shared key.
- id string
- The ID of the Host Share Key.
- instance
Id string - The ID of the Bastion instance.
- private
Key stringFinger Print - The fingerprint of the private key.
- str
- The first ID of the resource.
- str
- The name of the host shared key.
- id str
- The ID of the Host Share Key.
- instance_
id str - The ID of the Bastion instance.
- private_
key_ strfinger_ print - The fingerprint of the private key.
- String
- The first ID of the resource.
- String
- The name of the host shared key.
- id String
- The ID of the Host Share Key.
- instance
Id String - The ID of the Bastion instance.
- private
Key StringFinger Print - The fingerprint of the private key.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.