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", {});
import pulumi
import pulumi_flexibleengine as flexibleengine
new = flexibleengine.ComputeKeypairV2("new")
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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Flexibleengine = Pulumi.Flexibleengine;
return await Deployment.RunAsync(() =>
{
var @new = new Flexibleengine.ComputeKeypairV2("new");
});
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");
}
}
resources:
new:
type: flexibleengine:ComputeKeypairV2
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"});
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")
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
})
}
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",
});
});
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());
}
}
resources:
import:
type: flexibleengine:ComputeKeypairV2
properties:
publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB
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 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 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 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 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 String
- The unique name of the resource.
- args 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",
});
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"),
})
var computeKeypairV2Resource = new ComputeKeypairV2("computeKeypairV2Resource", ComputeKeypairV2Args.builder()
.computeKeypairV2Id("string")
.name("string")
.privateKeyPath("string")
.publicKey("string")
.region("string")
.build());
compute_keypair_v2_resource = flexibleengine.ComputeKeypairV2("computeKeypairV2Resource",
compute_keypair_v2_id="string",
name="string",
private_key_path="string",
public_key="string",
region="string")
const computeKeypairV2Resource = new flexibleengine.ComputeKeypairV2("computeKeypairV2Resource", {
computeKeypairV2Id: "string",
name: "string",
privateKeyPath: "string",
publicKey: "string",
region: "string",
});
type: flexibleengine:ComputeKeypairV2
properties:
computeKeypairV2Id: string
name: string
privateKeyPath: string
publicKey: string
region: string
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:
- Compute
Keypair stringV2Id - The resource ID which as same as keypair name.
- Name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- Private
Key stringPath 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 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 stringV2Id - The resource ID which as same as keypair name.
- Name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- Private
Key stringPath 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 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 StringV2Id - The resource ID which as same as keypair name.
- name String
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key StringPath 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 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 stringV2Id - The resource ID which as same as keypair name.
- name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key stringPath 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 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_ strv2_ id - 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_ strpath 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.
- compute
Keypair StringV2Id - The resource ID which as same as keypair name.
- name String
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key StringPath 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 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
- 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.
- Compute
Keypair stringV2Id - The resource ID which as same as keypair name.
- Name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- Private
Key stringPath 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 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 stringV2Id - The resource ID which as same as keypair name.
- Name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- Private
Key stringPath 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 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 StringV2Id - The resource ID which as same as keypair name.
- name String
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key StringPath 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 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 stringV2Id - The resource ID which as same as keypair name.
- name string
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key stringPath 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 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_ strv2_ id - 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_ strpath 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.
- compute
Keypair StringV2Id - The resource ID which as same as keypair name.
- name String
- Specifies a unique name for the keypair. Changing this creates a new keypair.
- private
Key StringPath 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 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
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.