1. Packages
  2. Volcengine
  3. API Docs
  4. ecs
  5. KeyPair
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

volcengine.ecs.KeyPair

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

    Provides a resource to manage ecs key pair

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Ecs.KeyPair("foo", new()
        {
            Description = "acc-test",
            KeyPairName = "acc-test-key-name",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.NewKeyPair(ctx, "foo", &ecs.KeyPairArgs{
    			Description: pulumi.String("acc-test"),
    			KeyPairName: pulumi.String("acc-test-key-name"),
    		})
    		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.volcengine.ecs.KeyPair;
    import com.pulumi.volcengine.ecs.KeyPairArgs;
    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) {
            var foo = new KeyPair("foo", KeyPairArgs.builder()        
                .description("acc-test")
                .keyPairName("acc-test-key-name")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.ecs.KeyPair("foo",
        description="acc-test",
        key_pair_name="acc-test-key-name")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.ecs.KeyPair("foo", {
        description: "acc-test",
        keyPairName: "acc-test-key-name",
    });
    
    resources:
      foo:
        type: volcengine:ecs:KeyPair
        properties:
          description: acc-test
          keyPairName: acc-test-key-name
    

    Create KeyPair Resource

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

    Constructor syntax

    new KeyPair(name: string, args: KeyPairArgs, opts?: CustomResourceOptions);
    @overload
    def KeyPair(resource_name: str,
                args: KeyPairArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def KeyPair(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                key_pair_name: Optional[str] = None,
                description: Optional[str] = None,
                key_file: Optional[str] = None,
                public_key: Optional[str] = None)
    func NewKeyPair(ctx *Context, name string, args KeyPairArgs, opts ...ResourceOption) (*KeyPair, error)
    public KeyPair(string name, KeyPairArgs args, CustomResourceOptions? opts = null)
    public KeyPair(String name, KeyPairArgs args)
    public KeyPair(String name, KeyPairArgs args, CustomResourceOptions options)
    
    type: volcengine:ecs:KeyPair
    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 KeyPairArgs
    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 KeyPairArgs
    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 KeyPairArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeyPairArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeyPairArgs
    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 keyPairResource = new Volcengine.Ecs.KeyPair("keyPairResource", new()
    {
        KeyPairName = "string",
        Description = "string",
        KeyFile = "string",
        PublicKey = "string",
    });
    
    example, err := ecs.NewKeyPair(ctx, "keyPairResource", &ecs.KeyPairArgs{
    	KeyPairName: pulumi.String("string"),
    	Description: pulumi.String("string"),
    	KeyFile:     pulumi.String("string"),
    	PublicKey:   pulumi.String("string"),
    })
    
    var keyPairResource = new KeyPair("keyPairResource", KeyPairArgs.builder()
        .keyPairName("string")
        .description("string")
        .keyFile("string")
        .publicKey("string")
        .build());
    
    key_pair_resource = volcengine.ecs.KeyPair("keyPairResource",
        key_pair_name="string",
        description="string",
        key_file="string",
        public_key="string")
    
    const keyPairResource = new volcengine.ecs.KeyPair("keyPairResource", {
        keyPairName: "string",
        description: "string",
        keyFile: "string",
        publicKey: "string",
    });
    
    type: volcengine:ecs:KeyPair
    properties:
        description: string
        keyFile: string
        keyPairName: string
        publicKey: string
    

    KeyPair 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 KeyPair resource accepts the following input properties:

    KeyPairName string
    The name of key pair.
    Description string
    The description of key pair.
    KeyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    PublicKey string
    Public key string.
    KeyPairName string
    The name of key pair.
    Description string
    The description of key pair.
    KeyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    PublicKey string
    Public key string.
    keyPairName String
    The name of key pair.
    description String
    The description of key pair.
    keyFile String
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    publicKey String
    Public key string.
    keyPairName string
    The name of key pair.
    description string
    The description of key pair.
    keyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    publicKey string
    Public key string.
    key_pair_name str
    The name of key pair.
    description str
    The description of key pair.
    key_file str
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    public_key str
    Public key string.
    keyPairName String
    The name of key pair.
    description String
    The description of key pair.
    keyFile String
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    publicKey String
    Public key string.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KeyPair resource produces the following output properties:

    FingerPrint string
    The finger print info.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPairId string
    The id of key pair.
    FingerPrint string
    The finger print info.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPairId string
    The id of key pair.
    fingerPrint String
    The finger print info.
    id String
    The provider-assigned unique ID for this managed resource.
    keyPairId String
    The id of key pair.
    fingerPrint string
    The finger print info.
    id string
    The provider-assigned unique ID for this managed resource.
    keyPairId string
    The id of key pair.
    finger_print str
    The finger print info.
    id str
    The provider-assigned unique ID for this managed resource.
    key_pair_id str
    The id of key pair.
    fingerPrint String
    The finger print info.
    id String
    The provider-assigned unique ID for this managed resource.
    keyPairId String
    The id of key pair.

    Look up Existing KeyPair Resource

    Get an existing KeyPair 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?: KeyPairState, opts?: CustomResourceOptions): KeyPair
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            finger_print: Optional[str] = None,
            key_file: Optional[str] = None,
            key_pair_id: Optional[str] = None,
            key_pair_name: Optional[str] = None,
            public_key: Optional[str] = None) -> KeyPair
    func GetKeyPair(ctx *Context, name string, id IDInput, state *KeyPairState, opts ...ResourceOption) (*KeyPair, error)
    public static KeyPair Get(string name, Input<string> id, KeyPairState? state, CustomResourceOptions? opts = null)
    public static KeyPair get(String name, Output<String> id, KeyPairState 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:
    Description string
    The description of key pair.
    FingerPrint string
    The finger print info.
    KeyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    KeyPairId string
    The id of key pair.
    KeyPairName string
    The name of key pair.
    PublicKey string
    Public key string.
    Description string
    The description of key pair.
    FingerPrint string
    The finger print info.
    KeyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    KeyPairId string
    The id of key pair.
    KeyPairName string
    The name of key pair.
    PublicKey string
    Public key string.
    description String
    The description of key pair.
    fingerPrint String
    The finger print info.
    keyFile String
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    keyPairId String
    The id of key pair.
    keyPairName String
    The name of key pair.
    publicKey String
    Public key string.
    description string
    The description of key pair.
    fingerPrint string
    The finger print info.
    keyFile string
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    keyPairId string
    The id of key pair.
    keyPairName string
    The name of key pair.
    publicKey string
    Public key string.
    description str
    The description of key pair.
    finger_print str
    The finger print info.
    key_file str
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    key_pair_id str
    The id of key pair.
    key_pair_name str
    The name of key pair.
    public_key str
    Public key string.
    description String
    The description of key pair.
    fingerPrint String
    The finger print info.
    keyFile String
    Target file to save private key. It is recommended that the value not be empty. You only have one chance to download the private key, the volcengine will not save your private key, please keep it safe. In the TF import scenario, this field will not write the private key locally.
    keyPairId String
    The id of key pair.
    keyPairName String
    The name of key pair.
    publicKey String
    Public key string.

    Import

    ECS key pair can be imported using the id, e.g.

     $ pulumi import volcengine:ecs/keyPair:KeyPair default kp-mizl7m1kqccg5smt1bdpijuj
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine