gcore.Keypair
Explore with Pulumi AI
Represent a ssh key, do not depends on region
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const kpKeypair = new gcore.Keypair("kpKeypair", {
projectId: 1,
publicKey: "your public key here",
sshkeyName: "test",
});
export const kp = kpKeypair;
import pulumi
import pulumi_gcore as gcore
kp_keypair = gcore.Keypair("kpKeypair",
project_id=1,
public_key="your public key here",
sshkey_name="test")
pulumi.export("kp", kp_keypair)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
kpKeypair, err := gcore.NewKeypair(ctx, "kpKeypair", &gcore.KeypairArgs{
ProjectId: pulumi.Float64(1),
PublicKey: pulumi.String("your public key here"),
SshkeyName: pulumi.String("test"),
})
if err != nil {
return err
}
ctx.Export("kp", kpKeypair)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var kpKeypair = new Gcore.Keypair("kpKeypair", new()
{
ProjectId = 1,
PublicKey = "your public key here",
SshkeyName = "test",
});
return new Dictionary<string, object?>
{
["kp"] = kpKeypair,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.Keypair;
import com.pulumi.gcore.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 kpKeypair = new Keypair("kpKeypair", KeypairArgs.builder()
.projectId(1)
.publicKey("your public key here")
.sshkeyName("test")
.build());
ctx.export("kp", kpKeypair);
}
}
resources:
kpKeypair:
type: gcore:Keypair
properties:
projectId: 1
publicKey: your public key here
sshkeyName: test
outputs:
kp: ${kpKeypair}
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,
public_key: Optional[str] = None,
sshkey_name: Optional[str] = None,
keypair_id: Optional[str] = None,
project_id: Optional[float] = None,
project_name: 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: gcore: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 Gcore.Keypair("keypairResource", new()
{
PublicKey = "string",
SshkeyName = "string",
KeypairId = "string",
ProjectId = 0,
ProjectName = "string",
});
example, err := gcore.NewKeypair(ctx, "keypairResource", &gcore.KeypairArgs{
PublicKey: pulumi.String("string"),
SshkeyName: pulumi.String("string"),
KeypairId: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
})
var keypairResource = new Keypair("keypairResource", KeypairArgs.builder()
.publicKey("string")
.sshkeyName("string")
.keypairId("string")
.projectId(0)
.projectName("string")
.build());
keypair_resource = gcore.Keypair("keypairResource",
public_key="string",
sshkey_name="string",
keypair_id="string",
project_id=0,
project_name="string")
const keypairResource = new gcore.Keypair("keypairResource", {
publicKey: "string",
sshkeyName: "string",
keypairId: "string",
projectId: 0,
projectName: "string",
});
type: gcore:Keypair
properties:
keypairId: string
projectId: 0
projectName: string
publicKey: string
sshkeyName: 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Keypair resource accepts the following input properties:
- Public
Key string - Sshkey
Name string - Keypair
Id string - The ID of this resource.
- Project
Id double - Project
Name string
- Public
Key string - Sshkey
Name string - Keypair
Id string - The ID of this resource.
- Project
Id float64 - Project
Name string
- public
Key String - sshkey
Name String - keypair
Id String - The ID of this resource.
- project
Id Double - project
Name String
- public
Key string - sshkey
Name string - keypair
Id string - The ID of this resource.
- project
Id number - project
Name string
- public_
key str - sshkey_
name str - keypair_
id str - The ID of this resource.
- project_
id float - project_
name str
- public
Key String - sshkey
Name String - keypair
Id String - The ID of this resource.
- project
Id Number - project
Name String
Outputs
All input properties are implicitly available as output properties. Additionally, the Keypair resource produces the following output properties:
- Fingerprint string
- Id string
- The provider-assigned unique ID for this managed resource.
- Sshkey
Id string
- Fingerprint string
- Id string
- The provider-assigned unique ID for this managed resource.
- Sshkey
Id string
- fingerprint String
- id String
- The provider-assigned unique ID for this managed resource.
- sshkey
Id String
- fingerprint string
- id string
- The provider-assigned unique ID for this managed resource.
- sshkey
Id string
- fingerprint str
- id str
- The provider-assigned unique ID for this managed resource.
- sshkey_
id str
- fingerprint String
- id String
- The provider-assigned unique ID for this managed resource.
- sshkey
Id String
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,
fingerprint: Optional[str] = None,
keypair_id: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
public_key: Optional[str] = None,
sshkey_id: Optional[str] = None,
sshkey_name: 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)
resources: _: type: gcore:Keypair 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.
- Fingerprint string
- Keypair
Id string - The ID of this resource.
- Project
Id double - Project
Name string - Public
Key string - Sshkey
Id string - Sshkey
Name string
- Fingerprint string
- Keypair
Id string - The ID of this resource.
- Project
Id float64 - Project
Name string - Public
Key string - Sshkey
Id string - Sshkey
Name string
- fingerprint String
- keypair
Id String - The ID of this resource.
- project
Id Double - project
Name String - public
Key String - sshkey
Id String - sshkey
Name String
- fingerprint string
- keypair
Id string - The ID of this resource.
- project
Id number - project
Name string - public
Key string - sshkey
Id string - sshkey
Name string
- fingerprint str
- keypair_
id str - The ID of this resource.
- project_
id float - project_
name str - public_
key str - sshkey_
id str - sshkey_
name str
- fingerprint String
- keypair
Id String - The ID of this resource.
- project
Id Number - project
Name String - public
Key String - sshkey
Id String - sshkey
Name String
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.