1. Packages
  2. AWS
  3. API Docs
  4. lightsail
  5. KeyPair
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.lightsail.KeyPair

Explore with Pulumi AI

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

Create New Key Pair

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

// Create a new Lightsail Key Pair
const lgKeyPair = new aws.lightsail.KeyPair("lg_key_pair", {name: "lg_key_pair"});
Copy
import pulumi
import pulumi_aws as aws

# Create a new Lightsail Key Pair
lg_key_pair = aws.lightsail.KeyPair("lg_key_pair", name="lg_key_pair")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new Lightsail Key Pair
		_, err := lightsail.NewKeyPair(ctx, "lg_key_pair", &lightsail.KeyPairArgs{
			Name: pulumi.String("lg_key_pair"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // Create a new Lightsail Key Pair
    var lgKeyPair = new Aws.LightSail.KeyPair("lg_key_pair", new()
    {
        Name = "lg_key_pair",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.KeyPair;
import com.pulumi.aws.lightsail.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) {
        // Create a new Lightsail Key Pair
        var lgKeyPair = new KeyPair("lgKeyPair", KeyPairArgs.builder()
            .name("lg_key_pair")
            .build());

    }
}
Copy
resources:
  # Create a new Lightsail Key Pair
  lgKeyPair:
    type: aws:lightsail:KeyPair
    name: lg_key_pair
    properties:
      name: lg_key_pair
Copy

Create New Key Pair with PGP Encrypted Private Key

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

const lgKeyPair = new aws.lightsail.KeyPair("lg_key_pair", {
    name: "lg_key_pair",
    pgpKey: "keybase:keybaseusername",
});
Copy
import pulumi
import pulumi_aws as aws

lg_key_pair = aws.lightsail.KeyPair("lg_key_pair",
    name="lg_key_pair",
    pgp_key="keybase:keybaseusername")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := lightsail.NewKeyPair(ctx, "lg_key_pair", &lightsail.KeyPairArgs{
			Name:   pulumi.String("lg_key_pair"),
			PgpKey: pulumi.String("keybase:keybaseusername"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var lgKeyPair = new Aws.LightSail.KeyPair("lg_key_pair", new()
    {
        Name = "lg_key_pair",
        PgpKey = "keybase:keybaseusername",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.KeyPair;
import com.pulumi.aws.lightsail.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 lgKeyPair = new KeyPair("lgKeyPair", KeyPairArgs.builder()
            .name("lg_key_pair")
            .pgpKey("keybase:keybaseusername")
            .build());

    }
}
Copy
resources:
  lgKeyPair:
    type: aws:lightsail:KeyPair
    name: lg_key_pair
    properties:
      name: lg_key_pair
      pgpKey: keybase:keybaseusername
Copy

Existing Public Key Import

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";

const lgKeyPair = new aws.lightsail.KeyPair("lg_key_pair", {
    name: "importing",
    publicKey: std.file({
        input: "~/.ssh/id_rsa.pub",
    }).then(invoke => invoke.result),
});
Copy
import pulumi
import pulumi_aws as aws
import pulumi_std as std

lg_key_pair = aws.lightsail.KeyPair("lg_key_pair",
    name="importing",
    public_key=std.file(input="~/.ssh/id_rsa.pub").result)
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
	"github.com/pulumi/pulumi-std/sdk/go/std"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		invokeFile, err := std.File(ctx, &std.FileArgs{
			Input: "~/.ssh/id_rsa.pub",
		}, nil)
		if err != nil {
			return err
		}
		_, err = lightsail.NewKeyPair(ctx, "lg_key_pair", &lightsail.KeyPairArgs{
			Name:      pulumi.String("importing"),
			PublicKey: pulumi.String(invokeFile.Result),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;

return await Deployment.RunAsync(() => 
{
    var lgKeyPair = new Aws.LightSail.KeyPair("lg_key_pair", new()
    {
        Name = "importing",
        PublicKey = Std.File.Invoke(new()
        {
            Input = "~/.ssh/id_rsa.pub",
        }).Apply(invoke => invoke.Result),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.KeyPair;
import com.pulumi.aws.lightsail.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 lgKeyPair = new KeyPair("lgKeyPair", KeyPairArgs.builder()
            .name("importing")
            .publicKey(StdFunctions.file(FileArgs.builder()
                .input("~/.ssh/id_rsa.pub")
                .build()).result())
            .build());

    }
}
Copy
resources:
  lgKeyPair:
    type: aws:lightsail:KeyPair
    name: lg_key_pair
    properties:
      name: importing
      publicKey:
        fn::invoke:
          function: std:file
          arguments:
            input: ~/.ssh/id_rsa.pub
          return: result
Copy

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: Optional[KeyPairArgs] = None,
            opts: Optional[ResourceOptions] = None)

@overload
def KeyPair(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            name_prefix: Optional[str] = None,
            pgp_key: Optional[str] = None,
            public_key: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None)
func NewKeyPair(ctx *Context, name string, args *KeyPairArgs, opts ...ResourceOption) (*KeyPair, error)
public KeyPair(string name, KeyPairArgs? args = null, CustomResourceOptions? opts = null)
public KeyPair(String name, KeyPairArgs args)
public KeyPair(String name, KeyPairArgs args, CustomResourceOptions options)
type: aws:lightsail:KeyPair
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 KeyPairArgs
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 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 awsKeyPairResource = new Aws.LightSail.KeyPair("awsKeyPairResource", new()
{
    Name = "string",
    NamePrefix = "string",
    PgpKey = "string",
    PublicKey = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := lightsail.NewKeyPair(ctx, "awsKeyPairResource", &lightsail.KeyPairArgs{
	Name:       pulumi.String("string"),
	NamePrefix: pulumi.String("string"),
	PgpKey:     pulumi.String("string"),
	PublicKey:  pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var awsKeyPairResource = new KeyPair("awsKeyPairResource", KeyPairArgs.builder()
    .name("string")
    .namePrefix("string")
    .pgpKey("string")
    .publicKey("string")
    .tags(Map.of("string", "string"))
    .build());
Copy
aws_key_pair_resource = aws.lightsail.KeyPair("awsKeyPairResource",
    name="string",
    name_prefix="string",
    pgp_key="string",
    public_key="string",
    tags={
        "string": "string",
    })
Copy
const awsKeyPairResource = new aws.lightsail.KeyPair("awsKeyPairResource", {
    name: "string",
    namePrefix: "string",
    pgpKey: "string",
    publicKey: "string",
    tags: {
        string: "string",
    },
});
Copy
type: aws:lightsail:KeyPair
properties:
    name: string
    namePrefix: string
    pgpKey: string
    publicKey: string
    tags:
        string: string
Copy

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:

Name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
NamePrefix Changes to this property will trigger replacement. string
PgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
PublicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
Tags Dictionary<string, string>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

Name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
NamePrefix Changes to this property will trigger replacement. string
PgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
PublicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
Tags map[string]string

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

name Changes to this property will trigger replacement. String
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. String
pgpKey Changes to this property will trigger replacement. String
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
publicKey Changes to this property will trigger replacement. String
The public key material. This public key will be imported into Lightsail
tags Map<String,String>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. string
pgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
publicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
tags {[key: string]: string}

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

name Changes to this property will trigger replacement. str
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
name_prefix Changes to this property will trigger replacement. str
pgp_key Changes to this property will trigger replacement. str
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
public_key Changes to this property will trigger replacement. str
The public key material. This public key will be imported into Lightsail
tags Mapping[str, str]

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

name Changes to this property will trigger replacement. String
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. String
pgpKey Changes to this property will trigger replacement. String
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
publicKey Changes to this property will trigger replacement. String
The public key material. This public key will be imported into Lightsail
tags Map<String>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

Outputs

All input properties are implicitly available as output properties. Additionally, the KeyPair resource produces the following output properties:

Arn string
The ARN of the Lightsail key pair.
EncryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
EncryptedPrivateKey string
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.
Fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
Id string
The provider-assigned unique ID for this managed resource.
PrivateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
TagsAll Dictionary<string, string>

Deprecated: Please use tags instead.

Arn string
The ARN of the Lightsail key pair.
EncryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
EncryptedPrivateKey string
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.
Fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
Id string
The provider-assigned unique ID for this managed resource.
PrivateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
TagsAll map[string]string

Deprecated: Please use tags instead.

arn String
The ARN of the Lightsail key pair.
encryptedFingerprint String
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey String
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.
fingerprint String
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
id String
The provider-assigned unique ID for this managed resource.
privateKey String
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
tagsAll Map<String,String>

Deprecated: Please use tags instead.

arn string
The ARN of the Lightsail key pair.
encryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey string
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.
fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
id string
The provider-assigned unique ID for this managed resource.
privateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
tagsAll {[key: string]: string}

Deprecated: Please use tags instead.

arn str
The ARN of the Lightsail key pair.
encrypted_fingerprint str
The MD5 public key fingerprint for the encrypted private key.
encrypted_private_key str
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.
fingerprint str
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
id str
The provider-assigned unique ID for this managed resource.
private_key str
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
tags_all Mapping[str, str]

Deprecated: Please use tags instead.

arn String
The ARN of the Lightsail key pair.
encryptedFingerprint String
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey String
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.
fingerprint String
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
id String
The provider-assigned unique ID for this managed resource.
privateKey String
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
tagsAll Map<String>

Deprecated: Please use tags instead.

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,
        arn: Optional[str] = None,
        encrypted_fingerprint: Optional[str] = None,
        encrypted_private_key: Optional[str] = None,
        fingerprint: Optional[str] = None,
        name: Optional[str] = None,
        name_prefix: Optional[str] = None,
        pgp_key: Optional[str] = None,
        private_key: Optional[str] = None,
        public_key: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, 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: aws:lightsail:KeyPair    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:
Arn string
The ARN of the Lightsail key pair.
EncryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
EncryptedPrivateKey string
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.
Fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
Name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
NamePrefix Changes to this property will trigger replacement. string
PgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
PrivateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
PublicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
Tags Dictionary<string, string>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

TagsAll Dictionary<string, string>

Deprecated: Please use tags instead.

Arn string
The ARN of the Lightsail key pair.
EncryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
EncryptedPrivateKey string
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.
Fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
Name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
NamePrefix Changes to this property will trigger replacement. string
PgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
PrivateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
PublicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
Tags map[string]string

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

TagsAll map[string]string

Deprecated: Please use tags instead.

arn String
The ARN of the Lightsail key pair.
encryptedFingerprint String
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey String
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.
fingerprint String
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
name Changes to this property will trigger replacement. String
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. String
pgpKey Changes to this property will trigger replacement. String
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
privateKey String
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
publicKey Changes to this property will trigger replacement. String
The public key material. This public key will be imported into Lightsail
tags Map<String,String>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

tagsAll Map<String,String>

Deprecated: Please use tags instead.

arn string
The ARN of the Lightsail key pair.
encryptedFingerprint string
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey string
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.
fingerprint string
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
name Changes to this property will trigger replacement. string
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. string
pgpKey Changes to this property will trigger replacement. string
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
privateKey string
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
publicKey Changes to this property will trigger replacement. string
The public key material. This public key will be imported into Lightsail
tags {[key: string]: string}

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

tagsAll {[key: string]: string}

Deprecated: Please use tags instead.

arn str
The ARN of the Lightsail key pair.
encrypted_fingerprint str
The MD5 public key fingerprint for the encrypted private key.
encrypted_private_key str
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.
fingerprint str
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
name Changes to this property will trigger replacement. str
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
name_prefix Changes to this property will trigger replacement. str
pgp_key Changes to this property will trigger replacement. str
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
private_key str
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
public_key Changes to this property will trigger replacement. str
The public key material. This public key will be imported into Lightsail
tags Mapping[str, str]

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

tags_all Mapping[str, str]

Deprecated: Please use tags instead.

arn String
The ARN of the Lightsail key pair.
encryptedFingerprint String
The MD5 public key fingerprint for the encrypted private key.
encryptedPrivateKey String
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.
fingerprint String
The MD5 public key fingerprint as specified in section 4 of RFC 4716.
name Changes to this property will trigger replacement. String
The name of the Lightsail Key Pair. If omitted, a unique name will be generated by this provider
namePrefix Changes to this property will trigger replacement. String
pgpKey Changes to this property will trigger replacement. String
An optional PGP key to encrypt the resulting private key material. Only used when creating a new key pair
privateKey String
the private key, base64 encoded. This is only populated when creating a new key, and when no pgp_key is provided.
publicKey Changes to this property will trigger replacement. String
The public key material. This public key will be imported into Lightsail
tags Map<String>

A map of tags to assign to the collection. To create a key-only tag, use an empty string as the value. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

NOTE: a PGP key is not required, however it is strongly encouraged. Without a PGP key, the private key material will be stored in state unencrypted.pgp_key is ignored if public_key is supplied.

tagsAll Map<String>

Deprecated: Please use tags instead.

Import

You cannot import Lightsail Key Pairs because the private and public key are only available on initial creation.

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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.