1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. ComputeKeypairV2
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.ComputeKeypairV2

Explore with Pulumi AI

Manages a V2 keypair resource within FlexibleEngine.

Example Usage

Create Key Pair

import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";

const _new = new flexibleengine.ComputeKeypairV2("new", {});
Copy
import pulumi
import pulumi_flexibleengine as flexibleengine

new = flexibleengine.ComputeKeypairV2("new")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := flexibleengine.NewComputeKeypairV2(ctx, "new", nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;

return await Deployment.RunAsync(() => 
{
    var @new = new Flexibleengine.ComputeKeypairV2("new");

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.ComputeKeypairV2;
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 new_ = new ComputeKeypairV2("new");

    }
}
Copy
resources:
  new:
    type: flexibleengine:ComputeKeypairV2
Copy

Import Key Pair

import * as pulumi from "@pulumi/pulumi";
import * as flexibleengine from "@pulumi/flexibleengine";

const _import = new flexibleengine.ComputeKeypairV2("import", {publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB"});
Copy
import pulumi
import pulumi_flexibleengine as flexibleengine

import_ = flexibleengine.ComputeKeypairV2("import", public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := flexibleengine.NewComputeKeypairV2(ctx, "import", &flexibleengine.ComputeKeypairV2Args{
			PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;

return await Deployment.RunAsync(() => 
{
    var import = new Flexibleengine.ComputeKeypairV2("import", new()
    {
        PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.flexibleengine.ComputeKeypairV2;
import com.pulumi.flexibleengine.ComputeKeypairV2Args;
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 import_ = new ComputeKeypairV2("import", ComputeKeypairV2Args.builder()
            .publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB")
            .build());

    }
}
Copy
resources:
  import:
    type: flexibleengine:ComputeKeypairV2
    properties:
      publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB
Copy

Create ComputeKeypairV2 Resource

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

Constructor syntax

new ComputeKeypairV2(name: string, args?: ComputeKeypairV2Args, opts?: CustomResourceOptions);
@overload
def ComputeKeypairV2(resource_name: str,
                     args: Optional[ComputeKeypairV2Args] = None,
                     opts: Optional[ResourceOptions] = None)

@overload
def ComputeKeypairV2(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     compute_keypair_v2_id: Optional[str] = None,
                     name: Optional[str] = None,
                     private_key_path: Optional[str] = None,
                     public_key: Optional[str] = None,
                     region: Optional[str] = None)
func NewComputeKeypairV2(ctx *Context, name string, args *ComputeKeypairV2Args, opts ...ResourceOption) (*ComputeKeypairV2, error)
public ComputeKeypairV2(string name, ComputeKeypairV2Args? args = null, CustomResourceOptions? opts = null)
public ComputeKeypairV2(String name, ComputeKeypairV2Args args)
public ComputeKeypairV2(String name, ComputeKeypairV2Args args, CustomResourceOptions options)
type: flexibleengine:ComputeKeypairV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ComputeKeypairV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ComputeKeypairV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ComputeKeypairV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ComputeKeypairV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ComputeKeypairV2Args
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 computeKeypairV2Resource = new Flexibleengine.ComputeKeypairV2("computeKeypairV2Resource", new()
{
    ComputeKeypairV2Id = "string",
    Name = "string",
    PrivateKeyPath = "string",
    PublicKey = "string",
    Region = "string",
});
Copy
example, err := flexibleengine.NewComputeKeypairV2(ctx, "computeKeypairV2Resource", &flexibleengine.ComputeKeypairV2Args{
ComputeKeypairV2Id: pulumi.String("string"),
Name: pulumi.String("string"),
PrivateKeyPath: pulumi.String("string"),
PublicKey: pulumi.String("string"),
Region: pulumi.String("string"),
})
Copy
var computeKeypairV2Resource = new ComputeKeypairV2("computeKeypairV2Resource", ComputeKeypairV2Args.builder()
    .computeKeypairV2Id("string")
    .name("string")
    .privateKeyPath("string")
    .publicKey("string")
    .region("string")
    .build());
Copy
compute_keypair_v2_resource = flexibleengine.ComputeKeypairV2("computeKeypairV2Resource",
    compute_keypair_v2_id="string",
    name="string",
    private_key_path="string",
    public_key="string",
    region="string")
Copy
const computeKeypairV2Resource = new flexibleengine.ComputeKeypairV2("computeKeypairV2Resource", {
    computeKeypairV2Id: "string",
    name: "string",
    privateKeyPath: "string",
    publicKey: "string",
    region: "string",
});
Copy
type: flexibleengine:ComputeKeypairV2
properties:
    computeKeypairV2Id: string
    name: string
    privateKeyPath: string
    publicKey: string
    region: string
Copy

ComputeKeypairV2 Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ComputeKeypairV2 resource accepts the following input properties:

ComputeKeypairV2Id string
The resource ID which as same as keypair name.
Name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
PrivateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

PublicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
Region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
ComputeKeypairV2Id string
The resource ID which as same as keypair name.
Name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
PrivateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

PublicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
Region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id String
The resource ID which as same as keypair name.
name String
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath String

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey String
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region String
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id string
The resource ID which as same as keypair name.
name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
compute_keypair_v2_id str
The resource ID which as same as keypair name.
name str
Specifies a unique name for the keypair. Changing this creates a new keypair.
private_key_path str

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

public_key str
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region str
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id String
The resource ID which as same as keypair name.
name String
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath String

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey String
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region String
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.

Outputs

All input properties are implicitly available as output properties. Additionally, the ComputeKeypairV2 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 ComputeKeypairV2 Resource

Get an existing ComputeKeypairV2 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?: ComputeKeypairV2State, opts?: CustomResourceOptions): ComputeKeypairV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compute_keypair_v2_id: Optional[str] = None,
        name: Optional[str] = None,
        private_key_path: Optional[str] = None,
        public_key: Optional[str] = None,
        region: Optional[str] = None) -> ComputeKeypairV2
func GetComputeKeypairV2(ctx *Context, name string, id IDInput, state *ComputeKeypairV2State, opts ...ResourceOption) (*ComputeKeypairV2, error)
public static ComputeKeypairV2 Get(string name, Input<string> id, ComputeKeypairV2State? state, CustomResourceOptions? opts = null)
public static ComputeKeypairV2 get(String name, Output<String> id, ComputeKeypairV2State state, CustomResourceOptions options)
resources:  _:    type: flexibleengine:ComputeKeypairV2    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ComputeKeypairV2Id string
The resource ID which as same as keypair name.
Name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
PrivateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

PublicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
Region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
ComputeKeypairV2Id string
The resource ID which as same as keypair name.
Name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
PrivateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

PublicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
Region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id String
The resource ID which as same as keypair name.
name String
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath String

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey String
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region String
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id string
The resource ID which as same as keypair name.
name string
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath string

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey string
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region string
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
compute_keypair_v2_id str
The resource ID which as same as keypair name.
name str
Specifies a unique name for the keypair. Changing this creates a new keypair.
private_key_path str

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

public_key str
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region str
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.
computeKeypairV2Id String
The resource ID which as same as keypair name.
name String
Specifies a unique name for the keypair. Changing this creates a new keypair.
privateKeyPath String

Specifies the path of the created private key. The private key file (.pem) is created only after the resource is created. By default, the private key file will be created in the same folder as the work directory. If you need to create it in another folder, please specify the path for private_key_path. Changing this creates a new keypair.

->NOTE: The private key file will be removed after the keypair is deleted.

publicKey String
Specifies a imported OpenSSH-formatted public key. Changing this creates a new keypair.
region String
Specifies the region in which to create the keypair resource. If omitted, the region argument of the provider is used. Changing this creates a new keypair.

Import

Keypairs can be imported using the name, e.g.

$ pulumi import flexibleengine:index/computeKeypairV2:ComputeKeypairV2 my-keypair test-keypair
Copy

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

Package Details

Repository
flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
License
Notes
This Pulumi package is based on the flexibleengine Terraform Provider.