Show / Hide Table of Contents

Class KeyPair

Provides a Lightsail Key Pair, for use with Lightsail Instances. These key pairs are separate from EC2 Key Pairs, and must be created or imported for use with Lightsail.

Note: Lightsail is currently only supported in a limited number of AWS Regions, please see "Regions and Availability Zones in Amazon Lightsail" for more details

Example Usage, creating a new Key Pair

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    // Create a new Lightsail Key Pair
    var lgKeyPair = new Aws.LightSail.KeyPair("lgKeyPair", new Aws.LightSail.KeyPairArgs
    {
    });
}

}

Create new Key Pair, encrypting the private key with a PGP Key

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var lgKeyPair = new Aws.LightSail.KeyPair("lgKeyPair", new Aws.LightSail.KeyPairArgs
    {
        PgpKey = "keybase:keybaseusername",
    });
}

}

Import an existing public key

using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var lgKeyPair = new Aws.LightSail.KeyPair("lgKeyPair", new Aws.LightSail.KeyPairArgs
    {
        PublicKey = File.ReadAllText("~/.ssh/id_rsa.pub"),
    });
}

}
Inheritance
System.Object
Resource
CustomResource
KeyPair
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.LightSail
Assembly: Pulumi.Aws.dll
Syntax
public class KeyPair : CustomResource

Constructors

View Source

KeyPair(String, KeyPairArgs, CustomResourceOptions)

Create a KeyPair resource with the given unique name, arguments, and options.

Declaration
public KeyPair(string name, KeyPairArgs args = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

KeyPairArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Arn

The ARN of the Lightsail key pair

Declaration
public Output<string> Arn { get; }
Property Value
Type Description
Output<System.String>
View Source

EncryptedFingerprint

The MD5 public key fingerprint for the encrypted private key

Declaration
public Output<string> EncryptedFingerprint { get; }
Property Value
Type Description
Output<System.String>
View Source

EncryptedPrivateKey

the private key material, base 64 encoded and encrypted with the given pgp_key. This is only populated when creating a new key and pgp_key is supplied

Declaration
public Output<string> EncryptedPrivateKey { get; }
Property Value
Type Description
Output<System.String>
View Source

Fingerprint

The MD5 public key fingerprint as specified in section 4 of RFC 4716.

Declaration
public Output<string> Fingerprint { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

NamePrefix

Declaration
public Output<string> NamePrefix { get; }
Property Value
Type Description
Output<System.String>
View Source

PgpKey

An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair

Declaration
public Output<string> PgpKey { get; }
Property Value
Type Description
Output<System.String>
View Source

PrivateKey

the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided

Declaration
public Output<string> PrivateKey { get; }
Property Value
Type Description
Output<System.String>
View Source

PublicKey

The public key material. This public key will be imported into Lightsail

Declaration
public Output<string> PublicKey { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, KeyPairState, CustomResourceOptions)

Get an existing KeyPair resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static KeyPair Get(string name, Input<string> id, KeyPairState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

KeyPairState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
KeyPair
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.