1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. lightsail
  6. KeyPair

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
published on Monday, Sep 21, 2026 by Pulumi
aws-native logo aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
published on Monday, Sep 21, 2026 by Pulumi

    Resource Type definition for AWS::Lightsail::KeyPair

    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,
                key_pair_name: Optional[str] = None,
                tags: Optional[Sequence[_root_inputs.TagArgs]] = 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-native:lightsail:KeyPair
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "aws-native_lightsail_key_pair" "name" {
        # resource properties
    }

    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.

    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:

    KeyPairName string
    The name of the key pair.
    Tags List<Pulumi.AwsNative.Inputs.Tag>
    The tag keys and optional values to add to the resource during create.
    KeyPairName string
    The name of the key pair.
    Tags TagArgs
    The tag keys and optional values to add to the resource during create.
    key_pair_name string
    The name of the key pair.
    tags list(object)
    The tag keys and optional values to add to the resource during create.
    keyPairName String
    The name of the key pair.
    tags List<Tag>
    The tag keys and optional values to add to the resource during create.
    keyPairName string
    The name of the key pair.
    tags Tag[]
    The tag keys and optional values to add to the resource during create.
    key_pair_name str
    The name of the key pair.
    tags Sequence[TagArgs]
    The tag keys and optional values to add to the resource during create.
    keyPairName String
    The name of the key pair.
    tags List<Property Map>
    The tag keys and optional values to add to the resource during create.

    Outputs

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

    CreatedAt string
    The timestamp when the key pair was created.
    Fingerprint string
    The RSA fingerprint of the key pair.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    Location Pulumi.AwsNative.Lightsail.Outputs.KeyPairResourceLocation
    ResourceType string
    The Lightsail resource type (KeyPair).
    SupportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    CreatedAt string
    The timestamp when the key pair was created.
    Fingerprint string
    The RSA fingerprint of the key pair.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    Location KeyPairResourceLocation
    ResourceType string
    The Lightsail resource type (KeyPair).
    SupportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    created_at string
    The timestamp when the key pair was created.
    fingerprint string
    The RSA fingerprint of the key pair.
    id string
    The provider-assigned unique ID for this managed resource.
    key_pair_arn string
    The Amazon Resource Name (ARN) of the key pair.
    location object
    resource_type string
    The Lightsail resource type (KeyPair).
    support_code string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    createdAt String
    The timestamp when the key pair was created.
    fingerprint String
    The RSA fingerprint of the key pair.
    id String
    The provider-assigned unique ID for this managed resource.
    keyPairArn String
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resourceType String
    The Lightsail resource type (KeyPair).
    supportCode String
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    createdAt string
    The timestamp when the key pair was created.
    fingerprint string
    The RSA fingerprint of the key pair.
    id string
    The provider-assigned unique ID for this managed resource.
    keyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resourceType string
    The Lightsail resource type (KeyPair).
    supportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    created_at str
    The timestamp when the key pair was created.
    fingerprint str
    The RSA fingerprint of the key pair.
    id str
    The provider-assigned unique ID for this managed resource.
    key_pair_arn str
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resource_type str
    The Lightsail resource type (KeyPair).
    support_code str
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    createdAt String
    The timestamp when the key pair was created.
    fingerprint String
    The RSA fingerprint of the key pair.
    id String
    The provider-assigned unique ID for this managed resource.
    keyPairArn String
    The Amazon Resource Name (ARN) of the key pair.
    location Property Map
    resourceType String
    The Lightsail resource type (KeyPair).
    supportCode String
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.

    Supporting Types

    KeyPairResourceLocation, KeyPairResourceLocationArgs

    AvailabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    RegionName string
    The AWS Region name.
    AvailabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    RegionName string
    The AWS Region name.
    availability_zone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    region_name string
    The AWS Region name.
    availabilityZone String
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName String
    The AWS Region name.
    availabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName string
    The AWS Region name.
    availability_zone str
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    region_name str
    The AWS Region name.
    availabilityZone String
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName String
    The AWS Region name.

    Tag, TagArgs

    A set of tags to apply to the resource.
    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.80.0
    published on Monday, Sep 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial