ibm.PiKey
Explore with Pulumi AI
Create, update, or delete an SSH key for your Power Systems Virtual Server instance. The SSH key is used to access the instance after it is created. For more information, about SSH keys in Power Virtual Server, see getting started with IBM Power Systems Virtual Servers.
Example Usage
The following example enables you to create a SSH key to be used during creation of a power virtual server instance:
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const testaccSshkey = new ibm.PiKey("testaccSshkey", {
piCloudInstanceId: "<value of the cloud_instance_id>",
piKeyName: "testkey",
piSshKey: "ssh-rsa <value>",
});
import pulumi
import pulumi_ibm as ibm
testacc_sshkey = ibm.PiKey("testaccSshkey",
pi_cloud_instance_id="<value of the cloud_instance_id>",
pi_key_name="testkey",
pi_ssh_key="ssh-rsa <value>")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewPiKey(ctx, "testaccSshkey", &ibm.PiKeyArgs{
PiCloudInstanceId: pulumi.String("<value of the cloud_instance_id>"),
PiKeyName: pulumi.String("testkey"),
PiSshKey: pulumi.String("ssh-rsa <value>"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var testaccSshkey = new Ibm.PiKey("testaccSshkey", new()
{
PiCloudInstanceId = "<value of the cloud_instance_id>",
PiKeyName = "testkey",
PiSshKey = "ssh-rsa <value>",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.PiKey;
import com.pulumi.ibm.PiKeyArgs;
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 testaccSshkey = new PiKey("testaccSshkey", PiKeyArgs.builder()
.piCloudInstanceId("<value of the cloud_instance_id>")
.piKeyName("testkey")
.piSshKey("ssh-rsa <value>")
.build());
}
}
resources:
testaccSshkey:
type: ibm:PiKey
properties:
piCloudInstanceId: <value of the cloud_instance_id>
piKeyName: testkey
piSshKey: ssh-rsa <value>
Notes
- Please find supported Regions for endpoints.
- If a Power cloud instance is provisioned at
lon04
, The provider level attributes should be as follows:region
-lon
zone
-lon04
Example usage:
import * as pulumi from "@pulumi/pulumi";
import pulumi
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
}
}
{}
Create PiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PiKey(name: string, args: PiKeyArgs, opts?: CustomResourceOptions);
@overload
def PiKey(resource_name: str,
args: PiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
pi_cloud_instance_id: Optional[str] = None,
pi_key_name: Optional[str] = None,
pi_ssh_key: Optional[str] = None,
pi_key_id: Optional[str] = None,
timeouts: Optional[PiKeyTimeoutsArgs] = None)
func NewPiKey(ctx *Context, name string, args PiKeyArgs, opts ...ResourceOption) (*PiKey, error)
public PiKey(string name, PiKeyArgs args, CustomResourceOptions? opts = null)
type: ibm:PiKey
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 PiKeyArgs
- 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 PiKeyArgs
- 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 PiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PiKeyArgs
- 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 piKeyResource = new Ibm.PiKey("piKeyResource", new()
{
PiCloudInstanceId = "string",
PiKeyName = "string",
PiSshKey = "string",
PiKeyId = "string",
Timeouts = new Ibm.Inputs.PiKeyTimeoutsArgs
{
Create = "string",
Delete = "string",
},
});
example, err := ibm.NewPiKey(ctx, "piKeyResource", &ibm.PiKeyArgs{
PiCloudInstanceId: pulumi.String("string"),
PiKeyName: pulumi.String("string"),
PiSshKey: pulumi.String("string"),
PiKeyId: pulumi.String("string"),
Timeouts: &ibm.PiKeyTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
})
var piKeyResource = new PiKey("piKeyResource", PiKeyArgs.builder()
.piCloudInstanceId("string")
.piKeyName("string")
.piSshKey("string")
.piKeyId("string")
.timeouts(PiKeyTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.build());
pi_key_resource = ibm.PiKey("piKeyResource",
pi_cloud_instance_id="string",
pi_key_name="string",
pi_ssh_key="string",
pi_key_id="string",
timeouts={
"create": "string",
"delete": "string",
})
const piKeyResource = new ibm.PiKey("piKeyResource", {
piCloudInstanceId: "string",
piKeyName: "string",
piSshKey: "string",
piKeyId: "string",
timeouts: {
create: "string",
"delete": "string",
},
});
type: ibm:PiKey
properties:
piCloudInstanceId: string
piKeyId: string
piKeyName: string
piSshKey: string
timeouts:
create: string
delete: string
PiKey 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 PiKey resource accepts the following input properties:
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Key stringName - User defined name for the SSH key.
- Pi
Ssh stringKey - SSH RSA key.
- Pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - Timeouts
Pi
Key Timeouts
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Key stringName - User defined name for the SSH key.
- Pi
Ssh stringKey - SSH RSA key.
- Pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - Timeouts
Pi
Key Timeouts Args
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Key StringName - User defined name for the SSH key.
- pi
Ssh StringKey - SSH RSA key.
- pi
Key StringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - timeouts
Pi
Key Timeouts
- pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- pi
Key stringName - User defined name for the SSH key.
- pi
Ssh stringKey - SSH RSA key.
- pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - timeouts
Pi
Key Timeouts
- pi_
cloud_ strinstance_ id - The GUID of the service instance associated with an account.
- pi_
key_ strname - User defined name for the SSH key.
- pi_
ssh_ strkey - SSH RSA key.
- pi_
key_ strid - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - timeouts
Pi
Key Timeouts Args
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Key StringName - User defined name for the SSH key.
- pi
Ssh StringKey - SSH RSA key.
- pi
Key StringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the PiKey resource produces the following output properties:
- Creation
Date string - (String) Date of SSH Key creation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key string
- SSH RSA key.
- Name string
- (String) User defined name for the SSH key.
- Creation
Date string - (String) Date of SSH Key creation.
- Id string
- The provider-assigned unique ID for this managed resource.
- Key string
- SSH RSA key.
- Name string
- (String) User defined name for the SSH key.
- creation
Date String - (String) Date of SSH Key creation.
- id String
- The provider-assigned unique ID for this managed resource.
- key String
- SSH RSA key.
- name String
- (String) User defined name for the SSH key.
- creation
Date string - (String) Date of SSH Key creation.
- id string
- The provider-assigned unique ID for this managed resource.
- key string
- SSH RSA key.
- name string
- (String) User defined name for the SSH key.
- creation_
date str - (String) Date of SSH Key creation.
- id str
- The provider-assigned unique ID for this managed resource.
- key str
- SSH RSA key.
- name str
- (String) User defined name for the SSH key.
- creation
Date String - (String) Date of SSH Key creation.
- id String
- The provider-assigned unique ID for this managed resource.
- key String
- SSH RSA key.
- name String
- (String) User defined name for the SSH key.
Look up Existing PiKey Resource
Get an existing PiKey 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?: PiKeyState, opts?: CustomResourceOptions): PiKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
creation_date: Optional[str] = None,
key: Optional[str] = None,
name: Optional[str] = None,
pi_cloud_instance_id: Optional[str] = None,
pi_key_id: Optional[str] = None,
pi_key_name: Optional[str] = None,
pi_ssh_key: Optional[str] = None,
timeouts: Optional[PiKeyTimeoutsArgs] = None) -> PiKey
func GetPiKey(ctx *Context, name string, id IDInput, state *PiKeyState, opts ...ResourceOption) (*PiKey, error)
public static PiKey Get(string name, Input<string> id, PiKeyState? state, CustomResourceOptions? opts = null)
public static PiKey get(String name, Output<String> id, PiKeyState state, CustomResourceOptions options)
resources: _: type: ibm:PiKey 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.
- Creation
Date string - (String) Date of SSH Key creation.
- Key string
- SSH RSA key.
- Name string
- (String) User defined name for the SSH key.
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - Pi
Key stringName - User defined name for the SSH key.
- Pi
Ssh stringKey - SSH RSA key.
- Timeouts
Pi
Key Timeouts
- Creation
Date string - (String) Date of SSH Key creation.
- Key string
- SSH RSA key.
- Name string
- (String) User defined name for the SSH key.
- Pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- Pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - Pi
Key stringName - User defined name for the SSH key.
- Pi
Ssh stringKey - SSH RSA key.
- Timeouts
Pi
Key Timeouts Args
- creation
Date String - (String) Date of SSH Key creation.
- key String
- SSH RSA key.
- name String
- (String) User defined name for the SSH key.
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Key StringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - pi
Key StringName - User defined name for the SSH key.
- pi
Ssh StringKey - SSH RSA key.
- timeouts
Pi
Key Timeouts
- creation
Date string - (String) Date of SSH Key creation.
- key string
- SSH RSA key.
- name string
- (String) User defined name for the SSH key.
- pi
Cloud stringInstance Id - The GUID of the service instance associated with an account.
- pi
Key stringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - pi
Key stringName - User defined name for the SSH key.
- pi
Ssh stringKey - SSH RSA key.
- timeouts
Pi
Key Timeouts
- creation_
date str - (String) Date of SSH Key creation.
- key str
- SSH RSA key.
- name str
- (String) User defined name for the SSH key.
- pi_
cloud_ strinstance_ id - The GUID of the service instance associated with an account.
- pi_
key_ strid - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - pi_
key_ strname - User defined name for the SSH key.
- pi_
ssh_ strkey - SSH RSA key.
- timeouts
Pi
Key Timeouts Args
- creation
Date String - (String) Date of SSH Key creation.
- key String
- SSH RSA key.
- name String
- (String) User defined name for the SSH key.
- pi
Cloud StringInstance Id - The GUID of the service instance associated with an account.
- pi
Key StringId - (String) The unique identifier of the key. The ID is composed of
<pi_cloud_instance_id>/<pi_key_name>
. - pi
Key StringName - User defined name for the SSH key.
- pi
Ssh StringKey - SSH RSA key.
- timeouts Property Map
Supporting Types
PiKeyTimeouts, PiKeyTimeoutsArgs
Import
Example
bash
$ pulumi import ibm:index/piKey:PiKey example d7bec597-4726-451f-8a63-e62e6f19c32c/mykey
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.