alicloud.bastionhost.HostShareKey
Provides a Bastion Host Share Key resource.
For information about Bastion Host Host Share Key and how to use it, see What is Host Share Key.
NOTE: Available in v1.165.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var defaultInstances = AliCloud.BastionHost.GetInstances.Invoke();
var defaultHostShareKey = new AliCloud.BastionHost.HostShareKey("defaultHostShareKey", new()
{
HostShareKeyName = "example_name",
InstanceId = defaultInstances.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id),
PassPhrase = "example_value",
PrivateKey = "example_value",
});
});
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 {
defaultInstances, err := bastionhost.GetInstances(ctx, nil, nil)
if err != nil {
return err
}
_, err = bastionhost.NewHostShareKey(ctx, "defaultHostShareKey", &bastionhost.HostShareKeyArgs{
HostShareKeyName: pulumi.String("example_name"),
InstanceId: *pulumi.String(defaultInstances.Instances[0].Id),
PassPhrase: pulumi.String("example_value"),
PrivateKey: pulumi.String("example_value"),
})
if err != nil {
return err
}
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.GetInstancesArgs;
import com.pulumi.alicloud.bastionhost.HostShareKey;
import com.pulumi.alicloud.bastionhost.HostShareKeyArgs;
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 defaultInstances = BastionhostFunctions.getInstances();
var defaultHostShareKey = new HostShareKey("defaultHostShareKey", HostShareKeyArgs.builder()
.hostShareKeyName("example_name")
.instanceId(defaultInstances.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()))
.passPhrase("example_value")
.privateKey("example_value")
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
default_instances = alicloud.bastionhost.get_instances()
default_host_share_key = alicloud.bastionhost.HostShareKey("defaultHostShareKey",
host_share_key_name="example_name",
instance_id=default_instances.instances[0].id,
pass_phrase="example_value",
private_key="example_value")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const defaultInstances = alicloud.bastionhost.getInstances({});
const defaultHostShareKey = new alicloud.bastionhost.HostShareKey("defaultHostShareKey", {
hostShareKeyName: "example_name",
instanceId: defaultInstances.then(defaultInstances => defaultInstances.instances?.[0]?.id),
passPhrase: "example_value",
privateKey: "example_value",
});
resources:
defaultHostShareKey:
type: alicloud:bastionhost:HostShareKey
properties:
hostShareKeyName: example_name
instanceId: ${defaultInstances.instances[0].id}
passPhrase: example_value
privateKey: example_value
variables:
defaultInstances:
fn::invoke:
Function: alicloud:bastionhost:getInstances
Arguments: {}
Create HostShareKey Resource
new HostShareKey(name: string, args: HostShareKeyArgs, opts?: CustomResourceOptions);
@overload
def HostShareKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
host_share_key_name: Optional[str] = None,
instance_id: Optional[str] = None,
pass_phrase: Optional[str] = None,
private_key: Optional[str] = None)
@overload
def HostShareKey(resource_name: str,
args: HostShareKeyArgs,
opts: Optional[ResourceOptions] = None)
func NewHostShareKey(ctx *Context, name string, args HostShareKeyArgs, opts ...ResourceOption) (*HostShareKey, error)
public HostShareKey(string name, HostShareKeyArgs args, CustomResourceOptions? opts = null)
public HostShareKey(String name, HostShareKeyArgs args)
public HostShareKey(String name, HostShareKeyArgs args, CustomResourceOptions options)
type: alicloud:bastionhost:HostShareKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostShareKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args HostShareKeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HostShareKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostShareKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostShareKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
HostShareKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The HostShareKey resource accepts the following input properties:
- string
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- Instance
Id string The ID of the Bastion instance.
- Private
Key string The private key. The value is a Base64-encoded string.
- Pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- string
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- Instance
Id string The ID of the Bastion instance.
- Private
Key string The private key. The value is a Base64-encoded string.
- Pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- String
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- instance
Id String The ID of the Bastion instance.
- private
Key String The private key. The value is a Base64-encoded string.
- pass
Phrase String The password of the private key. The value is a Base64-encoded string.
- string
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- instance
Id string The ID of the Bastion instance.
- private
Key string The private key. The value is a Base64-encoded string.
- pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- str
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- instance_
id str The ID of the Bastion instance.
- private_
key str The private key. The value is a Base64-encoded string.
- pass_
phrase str The password of the private key. The value is a Base64-encoded string.
- String
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- instance
Id String The ID of the Bastion instance.
- private
Key String The private key. The value is a Base64-encoded string.
- pass
Phrase String The password of the private key. The value is a Base64-encoded string.
Outputs
All input properties are implicitly available as output properties. Additionally, the HostShareKey resource produces the following output properties:
- string
The first ID of the resource.
- Id string
The provider-assigned unique ID for this managed resource.
- Private
Key stringFinger Print The fingerprint of the private key.
- string
The first ID of the resource.
- Id string
The provider-assigned unique ID for this managed resource.
- Private
Key stringFinger Print The fingerprint of the private key.
- String
The first ID of the resource.
- id String
The provider-assigned unique ID for this managed resource.
- private
Key StringFinger Print The fingerprint of the private key.
- string
The first ID of the resource.
- id string
The provider-assigned unique ID for this managed resource.
- private
Key stringFinger Print The fingerprint of the private key.
- str
The first ID of the resource.
- id str
The provider-assigned unique ID for this managed resource.
- private_
key_ strfinger_ print The fingerprint of the private key.
- String
The first ID of the resource.
- id String
The provider-assigned unique ID for this managed resource.
- private
Key StringFinger Print The fingerprint of the private key.
Look up Existing HostShareKey Resource
Get an existing HostShareKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: HostShareKeyState, opts?: CustomResourceOptions): HostShareKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
host_share_key_id: Optional[str] = None,
host_share_key_name: Optional[str] = None,
instance_id: Optional[str] = None,
pass_phrase: Optional[str] = None,
private_key: Optional[str] = None,
private_key_finger_print: Optional[str] = None) -> HostShareKey
func GetHostShareKey(ctx *Context, name string, id IDInput, state *HostShareKeyState, opts ...ResourceOption) (*HostShareKey, error)
public static HostShareKey Get(string name, Input<string> id, HostShareKeyState? state, CustomResourceOptions? opts = null)
public static HostShareKey get(String name, Output<String> id, HostShareKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- string
The first ID of the resource.
- string
The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
- Instance
Id string The ID of the Bastion instance.
- Pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- Private
Key string The private key. The value is a Base64-encoded string.
- 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 to be added. The name can be a maximum of 128 characters in length.
- Instance
Id string The ID of the Bastion instance.
- Pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- Private
Key string The private key. The value is a Base64-encoded string.
- 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 to be added. The name can be a maximum of 128 characters in length.
- instance
Id String The ID of the Bastion instance.
- pass
Phrase String The password of the private key. The value is a Base64-encoded string.
- private
Key String The private key. The value is a Base64-encoded string.
- 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 to be added. The name can be a maximum of 128 characters in length.
- instance
Id string The ID of the Bastion instance.
- pass
Phrase string The password of the private key. The value is a Base64-encoded string.
- private
Key string The private key. The value is a Base64-encoded string.
- 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 to be added. The name can be a maximum of 128 characters in length.
- instance_
id str The ID of the Bastion instance.
- pass_
phrase str The password of the private key. The value is a Base64-encoded string.
- private_
key str The private key. The value is a Base64-encoded string.
- 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 to be added. The name can be a maximum of 128 characters in length.
- instance
Id String The ID of the Bastion instance.
- pass
Phrase String The password of the private key. The value is a Base64-encoded string.
- private
Key String The private key. The value is a Base64-encoded string.
- private
Key StringFinger Print The fingerprint of the private key.
Import
Bastion Host Share Key can be imported using the id, e.g.
$ pulumi import alicloud:bastionhost/hostShareKey:HostShareKey example <instance_id>:<host_share_key_id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.