1. Packages
  2. Alicloud Provider
  3. API Docs
  4. bastionhost
  5. HostShareKey
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.bastionhost.HostShareKey

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    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 since v1.165.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    export = async () => {
        const config = new pulumi.Config();
        const name = config.get("name") || "tf_example";
        const default = await alicloud.bastionhost.getInstances({});
        const defaultGetZones = await alicloud.getZones({
            availableResourceCreation: "VSwitch",
        });
        const defaultGetNetworks = await alicloud.vpc.getNetworks({
            nameRegex: "^default-NODELETING$",
            cidrBlock: "10.4.0.0/16",
        });
        const defaultGetSwitches = await alicloud.vpc.getSwitches({
            cidrBlock: "10.4.0.0/24",
            vpcId: defaultGetNetworks.ids?.[0],
            zoneId: defaultGetZones.zones?.[0]?.id,
        });
        const defaultSecurityGroup: alicloud.ecs.SecurityGroup[] = [];
        for (const range = {value: 0}; range.value < (_default.ids.length > 0 ? 0 : 1); range.value++) {
            defaultSecurityGroup.push(new alicloud.ecs.SecurityGroup(`default-${range.value}`, {vpcId: defaultGetNetworks.ids?.[0]}));
        }
        const defaultInstance: alicloud.bastionhost.Instance[] = [];
        for (const range = {value: 0}; range.value < (_default.ids.length > 0 ? 0 : 1); range.value++) {
            defaultInstance.push(new alicloud.bastionhost.Instance(`default-${range.value}`, {
                description: name,
                licenseCode: "bhah_ent_50_asset",
                planCode: "cloudbastion",
                storage: "5",
                bandwidth: "5",
                period: 1,
                vswitchId: defaultGetSwitches.ids?.[0],
                securityGroupIds: [defaultSecurityGroup[0].id],
            }));
        }
        const instanceId = _default.ids.length > 0 ? _default.ids?.[0] : defaultInstance[0].id;
        const privateKey = config.get("privateKey") || "LS0tLS1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0TGkwU2FHVElta2wvbUNCUDhZaW9JUys2N0xjby9kbHphUTNGVDlxTnJieFdFWjJlaS9LVlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ==";
        const defaultHostShareKey = new alicloud.bastionhost.HostShareKey("default", {
            hostShareKeyName: name,
            instanceId: instanceId,
            privateKey: privateKey,
        });
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_example"
    default = alicloud.bastionhost.get_instances()
    default_get_zones = alicloud.get_zones(available_resource_creation="VSwitch")
    default_get_networks = alicloud.vpc.get_networks(name_regex="^default-NODELETING$",
        cidr_block="10.4.0.0/16")
    default_get_switches = alicloud.vpc.get_switches(cidr_block="10.4.0.0/24",
        vpc_id=default_get_networks.ids[0],
        zone_id=default_get_zones.zones[0].id)
    default_security_group = []
    for range in [{"value": i} for i in range(0, 0 if len(default.ids) > 0 else 1)]:
        default_security_group.append(alicloud.ecs.SecurityGroup(f"default-{range['value']}", vpc_id=default_get_networks.ids[0]))
    default_instance = []
    for range in [{"value": i} for i in range(0, 0 if len(default.ids) > 0 else 1)]:
        default_instance.append(alicloud.bastionhost.Instance(f"default-{range['value']}",
            description=name,
            license_code="bhah_ent_50_asset",
            plan_code="cloudbastion",
            storage="5",
            bandwidth="5",
            period=1,
            vswitch_id=default_get_switches.ids[0],
            security_group_ids=[default_security_group[0].id]))
    instance_id = default.ids[0] if len(default.ids) > 0 else default_instance[0].id
    private_key = config.get("privateKey")
    if private_key is None:
        private_key = "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc25oc29SSVVwVXltSG1FVHJXUGxDbkhMa3c3N0JYTm44ZHcvbDg3eG10SUhjd2syCkRybjFDZk5jZkpJV0tSdkFaYkdKMlZTS1RiRDhPTmcyT3JvUHFGUHBLOHJ5QjJRb1NYQVRsaUVHWFhNeW1tRm8KeDBmem12THFscUxpNGZ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TzNXUFBHd1E3QzRnYitFZzZkR1pLRnJVR1ZId2VUUG1HaGtwN1BmYU5ESwplaFVoUWFnNm9XOTF4dkE2YldZZ29SQmczUWkxc01MblRWeTExeVN1UEVFSCtMT2s1N3d2akNLSk5XZnM0SjVyCmg1NGw0QXZ6UVhyWWN0UlZkSmYrNjFacGFnTkdZMVBvWVJMTHJMSWRBb0dBTndydzErRzJtNWJ0YW04S2hwU1QKMzVLbmRnajlkM3N6cStrcE03aGZpZWYvcXZGTU9jWHVJQlRjRVRFVHNWNlRyTFdsZkQ2d3NrVitybDFCbEhSbwpqaXpoT3dCU2NOZ3hlbTA3TXE0cXBwYTViYVltVW5QNUlwTjRwdDNJeFVPaFQ4UitxS0h2TnJYZ1hjZGlSYXl4CjFoejhkeFoxckxselpTNHd3M001MVlzQ2dZRUFpUDEwTEUySXg5Q2wrTTdZWTZZU2I0Zkx1MGhKRy9XOGFuemIKSFExZlBrOTVFRytJVlJyRUl2ZS95MHNvOTE4VzdyL0lteWxVbG5ORHFEUWZkK3grSmVNaXBuenRsRUorRGZxdgprQ3c4dUtJUUI5akZXV0l4T0JpVktyVnB6bll6ZG9Gd2dRd3BneDBKazFDZzlIblpMQWpVWUJyUDEwUy9ORFFRClJUdldjK0VDZ1lBeGRIZWxQNG1RdkJaS1oxMlNKbHlLbFVLeW43aHhzSHVkMkphMVNtS3FWeHBERDNlR0w0Y3QKZXA1QTZ5NkF4eGViZkI0aDdYNEZ0QTBBRURPdkZDR0J1QlRvZ3ZBdUNDVUtqK2JIUG1SNG53UVYzcWZ2M3loRAp0TGkwU2FHVElta2wvbUNCUDhZaW9JUys2N0xjby9kbHphUTNGVDlxTnJieFdFWjJlaS9LVlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ=="
    default_host_share_key = alicloud.bastionhost.HostShareKey("default",
        host_share_key_name=name,
        instance_id=instance_id,
        private_key=private_key)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/bastionhost"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := bastionhost.GetInstances(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
    			NameRegex: pulumi.StringRef("^default-NODELETING$"),
    			CidrBlock: pulumi.StringRef("10.4.0.0/16"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultGetSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
    			CidrBlock: pulumi.StringRef("10.4.0.0/24"),
    			VpcId:     pulumi.StringRef(defaultGetNetworks.Ids[0]),
    			ZoneId:    pulumi.StringRef(defaultGetZones.Zones[0].Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		var tmp0 float64
    		if pulumi.Float64(len(_default.Ids)) > 0 {
    			tmp0 = 0
    		} else {
    			tmp0 = 1
    		}
    		var defaultSecurityGroup []*ecs.SecurityGroup
    		for index := 0; index < tmp0; index++ {
    			key0 := index
    			_ := index
    			__res, err := ecs.NewSecurityGroup(ctx, fmt.Sprintf("default-%v", key0), &ecs.SecurityGroupArgs{
    				VpcId: pulumi.String(defaultGetNetworks.Ids[0]),
    			})
    			if err != nil {
    				return err
    			}
    			defaultSecurityGroup = append(defaultSecurityGroup, __res)
    		}
    		var tmp1 float64
    		if pulumi.Float64(len(_default.Ids)) > 0 {
    			tmp1 = 0
    		} else {
    			tmp1 = 1
    		}
    		var defaultInstance []*bastionhost.Instance
    		for index := 0; index < tmp1; index++ {
    			key0 := index
    			_ := index
    			__res, err := bastionhost.NewInstance(ctx, fmt.Sprintf("default-%v", key0), &bastionhost.InstanceArgs{
    				Description: pulumi.String(name),
    				LicenseCode: pulumi.String("bhah_ent_50_asset"),
    				PlanCode:    pulumi.String("cloudbastion"),
    				Storage:     pulumi.String("5"),
    				Bandwidth:   pulumi.String("5"),
    				Period:      pulumi.Int(1),
    				VswitchId:   pulumi.String(defaultGetSwitches.Ids[0]),
    				SecurityGroupIds: pulumi.StringArray{
    					defaultSecurityGroup[0].ID(),
    				},
    			})
    			if err != nil {
    				return err
    			}
    			defaultInstance = append(defaultInstance, __res)
    		}
    		var tmp2 *string
    		if pulumi.Float64(len(_default.Ids)) > 0 {
    			tmp2 = _default.Ids[0]
    		} else {
    			tmp2 = defaultInstance[0].ID()
    		}
    		instanceId := tmp2
    		privateKey := "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc25oc29SSVVwVXltSG1FVHJXUGxDbkhMa3c3N0JYTm44ZHcvbDg3eG10SUhjd2syCkRybjFDZk5jZkpJV0tSdkFaYkdKMlZTS1RiRDhPTmcyT3JvUHFGUHBLOHJ5QjJRb1NYQVRsaUVHWFhNeW1tRm8KeDBmem12THFscUxpNGZnOExhcTc5UC85aGxLU1djTWhJU0pYVTNHMS9KdEFBUmEyQXc4cXEzSVQvMkZ5NktrdwowMU9MdDdLN2pGUFRPaHhtdmNoSkZ1SVo1YXI0cW5HUlFHQnpCL2hoRHVIWEMwRlhJZ2ozd0NXMDZ4R2V2WjJyCmNCWWwwN1luL2lvZk95MU0wRjZZN0JrMU95N21vYndzM1JsalUyL2FpZlhLMmNOUlk2Qjl5WXNvd1RBZmQ5OTQKQ2YxSlF3Tlh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YvcXZGTU9jWHVJQlRjRVRFVHNWNlRyTFdsZkQ2d3NrVitybDFCbEhSbwpqaXpoT3dCU2NOZ3hlbTA3TXE0cXBwYTViYVltVW5QNUlwTjRwdDNJeFVPaFQ4UitxS0h2TnJYZ1hjZGlSYXl4CjFoejhkeFoxckxselpTNHd3M001MVlzQ2dZRUFpUDEwTEUySXg5Q2wrTTdZWTZZU2I0Zkx1MGhKRy9XOGFuemIKSFExZlBrOTVFRytJVlJyRUl2ZS95MHNvOTE4VzdyL0lteWxVbG5ORHFEUWZkK3grSmVNaXBuenRsRUorRGZxdgprQ3c4dUtJUUI5akZXV0l4T0JpVktyVnB6bll6ZG9Gd2dRd3BneDBKazFDZzlIblpMQWpVWUJyUDEwUy9ORFFRClJUdldjK0VDZ1lBeGRIZWxQNG1RdkJaS1oxMlNKbHlLbFVLeW43aHhzSHVkMkphMVNtS3FWeHBERDNlR0w0Y3QKZXA1QTZ5NkF4eGViZkI0aDdYNEZ0QTBBRURPdkZDR0J1QlRvZ3ZBdUNDVUtqK2JIUG1SNG53UVYzcWZ2M3loRAp0TGkwU2FHVElta2wvbUNCUDhZaW9JUys2N0xjby9kbHphUTNGVDlxTnJieFdFWjJlaS9LVlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ=="
    		if param := cfg.Get("privateKey"); param != "" {
    			privateKey = param
    		}
    		_, err = bastionhost.NewHostShareKey(ctx, "default", &bastionhost.HostShareKeyArgs{
    			HostShareKeyName: pulumi.String(name),
    			InstanceId:       pulumi.String(instanceId),
    			PrivateKey:       pulumi.String(privateKey),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(async() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf_example";
        var @default = await AliCloud.BastionHost.GetInstances.InvokeAsync();
    
        var defaultGetZones = await AliCloud.GetZones.InvokeAsync(new()
        {
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultGetNetworks = await AliCloud.Vpc.GetNetworks.InvokeAsync(new()
        {
            NameRegex = "^default-NODELETING$",
            CidrBlock = "10.4.0.0/16",
        });
    
        var defaultGetSwitches = await AliCloud.Vpc.GetSwitches.InvokeAsync(new()
        {
            CidrBlock = "10.4.0.0/24",
            VpcId = defaultGetNetworks.Ids[0],
            ZoneId = defaultGetZones.Zones[0]?.Id,
        });
    
        var defaultSecurityGroup = new List<AliCloud.Ecs.SecurityGroup>();
        for (var rangeIndex = 0; rangeIndex < @default.Ids.Length > 0 ? 0 : 1; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultSecurityGroup.Add(new AliCloud.Ecs.SecurityGroup($"default-{range.Value}", new()
            {
                VpcId = defaultGetNetworks.Ids[0],
            }));
        }
        var defaultInstance = new List<AliCloud.BastionHost.Instance>();
        for (var rangeIndex = 0; rangeIndex < @default.Ids.Length > 0 ? 0 : 1; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            defaultInstance.Add(new AliCloud.BastionHost.Instance($"default-{range.Value}", new()
            {
                Description = name,
                LicenseCode = "bhah_ent_50_asset",
                PlanCode = "cloudbastion",
                Storage = "5",
                Bandwidth = "5",
                Period = 1,
                VswitchId = defaultGetSwitches.Ids[0],
                SecurityGroupIds = new[]
                {
                    defaultSecurityGroup[0].Id,
                },
            }));
        }
        var instanceId = @default.Ids.Length > 0 ? @default.Ids[0] : defaultInstance[0].Id;
    
        var privateKey = config.Get("privateKey") ?? "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc25oc29SSVVwVXltSG1FVHJXUGxDbkhMa3c3N0JYTm44ZHcvbDg3eG10SUhjd2syCkRybjFDZk5jZkpJV0tSdkFaYkdKMlZTS1RiRDhPTmcyT3JvUHFGUHBLOHJ5QjJRb1NYQVRsaUVHWFhNeW1tRm8KeDBmem12THFscU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KeDI3TzNXUFBHd1E3QzRnYitFZzZkR1pLRnJVR1ZId2VUUG1HaGtwN1BmYU5ESwplaFVoUWFnNm9XOTF4dkE2YldZZ29SQmczUWkxc01MblRWeTExeVN1UEVFSCtMT2s1N3d2akNLSk5XZnM0SjVyCmg1NGw0QXZ6UVhyWWN0UlZkSmYrNjFacGFnTkdZMVBvWVJMTHJMSWRBb0dBTndydzErRzJtNWJ0YW04S2hwU1QKMzVLbmRnajlkM3N6cStrcE03aGZpZWYvcXZGTU9jWHVJQlRjRVRFVHNWNlRyTFdsZkQ2d3NrVitybDFCbEhSbwpqaXpoT3dCU2NOZ3hlbTA3TXE0cXBwYTViYVltVW5QNUlwTjRwdDNJeFVPaFQ4UitxS0h2TnJYZ1hjZGlSYXl4CjFoejhkeFoxckxselpTNHd3M001MVlzQ2dZRUFpUDEwTEUySXg5Q2wrTTdZWTZZU2I0Zkx1MGhKRy9XOGFuemIKSFExZlBrOTVFRytJVlJyRUl2ZS95MHNvOTE4VzdyL0lteWxVbG5ORHFEUWZkK3grSmVNaXBuenRsRUorRGZxdgprQ3c4dUtJUUI5akZXV0l4T0JpVktyVnB6bll6ZG9Gd2dRd3BneDBKazFDZzlIblpMQWpVWUJyUDEwUy9ORFFRClJUdldjK0VDZ1lBeGRIZWxQNG1RdkJaS1oxMlNKbHlLbFVLeW43aHhzSHVkMkphMVNtS3FWeHBERDNlR0w0Y3QKZXA1QTZ5NkF4eGViZkI0aDdYNEZ0QTBBRURPdkZDR0J1QlRvZ3ZBdUNDVUtqK2JIUG1SNG53UVYzcWZ2M3loRAp0TGkwU2FHVElta2wvbUNCUDhZaW9JUys2N0xjby9kbHphUTNGVDlxTnJieFdFWjJlaS9LVlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ==";
        var defaultHostShareKey = new AliCloud.BastionHost.HostShareKey("default", new()
        {
            HostShareKeyName = name,
            InstanceId = instanceId,
            PrivateKey = privateKey,
        });
    
    });
    
    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.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.vpc.VpcFunctions;
    import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
    import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
    import com.pulumi.alicloud.ecs.SecurityGroup;
    import com.pulumi.alicloud.ecs.SecurityGroupArgs;
    import com.pulumi.alicloud.bastionhost.Instance;
    import com.pulumi.alicloud.bastionhost.InstanceArgs;
    import com.pulumi.alicloud.bastionhost.HostShareKey;
    import com.pulumi.alicloud.bastionhost.HostShareKeyArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf_example");
            final var default = BastionhostFunctions.getInstances();
    
            final var defaultGetZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableResourceCreation("VSwitch")
                .build());
    
            final var defaultGetNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
                .nameRegex("^default-NODELETING$")
                .cidrBlock("10.4.0.0/16")
                .build());
    
            final var defaultGetSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
                .cidrBlock("10.4.0.0/24")
                .vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
                .zoneId(defaultGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
            for (var i = 0; i < default_.ids().length() > 0 ? 0 : 1; i++) {
                new SecurityGroup("defaultSecurityGroup-" + i, SecurityGroupArgs.builder()
                    .vpcId(defaultGetNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
                    .build());
    
            
    }
            for (var i = 0; i < default_.ids().length() > 0 ? 0 : 1; i++) {
                new Instance("defaultInstance-" + i, InstanceArgs.builder()
                    .description(name)
                    .licenseCode("bhah_ent_50_asset")
                    .planCode("cloudbastion")
                    .storage("5")
                    .bandwidth("5")
                    .period("1")
                    .vswitchId(defaultGetSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
                    .securityGroupIds(defaultSecurityGroup[0].id())
                    .build());
    
            
    }
            final var instanceId = default_.ids().length() > 0 ? default_.ids()[0] : defaultInstance[0].id();
    
            final var privateKey = config.get("privateKey").orElse("LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBc25oc29SSVVwVXltSG1FVHJXUGxDbkhMa3c3N0JYTm44ZHcvbDg3eG10SUhjd2syCkRybjFDZk5jZkpJV0tSdkFaYkdKMlZTS1RiRDhPTmcyT3JvUHFGUHBLOHJ5QjJRb1NYQVRsaUVHWFhNeW1tRm8KeDBmem12THFscUxpNGZnOExhcTc5UC85aGxLU1djTWhJU0pYVTNHMS9KdEFBUmEyQXc4cXEzSVQvMkZ5NktrdwowMU9MdDdLN2pGUFRPaHhtdmNoSkZ1SVo1YXI0cW5HUlFHQnpCL2hoRHVIWEMwRlhJZ2ozd0NXMDZ4R2V2WjJyCmNCWWwwN1luL2lvZk95MU0wRjZZN0JrMU95N21vYndzM1JsalUyL2FpZlhLMmNOUlk2Qjl5WXNvd1RBZmQ5OTQKQ2YxSlF3TlhsaUZCeTZueEJLQk1YbDhIU1grS1o3L29PUlIwVXdJREFRQUJBb0lCQVFDbU5JSXR5ckhSY3oxdApJMGo0L0FQc295ZE1EL0owRkJMa2FoSUxKWjFaYW1tbmx4ZHh4WHBQUndXRnVXTEw2OTFVbDI5aUoxb1ptazU1Ci9ka2EvZlhnOUN3OUxXWVN2aExLdVlaMEZOTmhxZ3VoUE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U2I0Zkx1MGhKRy9XOGFuemIKSFExZlBrOTVFRytJVlJyRUl2ZS95MHNvOTE4VzdyL0lteWxVbG5ORHFEUWZkK3grSmVNaXBuenRsRUorRGZxdgprQ3c4dUtJUUI5akZXV0l4T0JpVktyVnB6bll6ZG9Gd2dRd3BneDBKazFDZzlIblpMQWpVWUJyUDEwUy9ORFFRClJUdldjK0VDZ1lBeGRIZWxQNG1RdkJaS1oxMlNKbHlLbFVLeW43aHhzSHVkMkphMVNtS3FWeHBERDNlR0w0Y3QKZXA1QTZ5NkF4eGViZkI0aDdYNEZ0QTBBRURPdkZDR0J1QlRvZ3ZBdUNDVUtqK2JIUG1SNG53UVYzcWZ2M3loRAp0TGkwU2FHVElta2wvbUNCUDhZaW9JUys2N0xjby9kbHphUTNGVDlxTnJieFdFWjJlaS9LVlE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQ==");
            var defaultHostShareKey = new HostShareKey("defaultHostShareKey", HostShareKeyArgs.builder()
                .hostShareKeyName(name)
                .instanceId(instanceId)
                .privateKey(privateKey)
                .build());
    
        }
    }
    
    Coming soon!
    

    Create HostShareKey Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new HostShareKey(name: string, args: HostShareKeyArgs, opts?: CustomResourceOptions);
    @overload
    def HostShareKey(resource_name: str,
                     args: HostShareKeyArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def HostShareKey(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     host_share_key_name: Optional[str] = None,
                     instance_id: Optional[str] = None,
                     private_key: Optional[str] = None,
                     pass_phrase: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var hostShareKeyResource = new AliCloud.BastionHost.HostShareKey("hostShareKeyResource", new()
    {
        HostShareKeyName = "string",
        InstanceId = "string",
        PrivateKey = "string",
        PassPhrase = "string",
    });
    
    example, err := bastionhost.NewHostShareKey(ctx, "hostShareKeyResource", &bastionhost.HostShareKeyArgs{
    	HostShareKeyName: pulumi.String("string"),
    	InstanceId:       pulumi.String("string"),
    	PrivateKey:       pulumi.String("string"),
    	PassPhrase:       pulumi.String("string"),
    })
    
    var hostShareKeyResource = new HostShareKey("hostShareKeyResource", HostShareKeyArgs.builder()
        .hostShareKeyName("string")
        .instanceId("string")
        .privateKey("string")
        .passPhrase("string")
        .build());
    
    host_share_key_resource = alicloud.bastionhost.HostShareKey("hostShareKeyResource",
        host_share_key_name="string",
        instance_id="string",
        private_key="string",
        pass_phrase="string")
    
    const hostShareKeyResource = new alicloud.bastionhost.HostShareKey("hostShareKeyResource", {
        hostShareKeyName: "string",
        instanceId: "string",
        privateKey: "string",
        passPhrase: "string",
    });
    
    type: alicloud:bastionhost:HostShareKey
    properties:
        hostShareKeyName: string
        instanceId: string
        passPhrase: string
        privateKey: string
    

    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:

    HostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    InstanceId string
    The ID of the Bastion instance.
    PrivateKey string
    The private key. The value is a Base64-encoded string.
    PassPhrase string
    The password of the private key. The value is a Base64-encoded string.
    HostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    InstanceId string
    The ID of the Bastion instance.
    PrivateKey string
    The private key. The value is a Base64-encoded string.
    PassPhrase string
    The password of the private key. The value is a Base64-encoded string.
    hostShareKeyName String
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId String
    The ID of the Bastion instance.
    privateKey String
    The private key. The value is a Base64-encoded string.
    passPhrase String
    The password of the private key. The value is a Base64-encoded string.
    hostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId string
    The ID of the Bastion instance.
    privateKey string
    The private key. The value is a Base64-encoded string.
    passPhrase string
    The password of the private key. The value is a Base64-encoded string.
    host_share_key_name 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.
    hostShareKeyName String
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId String
    The ID of the Bastion instance.
    privateKey String
    The private key. The value is a Base64-encoded string.
    passPhrase 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:

    HostShareKeyId string
    The first ID of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateKeyFingerPrint string
    The fingerprint of the private key.
    HostShareKeyId string
    The first ID of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    PrivateKeyFingerPrint string
    The fingerprint of the private key.
    hostShareKeyId String
    The first ID of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    privateKeyFingerPrint String
    The fingerprint of the private key.
    hostShareKeyId string
    The first ID of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    privateKeyFingerPrint string
    The fingerprint of the private key.
    host_share_key_id str
    The first ID of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    private_key_finger_print str
    The fingerprint of the private key.
    hostShareKeyId String
    The first ID of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    privateKeyFingerPrint String
    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.
    The following state arguments are supported:
    HostShareKeyId string
    The first ID of the resource.
    HostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    InstanceId string
    The ID of the Bastion instance.
    PassPhrase string
    The password of the private key. The value is a Base64-encoded string.
    PrivateKey string
    The private key. The value is a Base64-encoded string.
    PrivateKeyFingerPrint string
    The fingerprint of the private key.
    HostShareKeyId string
    The first ID of the resource.
    HostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    InstanceId string
    The ID of the Bastion instance.
    PassPhrase string
    The password of the private key. The value is a Base64-encoded string.
    PrivateKey string
    The private key. The value is a Base64-encoded string.
    PrivateKeyFingerPrint string
    The fingerprint of the private key.
    hostShareKeyId String
    The first ID of the resource.
    hostShareKeyName String
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId String
    The ID of the Bastion instance.
    passPhrase String
    The password of the private key. The value is a Base64-encoded string.
    privateKey String
    The private key. The value is a Base64-encoded string.
    privateKeyFingerPrint String
    The fingerprint of the private key.
    hostShareKeyId string
    The first ID of the resource.
    hostShareKeyName string
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId string
    The ID of the Bastion instance.
    passPhrase string
    The password of the private key. The value is a Base64-encoded string.
    privateKey string
    The private key. The value is a Base64-encoded string.
    privateKeyFingerPrint string
    The fingerprint of the private key.
    host_share_key_id str
    The first ID of the resource.
    host_share_key_name 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_finger_print str
    The fingerprint of the private key.
    hostShareKeyId String
    The first ID of the resource.
    hostShareKeyName String
    The name of the host shared key to be added. The name can be a maximum of 128 characters in length.
    instanceId String
    The ID of the Bastion instance.
    passPhrase String
    The password of the private key. The value is a Base64-encoded string.
    privateKey String
    The private key. The value is a Base64-encoded string.
    privateKeyFingerPrint String
    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>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi