1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ecp
  5. KeyPair
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.ecp.KeyPair

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    Provides a Elastic Cloud Phone (ECP) Key Pair resource.

    For information about Elastic Cloud Phone (ECP) Key Pair and how to use it, see What is Key Pair.

    NOTE: Available in v1.130.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.ecp.KeyPair("example", {
        keyPairName: "my-KeyPair",
        publicKeyBody: "ssh-rsa AAAAxxxxxxxxxxtyuudsfsg",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ecp.KeyPair("example",
        key_pair_name="my-KeyPair",
        public_key_body="ssh-rsa AAAAxxxxxxxxxxtyuudsfsg")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecp.NewKeyPair(ctx, "example", &ecp.KeyPairArgs{
    			KeyPairName:   pulumi.String("my-KeyPair"),
    			PublicKeyBody: pulumi.String("ssh-rsa AAAAxxxxxxxxxxtyuudsfsg"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Ecp.KeyPair("example", new()
        {
            KeyPairName = "my-KeyPair",
            PublicKeyBody = "ssh-rsa AAAAxxxxxxxxxxtyuudsfsg",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecp.KeyPair;
    import com.pulumi.alicloud.ecp.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 example = new KeyPair("example", KeyPairArgs.builder()
                .keyPairName("my-KeyPair")
                .publicKeyBody("ssh-rsa AAAAxxxxxxxxxxtyuudsfsg")
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:ecp:KeyPair
        properties:
          keyPairName: my-KeyPair
          publicKeyBody: ssh-rsa AAAAxxxxxxxxxxtyuudsfsg
    

    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,
                public_key_body: 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: alicloud:ecp: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 AliCloud.Ecp.KeyPair("keyPairResource", new()
    {
        KeyPairName = "string",
        PublicKeyBody = "string",
    });
    
    example, err := ecp.NewKeyPair(ctx, "keyPairResource", &ecp.KeyPairArgs{
    	KeyPairName:   pulumi.String("string"),
    	PublicKeyBody: pulumi.String("string"),
    })
    
    var keyPairResource = new KeyPair("keyPairResource", KeyPairArgs.builder()
        .keyPairName("string")
        .publicKeyBody("string")
        .build());
    
    key_pair_resource = alicloud.ecp.KeyPair("keyPairResource",
        key_pair_name="string",
        public_key_body="string")
    
    const keyPairResource = new alicloud.ecp.KeyPair("keyPairResource", {
        keyPairName: "string",
        publicKeyBody: "string",
    });
    
    type: alicloud:ecp:KeyPair
    properties:
        keyPairName: string
        publicKeyBody: 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 Key Name.
    PublicKeyBody string
    The public key body.
    KeyPairName string
    The Key Name.
    PublicKeyBody string
    The public key body.
    keyPairName String
    The Key Name.
    publicKeyBody String
    The public key body.
    keyPairName string
    The Key Name.
    publicKeyBody string
    The public key body.
    key_pair_name str
    The Key Name.
    public_key_body str
    The public key body.
    keyPairName String
    The Key Name.
    publicKeyBody String
    The public key body.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            key_pair_name: Optional[str] = None,
            public_key_body: 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:
    KeyPairName string
    The Key Name.
    PublicKeyBody string
    The public key body.
    KeyPairName string
    The Key Name.
    PublicKeyBody string
    The public key body.
    keyPairName String
    The Key Name.
    publicKeyBody String
    The public key body.
    keyPairName string
    The Key Name.
    publicKeyBody string
    The public key body.
    key_pair_name str
    The Key Name.
    public_key_body str
    The public key body.
    keyPairName String
    The Key Name.
    publicKeyBody String
    The public key body.

    Import

    Elastic Cloud Phone (ECP) Key Pair can be imported using the id, e.g.

    $ pulumi import alicloud:ecp/keyPair:KeyPair example <key_pair_name>
    

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